views:

313

answers:

3

Hi,

On setting "Use debug .dcus" option to True in project options, method calls in my application does not work as expected.

Say for example,

I call a method func(a, b, c);

In the "func" definition c's value is assigned to "a" and a's values is assigned to "c" and everything goes crazy.

I tried to create it in sample application, but with no luck. It is happening only in my live project.

Any one faced the same issue?

From delphi docs I see that Debug dcus option builds information using stack frames. Anything related to this?

Pavan.

A: 

This is sort of an obvious one, but did you make sure to do a full rebuild and not just a normal compile? Anytime you change project settings, you have to do a full rebuild or you'll end up with undefined behavior. (That's the technical term for "everything goes crazy.")

Mason Wheeler
Hi Mason, yes, I rebuilt the whole project group. I deleted all the dcu files and made sure that everything is latest built. But the same behaviour.
Pavan
And beside that, IIRC when modifying includefiles too.
Marco van de Voort
+4  A: 

If you can't create a sample application, then it obviously must be something in your live project that is not what you might expect.

I can only suggest you tackle the problem by making a copy of your live project, and then systematically remove one thing at a time. The step that makes the problem go away will help you narrow down where the problem is.

lkessler
A: 

Are you doing anything with generics or anonymous methods? Even with Update 3 installed, the Delphi 2009 compiler still has several subtle bugs in it--mostly related to the new features--that can be very difficult to reduce down to a simple test case.

Mason Wheeler
Hi Mason, thank you for showing interesting in finding a solution to this problem. Actually, I am not using any new features. I have overloaded method with params func1(obj : TObject; a : integer; d : Tdatetime) and func1(obj: TObject; f: Double; d: Tdatetime). First time I observed the erroneous behaviour in this case. So I thought that it could be related with method overloading, and I gave a try by defining two seperate functions but still the same behaviour. And note that, this happens only when I set "Use debug DCUs" option to True.If I dont set that option everything works normally.
Pavan