Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct Delphi compiler switches to stop in the user's code, not my component's

Tags:

delphi

vcl

I'm modifying our VCL components so the end user's application links to our dcu files, instead of building our source code each time. We have everything working, but I want the debugger to stop on the user's code when an exception is raised. At first it would stop in our dcu and open the CPU window. I was able to prevent that by removing debug info from the dcu files. But now it still doesn't stop in the users code (like DevExpress libraries and others do).

The following screencast is a short example. The first time I cause an exception in the DevExpress code, and the debugger correctly stops in my button event. The second time I cause an exception in my components, but the debugger doesn't have my button event on the call stack, and doesn't show me where the problem was. Any ideas why?

http://screencast.com/t/NjhlOTRk

Currently building the DCU's with these options:

-$W+ -$D- -h -w -q

Update: The TDataSet methods in between my component and the button event seem to cause this behavior. If I instead call a direct method of my table, I get the expected behavior. I'm guessing there isn't anything I can do about this, but I'm still curious why it happens.

like image 949
Jeremy Mullin Avatar asked May 14 '10 17:05

Jeremy Mullin


1 Answers

If the sourcecode is build instead of dcu's, there is something wrong in the configuration.

The dcus should be in the search path, the source in the browse path.

This way it is not possible for the compiler to not use the DCUs, and you can still debug.

like image 113
Marco van de Voort Avatar answered Oct 05 '22 20:10

Marco van de Voort