Question about debugging in Visual Studio 2022 (С++)

STK STK 61 Reputation points
2022-07-05T20:41:57.307+00:00

Could you help me in Visual Studio (2022) debugging:

1) VS writes a lot of messages in debug window like: thrown exception by address x00007FFFA2CC4FD9 in myprogram.exe: exception Microsoft C++: int in memory address 0x000000C6FDBFF964 (translation may be not exact).

Question1: how can I jump fast to the source line in C++ using the addresses above ?

2) Question2: Is there a way for my program to output a message into VS 2022 debug window (some kind of Debug.Print in Visual Basic) ?

I understand, that C++ is not interpreter, but may be there some interface with debugger to make it ?

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

Accepted answer
  1. RLWA32 49,636 Reputation points
    2022-07-05T21:26:36.153+00:00

    If you want to print a message to the debugger's Ouput Pane you can call the Windows API function OutputDebugString.

    The virtual memory address fhat the debugger shows for a thrown exception may not correspond to a line of source code in your application. For example, exceptions could come from DLLs that are loaded into your process for the VC++ runtime, the UCRT, or various Windows system Dlls that comprise the Windows API.

    Also, the debugger sees all exceptions, including some that may not be problems (first-chance exceptions that are handled). So if you see exceptions in the debugger output pane but your application runs normally and does not fail that could be what you are seeing. You can get finer control over how the debugger handles exceptions by using the debuggers Exception Settings window -

    217837-exception-settings.png

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.