cadenza
asked on
can't debug DLL
Hi,
I am trying to debug (Delphi 4.03) a DLL which is dynamically loaded by an application. I used to be able to use the debugger on this DLL, but now, all of a sudden, it is no longer possible to set valid breakpoints. Only some source lines (constructor/destructor, non-object procedures) have the blue dot in the gutter after a full build (this used to be for nearly all lines, as far as I recall).
All debugging options are checked (for the DLL as well as for the main app + integrated debugging on), optimization off. It seems to make no difference if 'build with runtime packages' is on or off. Probably I changed something (like a search path or so), but I can not figure out what it is.
Does anyone have an idea what is going on?
Wim
I am trying to debug (Delphi 4.03) a DLL which is dynamically loaded by an application. I used to be able to use the debugger on this DLL, but now, all of a sudden, it is no longer possible to set valid breakpoints. Only some source lines (constructor/destructor, non-object procedures) have the blue dot in the gutter after a full build (this used to be for nearly all lines, as far as I recall).
All debugging options are checked (for the DLL as well as for the main app + integrated debugging on), optimization off. It seems to make no difference if 'build with runtime packages' is on or off. Probably I changed something (like a search path or so), but I can not figure out what it is.
Does anyone have an idea what is going on?
Wim
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You should recompile the whole dll, but not by using F9 key, but by using menu Project|Create <Your dll name>. then optimization should be gone.
ASKER
Hi OpitzS,
so I did (many times, actually), but to no avail.
In the meantime I discovered it has nothing to do with my upgrading from Win95 to Win98, since I started this development after the upgrade.
Uh: you DO agree that it should be possible to debug a dynamically loaded DLL in the IDE, don't you? Or am I wrong here?
Wim
so I did (many times, actually), but to no avail.
In the meantime I discovered it has nothing to do with my upgrading from Win95 to Win98, since I started this development after the upgrade.
Uh: you DO agree that it should be possible to debug a dynamically loaded DLL in the IDE, don't you? Or am I wrong here?
Wim
I did this myself often enough, so it is possible. Do you use D4 S or P or C/S?
Sven
Sven
ASKER
McHaggis:
you were right indeed! I first did not fully understand what you meant, but later I realised where I had to look, and indeed found a mistake there.
Opitzs:
Thanks for your time. + sorry, but McHaggis put me on the right track, so he deserves the points.
Cheers,
Wim
you were right indeed! I first did not fully understand what you meant, but later I realised where I had to look, and indeed found a mistake there.
Opitzs:
Thanks for your time. + sorry, but McHaggis put me on the right track, so he deserves the points.
Cheers,
Wim
No Problem. Points to the right answer is the way it is handled.
Sven
Sven
ASKER
> are you attaching to the right process?
what I do (and always did) is (everything in the Delphi IDE):
- build my DLL
- build my main app
- set a breakpoint in the DLL source
- run the main app, which loads the DLL dynamically. i can see this happens correctly
This used to produce valid breakpoints and execution stopped on the breakpoint in the DLL. Now, however, the breakpoint is always marked as an invalid one (and execution does not stop there, of course).
> are you priviledged enough to register the just-in-time debugger?
this sounds NT to me, I am using Win98. (but I recently upgraded from Win95. could this be relevant?)
There are no restrictions as far as path of sources of main app and DLL is concerned, are there?
Wim