Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

TrackMethod logs LeaveMethod call prematurely


#1

Code sample from main form constructor:

[code]__fastcall TMainForm::TMainForm(TComponent *Owner) :
TForm(Owner)
{
SiMain->TrackMethod(lvDebug, this, L"TMainForm");

SiMain->LogVerbose(L"some message");
}[/code]

The log output in SI Console:

==> TMainForm.TMainForm
<== TMainForm.TMainForm
some message

Why is message “some message” logged after LeaveMethod log entry? Shouldn’t the log output look like this? Isnt the purpose of TrackMethod (in comparison to EnterMethod & LeaveMethod methods together with try finally construction) to simplify code instrumenting?

==> TMainForm.TMainForm
some message
<== TMainForm.TMainForm

#2

Thanks for your posting. We haven’t seen this behavior before and the ordering should be different, yes. Do you only see this in constructors or also normal methods?

Regards,
Tobias