VC++ 디버거를 사용하면 디버깅할 때 프로세스 라이브러리 코드가 필요하지 않습니다

4379 단어 MSVCVC++C++
Visual C+Team Blog에 std:function 디버깅 개선 기사가 게재되었습니다.
F11 단계에서 stl 내부 설치에 들어가지 않아 디버깅하고 싶은 곳으로 들어갈 수 있습니다(허가증 따위는 모르니 보도를 참조하십시오
Visual Studio 15.5부터 사용 가능
Improving the debugging experience for std::function
다음 사용자의 목소리가 반영되었습니다
Make StepInto a std::function go directly to the implementation without stepping into std library code.

자기 도서관에서 한번 해볼게요.


본론입니다.
자작고에서도 이런 편리한 기능을 사용하고 싶어요!그래서 std:function 설치를 봤어요.
딱 봐도 건너뛰고 싶은 곳과 멈추고 싶은 곳에 매크로를 넣었어요.
자기 라이브러리도 한번 해볼게요.
※ 비주얼스튜디오 에디션은 15.5.6에 설치.공식 문서가 없으므로 향후 사용할 수 없습니다.

이루어지다


진보 기능이 실현되지 않았다
namespace test
{
    class function
    {
        using func_type = void(*)();
        func_type _pred;
    public:
        function(func_type _f) noexcept
            : _pred(_f)
        {}

        void operator() () const noexcept
        {
            _pred();
        }
    };
}

단계 기능 설치 후
namespace test
{
    class function
    {
        using func_type = void(*)();
        func_type _pred;
    public:
        function(func_type _f) noexcept
            : _pred(_f)
        {}
        void operator() () const noexcept
// 飛ばしたい箇所
#ifndef _DEBUG_FUNCTIONAL_MACHINERY
#line _DEBUGGER_STEP_OVER
#endif /* _DEBUG_FUNCTIONAL_MACHINERY */
        {
// 内部実装を見たい
#ifndef _DEBUG_FUNCTIONAL_MACHINERY
#line _DEBUGGER_STEP_INTO
#endif /* _DEBUG_FUNCTIONAL_MACHINERY */
            _pred();
// 飛ばしたい箇所
#ifndef _DEBUG_FUNCTIONAL_MACHINERY
#line _DEBUGGER_STEP_OVER
#endif /* _DEBUG_FUNCTIONAL_MACHINERY */
        }
    };
}

좋은 웹페이지 즐겨찾기