PDA

View Full Version : Debugging a Win32 DLL called from a .NET main


R. T. (Fortran Man)
10-17-2003, 08:11 PM
How do I use the debugger to debug a Win32 (native) DLL that is called from a .NET main?

Lahey Support
10-17-2003, 08:26 PM
The following are directions for using the WinFDB debugger (outside of Visual Studio) to debug a Win32 DLL made with LF95 that is called from a .NET main program (any language). This will only work with the WinFDB debugger in the LF v7.0 product.
[list=1]
Start WinFDB.exe.
Choose File > Open.
Select the .NET main executable (.exe); press Open.
Choose Debug > Go.
Perform any input or dialog events to cause the program to call the DLL (the debugger will automatically break on loading the DLL, but will not load the source code).
Choose File > Open.
Select the Win32 DLL source file(s); press Open.
Set a breakpoint on the first executable line in the Win32 DLL.
Choose Debug > Go; execution will break at the breakpoint.
Use the Mode > Break DLL Load options to control when breaks occur on loading Win32 DLLs.
[/list=1]
Continue debugging as with any Win32 code. Note that the debugger cannot break at all in the .NET code, but will break (once or always depending on the mode set) when any Win32 DLL is called.