Debug delay-loaded dll in Visual Studio 2022 - c++

I can't find the delay-load dll in Modules Window in visual studio, How I can set some configurations to debug this kind of dll?
I am debugging a c++ project and this delay-loaded dll is 3rd party. The PDB file is also copied into the dirctory with the coresponding dll.
Source cpp files can be debugged.
The referenced dll are marked as <DelayLoadDLLs> in .vcxproj file.

Related

C++ static lib pdb is not merged to DLL pdb

I am using visual studio 2008.
I have a C# .exe file A.exe which uses C++ DLL B.dll. B.dll statically links to C++ lib C.lib which has a C.pdb file when compile.
I understand that B.pdb should contain all debug information from C.pdb.
Now A.exe and B.dll and B.pdb are in same directory when I debug. I can step into B.dll code, but can't step into C.lib code because visual studio says debug information is not loaded.
They are all debug build. I have carefully checked compile/link settings but can't see problem.

C++ Symbols not found

I'm trying to compile 3 projects:
A static library (.lib)
A dynamic library (.dll) that uses the .lib of the static library.
An application (.exe) that uses the .dll of the dynamic libaray
However, when trying to compile the .exe and setting a breakpoint, I get the warning "The breakpoint will not currently be hit. No symbols have been loaded for this document."
Well, I know that Visual Studio is missing the .pdb files somehow. However, I don't get why Visual Studio doesn't find it.
The .pdb file of the static library is being generated and is in the same folder than the .lib.
The dynamic library references the folder where the .lib and the .pdb of the static library are inside. A .pdb file is created in the same folder where the .dll is created for the dynamic libary.
The application copies the .dll and the .pdb of the dynamic library before compiling to the folder where the .exe is generated.
Still, Visual Studio is complaining that it doesn't have loaded any symbols. In the output console, it also tells me that it has loaded the symbols of the .exe and the .dll, but not of the .lib. Am I missing somewhat?
When you compile the .exe, you should still link to the .lib file that has been generated when compiling the .dll (so I am speaking about the .lib that comes with the dynamic library, not the one that comes with the static one).
Depending on your visual studio version you might configure that here:
Project->Properties->Configuration Properties->Linker>Input->Additional Dependencies
What version of Visual Studio? Are all the projects in the same solution? If so, Just add the library as a reference to the DLL, and the DLL as a reference to the EXE. Then Visual Studio handles linking everything up, and the .exe, .dll, and .pdb files should all be in the solution output directory.
Also, if you use LoadLibrary to load the DLL the debugger won't load the debug info and won't know where to set the breakpoints in the DLL until after it is loaded, which can cause the error you are seeing as well.

breakpoint will not currently be hit. no symbol have been loaded in dll in c++

I write a dll in c++ and another exe file in c++. I inject my dll with my exe in cpp to for example wordpad.exe. but that does not do what i want so i want to debug my dll.
I write both my dll and my exe in one solution and when i put the breakpoint in both of them, my exe start to debug but the breakpoint in my dll get error that said "the breakpoint will not currently be hit. no symbol have been loaded".
I do most of the solution in internet and put my dll pdb file in the right folder but it is not working.
by the way I write all of my projects in visual studio 2010.
can anyone help me please?
What I understand is that you want to debug your dll code after injecting it into wordpad.exe.
You should attach the visual studio debugger to the wordpad.exe process because that's the process where the dll will be loaded.

How can I force to load / create pdb files for a dll

I have downloaded the latest version of SFML (a library) which includes source files, dlls, headers, and .lib files.
I have no problem using the library and it's linked dynamically.
I'd like to be able to step through the library code in the debugger (I used to be able to which earlier version), but now I can only see the assembly.
What is the usual way to generate pdb files to so?
thanks
Generally Visual Studio 2010 should automatically generate .pdb files for you (if you build in debug mode). Take a look in your Debug output folder. You can see where and what .pdb is being generated from your project settings;
Sterren

Problem creating static/dynamic c++ libraries in visual studio

When I try to build my c++ library (in both static and dynamic mode) using visual studio 2008, in the debug folder, instead of .lib or .dll file, some .obj files are created along with an .idb and an .pdb file.
how can I make visual studio build the library file?
You're either looking in the wrong place or there's a problem in your build.
Open the BuildLog.htm file that VS creates when it does a build (there should be a link you can click in the Build Output window). It'll tell you where it's putting the file. Look for the line containing an "/OUT:" option.