[Solved] Debugging DLL? lazarus / 12-Debugger ---------------------------------------------------------------------- st · 2010-11-20 22:45 I have 2 simple projects: EXE and DLL both compiled in Lazarus with "-g -gl" options. EXE is defined as "host application" in "Run parameters" of DLL project. When I run DLL in Lazarus and try to stop it on any breakpoints nothing is happened (breakpoints are marked "?"). I tried Lazarus "snapshot" : Lazarus-0.9.29-28296-fpc-2.4.2-20101118-win64.exe Lazarus-0.9.29-28360-fpc-2.4.3-20101120-win32.exe I tried both 32 and 64 Lazarus on Vista64 and 32 Lazarus on XP - no luck. How can I debug DLL ? What is a right way to debug a DLL in Lazarus ? Thanks in advance P.S. It works well on Delphi 2009 Win32... ---------------------------------------------------------------------- ivan17 · 2010-11-21 08:43 i don't think that works (yet), though i'd be happy if someone were to prove me wrong. there is always the i'm-my-own-debugger way - at important points you display variables in a message box or dump them into a text file... ---------------------------------------------------------------------- Martin_fr · 2010-11-21 12:11 What version of GDB do you use? I tested (on windows) with gdb 7.2-1 and I was able to step into a DLL Having said that: Steeping from the hos-app, into the dll with F7 does not seem to work reliable. but stepping inside the dll (once in there) and breakpoints are fine. --Edit: Oh, and i do not have any custom library loading code, I let the Os load the lib, at application start. If you have your own calls to load the library by hand, you may (don't know / maybe not, maybe it even work then) have to wait until the library is loaded, before you can insert the breakpoint. ---------------------------------------------------------------------- st · 2010-11-21 15:48 Yes, it works with Lazarus 0.9.29 r28360 FPC 2.4.3 i386-win32-win32/win64 I updated GBD from 7.0 (included in package) to 7.2 with libexpat-1.dll. It works with Lazarus Win32 on Vista 64 for both of my DLLs (one is loaded at EXE's startup and others are dynamically loaded at runtime by name like plug-in). So it may be a good idea to update the current snapshot package with new GBD. ---------------------------------------------------------------------- ivan17 · 2010-11-21 18:47 ok, i just downloaded new gdb.exe and libexpat-1.dll and everything works nicely. thanks martin! Quote from: Martin_fr on November 21, 2010, 01:11:41 pmSteeping from the hos-app, into the dll with F7 does not seem to work reliable. but stepping inside the dll (once in there) and breakpoints are fine. true. also, i noticed that stepping OUT works. groovy.