Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tcf-dev] Stack trace evaluation in the UI

Hi Christophe,

The rationale behind it goes like this:
Since it is not a top frame, PC is return address - it points to an instruction after call instruction, and PC-1 is address of last byte of the call instruction. So, to lookup a caller, PC-1 is used. In other words, we want to show a function that owns the call instruction. Same is done with line number info. Actually, it is done mostly because of the line number info - most users want see line that contain the call, not the line which contains return address.

Regards,
Eugene


-----Original Message-----
From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Christophe Augier
Sent: Monday, May 13, 2013 3:01 AM
To: TCF Development
Subject: [tcf-dev] Stack trace evaluation in the UI

Hi,

I've been working on a stack trace problem recently and found a probable
cause in the UI. Here is a log of the UI evaluating a stack trace:

448.180 Out: C 173 StackTrace getContext ["FP0.tracker0.ctx169"]
448.180 Inp: R 173
[{IP:266729288,ID:"FP0.tracker0.ctx169",Level:0,ProcessID:"tracker0.ctx168",ParentID:"tracker0.ctx169"}]
null
448.181 Out: C 174 LineNumbers mapToSource "tracker0.ctx168" 266729287
266729288
448.181 Out: C 175 Symbols findByAddr "tracker0.ctx168" 266729287
448.181 Inp: R 174 null []
448.182 Inp: R 175 null
"@M0.@S3.25.3630810.50A3C8EC.0.0.3.-1.909.0.0.tracker0.ctx168"
448.182 Out: C 176 Symbols getContext
"@M0.@S3.25.3630810.50A3C8EC.0.0.3.-1.909.0.0.tracker0.ctx168"
448.182 Inp: R 176 null
{Name:"__libc_start_main",TypeClass:8,UpdatePolicy:0,Class:3,Address:266729064,ID:"@M0.@S3.25.3630810.50A3C8EC.0.0.3.-1.909.0.0.tracker0.ctx168",OwnerID:"tracker0.ctx168",Size:224}

I'd like to understand why the UI looks for the symbol at pc -1 instead
of pc?

Because of the minus one, the stack trace finds the frame in a specific
function when it should not:

__libc_start_main starts at 266729064 with size 224
pc in __libc_start_main equals to pc < (266729064 + 224)
so while it's false for pc = 266729288, it's true for pc = 266729287

Any reason it's done that way? Thanks for your help.

- Christophe

_______________________________________________
tcf-dev mailing list
tcf-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/tcf-dev



This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.




Back to the top