5

I have a C#.NET Core Web application that uses some C++ code for certain operations. This web application is running on Cent OS 8. (I am a Windows Developer and working on Linux for first time and so with VSCode)

I only have the option to debug using VSCode in CentOS. I am familiar with VS2019 Mixed mode debugging but I am not able to find that option in VSCode. Does it not support it? Launch.Json doesn't allow "profiles" to add to it, which was allowed in VisualStudio2019 which enabled the mixed mode debugging.

One work around I tried was making a Launch.json setting for gdb:

   "configurations": [
       {
           "name": "(gdb) Attach",
           "type": "cppdbg",
           "request": "attach",
           "program": "${workspaceFolder}/CSharpCodeBinary/ManagedCode.dll",
           "processId": "${command:pickProcess}",
           "MIMode": "gdb",
           "setupCommands": [
               {
                   "description": "Enable pretty-printing for gdb",
                   "text": "-enable-pretty-printing",
                   "ignoreFailures": true
               }
           ]
       }

Once I run the ManagedCode.dll on a terminal, I attach to "dotnet" application hoping to get a breakpoint hit in the unmanaged cpp file (that generates UnmanagedCode.so).

The "ManagedCode.dll" is the C# NetCore assembly which loads the native "UnmanagedCode.so" for accessing unmanaged code. I have built "UnmanagedCode.so" using g++ -Og switch to generate symbols.

Still I am getting no luck to hit the breakpoint.

I just want to somehow hit the breakpoint inside UnmanagedCode.so code. Any way is acceptable.

Vaishakh
  • 67
  • 5
  • CORRECTION: I used "(gdb) Launch" instead of "(gdb) Attach" and breakpoint was hit! But still don't know how to debug both managed and un-managed code in one go. – Vaishakh Aug 23 '20 at 10:25
  • Did you figure out something, or did you conclude it was unavailable feature ? – Sold Out Apr 26 '21 at 12:34
  • 1
    I concluded that it was an unavailable feature. Had to debug both separately. – Vaishakh Jun 09 '21 at 12:36

0 Answers0