how to debug using breakpoint with exe file and pdb file?

국범 이 0 Reputation points
2023-08-01T13:56:02.2466667+00:00

hi.

now I  want to run some exe file with debugger using breakpoint in visual studio.

I have "unit_tests.exe" file and "unit_tests.exe.pdb" file. as I know, I can debug with breakpoint because I have pdb file.

but I cannot found how to do this specifically.

when I open exe file, nothing shows in soloution exporer. is it normal ?

111111111제목 없음

I just want to use "breakpoint" feature when I run "unit_tests". that's all.

Is there any tutorial about how to do this ?

thank you

Developer technologies | Visual Studio | Debugging
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,441 Reputation points Microsoft External Staff
    2023-08-02T06:46:36.0433333+00:00

    Hello @국범 이,

    Welcome to Microsoft Q&A forum.

    This document: Debug an app that isn’t part of a Visual Studio solution (C++, C#, Visual Basic, F#) mentions:

    Debugging features for an app that wasn’t built in Visual Studio are limited, whether you attach to the app or add it to a Visual Studio solution.

    If you have the source code, the best approach is to import the code into a Visual Studio project. Then, run a debug build of the app.

    If you don’t have the source code, and the app doesn't have debug information in a compatible format, available debugging features are very few.

    In your scenario, if you only have .exe file and .pdb files, without source files, you can debug but probably, you cannot step into or set/hit breakpoints.

    If you still need to debug this exe file by using breakpoints, please refer to this blog: How to debug and profile any EXE with Visual Studio. You may need to consider decompiling the source code.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.