Debug C++ called from C#

Sysprogs forums Forums VisualGDB Debug C++ called from C#

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12890
    Steve
    Participant

    I have a C# library which P/Invokes a C++ dll built with the VisualGDB MinGW toolchain.
    I have an unit test library for the C# library. I would like to debug some failing unit tests and see what is going on in the C++ code.

    I tried running the C# unit test in debug mode and breaking the execution on the first line. Then opening another instance of Visual Studio, and attaching a debugger with the VisualGDB connection type for debugging the C++ part. But since the code is running as a unit test, I do not know how to attach to it with VisualGDB.

    #12897
    support
    Keymaster

    Hi,

    We would recommend calling the MessageBox() function from your C++ MinGW code at the beginning of the test. This should pause the test displaying the message box. Then you can use Task Manager to locate the PID of the test process and then simply attach to it with VisualGDB (you can also display the PID in the message box itself).

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.