-1

I have a c# code which is calling another c# library which P/Invokes to a c++ library so it looks like following:

C# -> C#(P/Invoke) -> C++

I do have source code of both c# and c++ librarries. I am able to step into the c#(p/Invoke) code wince I am referring to the source code into my references.

However, c++ code is not easily compiled. I am referring to a DLL at this point. I want to be just able to step into the c++ code at run time so I can check for some internal logic.

Can resharper help me achieve this? Is there any way that I can do it in Visual studio?

Lost
  • 12,007
  • 32
  • 121
  • 193
  • 1
    To step into the code, you need both the dlls and the PDB (symbol) files. Without the symbols, you can't step into the code in debug mode. – Cory Kramer Feb 24 '14 at 19:10
  • 1
    As @Cyber says, you need the PDB files - by default it will debug "Just my code" which involves looking for PDB files, if they're not there - it can't debug in to them. – Moo-Juice Feb 24 '14 at 19:11
  • If you don't have the source code files for this C++ code then you'll need to learn machine code. Stepping cannot work, you can't step through the pinvoke marshaller. You need to set a breakpoint in the C++ source on the function you pinvoke. – Hans Passant Feb 24 '14 at 19:26
  • possible duplicate of [How to step into C/C++ DLL from C# application while debugging](http://stackoverflow.com/questions/765481/how-to-step-into-c-c-dll-from-c-sharp-application-while-debugging) – Dan Shield Feb 24 '14 at 19:40

1 Answers1

4

If you have the PDB files (as pointed out in the comments above), and your C++ DLL is a debug version, you'll need to check the "Enable native code debugging" check box on the Debug tab of your C# project properties.

You may also need to go into VS2012 Tools->Options menu and update the Debugging->Symbols settings so that VS2012 can find the PDB files.

Dan Shield
  • 1,358
  • 7
  • 14