Question
· Apr 11, 2017

Copy of base method in derived class tricks debuger

I have classes A and B, B derived from A, A has method Abc.

From INT of class B I see that compiler copies implementation of Abc to class B, so that Abc exists both in A and B.

As result, when B invokes Abs, B.Abs() is executed instead of A.Abs(). In result debuger is not able to step into Abs and breakpoints in A.Abs never hit.

Why this happens and how can I avoid this?

Update:

OK, now I know the reason: compiler makes the copy if Abc has this line:

cn=##Expression($$$quote(%classname))

hmmmm... compiler needs name of method's class so it "moves" the method to child class. Well, perhaps there is a good reason for that but for the moment the solution looks strange.

I need classname (and %methodname) to provide location to my macro throwing exception in certain conditions. Seems I have to drop that unless someone knows a way how to avoid the copying in this case.

Discussion (21)3
Log in or sign up to continue

here is one real example of my self backed location:

<EXCEPTION>
assertion failed: digi.chimport.debugMakeStatus: invalid param: 'acc' stack:
zthrowif+2^digi.core.AssertException.1 +1
zdebugMakeStatus+7^digi.chimport.1 +1
ztestChImport+43^digi.test.main.1 +1
%DispatchClassMethod+8^digi.test.framework.1 +1
zdoall+11^digi.test.main.1 +1
zrun+3^digi.test.main.1 +1
zDebugStub+30^%Debugger.System.1 +2
</EXCEPTION>