Reputation: 701
I have a static library written in C++, which can be downloaded in binary or compiled from source here. In that static library, I would like to set a breakpoint at a function call. I have created a wrapper C++ DLL to that static library, and a C# unit test project that calls functions in that C++ DLL. However, when I try to debug the static library, the functions are greyed out (see below), and I get a message that says "Source Not Available".
How would it be possible to step into the source code and set a breakpoint? I tried using Debug > New Breakpoint > Function Breakpoint
, but if I type in a function like module_runtime_path
, it doesn't break at all. Unfortunately, the current source doesn't allow for building from Visual Studio (it can only be built from Ninja). If I build using Ninja, I've also tried adding all sorts of PDB locations but to no avail.
Is there any way for me to set a breakpoint in the static library?
Upvotes: 1
Views: 1424
Reputation: 701
I can't pinpoint the exact solution, but I ended up building from source and setting in my C++ DLL project, in Properties > Configuration Properties > Linker > Debugging
, I set Generate Debug Info=Optimize for debugging (/DEBUG)
. After that, I was able to step into the static library.
Upvotes: 0