debugging a dll on command line
-
Hi, I am trying to debug a dll project on VC++ 6.0. Dll file is loading dynamically in the executable (Win32 Console Application) by LoadLibrary API and calling functions by using function pointers. How can I debug this DLL file? Thank you.
Orkun GEDiK Senior SAP R/3 Basis and Development Consultant ASTRON
-
Hi, I am trying to debug a dll project on VC++ 6.0. Dll file is loading dynamically in the executable (Win32 Console Application) by LoadLibrary API and calling functions by using function pointers. How can I debug this DLL file? Thank you.
Orkun GEDiK Senior SAP R/3 Basis and Development Consultant ASTRON
You can specify a executable to be stared when you want to debug your dll. I don't remember exactly where it was for VC6 but it was somewhere in the project properties.
Cédric Moonen Software developer
Charting control [v1.2] -
You can specify a executable to be stared when you want to debug your dll. I don't remember exactly where it was for VC6 but it was somewhere in the project properties.
Cédric Moonen Software developer
Charting control [v1.2]Hi Cédric, I tried that method before, but didn't work. This is because, as I emphasised in the message, "DLL is loading by LoadLibrary API" in executable. Is there any other suggestion? Thank you.
Orkun GEDiK Senior SAP R/3 Basis and Development Consultant ASTRON
-
Hi, I am trying to debug a dll project on VC++ 6.0. Dll file is loading dynamically in the executable (Win32 Console Application) by LoadLibrary API and calling functions by using function pointers. How can I debug this DLL file? Thank you.
Orkun GEDiK Senior SAP R/3 Basis and Development Consultant ASTRON
In MSDEV take Build->Start Debug->Attach To Process. You can see the running process, from which u can select the application which loaded ur dll. open the cpp of ur dll and u can insert breakpoint and can debug. Another way: On Process tab of Task manager right the exe application, which load the dll, and select debug. MsDEV will open, then u can insert break point on ur dll's cpp file and can debug.
AJay
-
In MSDEV take Build->Start Debug->Attach To Process. You can see the running process, from which u can select the application which loaded ur dll. open the cpp of ur dll and u can insert breakpoint and can debug. Another way: On Process tab of Task manager right the exe application, which load the dll, and select debug. MsDEV will open, then u can insert break point on ur dll's cpp file and can debug.
AJay
-
In MSDEV take Build->Start Debug->Attach To Process. You can see the running process, from which u can select the application which loaded ur dll. open the cpp of ur dll and u can insert breakpoint and can debug. Another way: On Process tab of Task manager right the exe application, which load the dll, and select debug. MsDEV will open, then u can insert break point on ur dll's cpp file and can debug.
AJay
Hi Ajay, I can't attach to the process, because of dll is calling at the begining of the fork. Thank you.
Orkun GEDiK Senior SAP R/3 Basis and Development Consultant ASTRON
-
Thank you. Is there any way to see C code instead of assembly?
Orkun GEDiK Senior SAP R/3 Basis and Development Consultant ASTRON
-
Thank you. Is there any way to see C code instead of assembly?
Orkun GEDiK Senior SAP R/3 Basis and Development Consultant ASTRON
Do you have the .PDB file generated during the build of the dll otherwise enable generation of debug info which can be for release or debug. Try using a DEebug build if you are struggling. Try using WinDebug rather than Visual studio, allthough it does have a learning curve.
-
Do you have the .PDB file generated during the build of the dll otherwise enable generation of debug info which can be for release or debug. Try using a DEebug build if you are struggling. Try using WinDebug rather than Visual studio, allthough it does have a learning curve.
Thank you for your precious feedback. Of course, I have PDB file for executable and dll files. By using this file, can I debug dll file in WinDbg? If I can, how to? Thank you.
Orkun GEDiK Senior SAP R/3 Basis and Development Consultant ASTRON
-
Thank you for your precious feedback. Of course, I have PDB file for executable and dll files. By using this file, can I debug dll file in WinDbg? If I can, how to? Thank you.
Orkun GEDiK Senior SAP R/3 Basis and Development Consultant ASTRON
WinDbg has a symbol search path and a source search path. both of these need to be set up correctly. You can also download symbols for windows DLL's for various OS. You can also specify a debugger for any executable image which will get loaded automatically when the program executes. Very useful for debugging services. "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" create a key called "debugger" with a value like "C:\Program Files\Debugging Tools for Windows\windbg.exe" -g