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 Martin,

> So what you'd really want is computing the "previous instruction". But doing just PC-1 won't give you that on architectures with variable instruction length.

This irrelevant which byte of an instruction to use (first or last) to lookup symbol info - as long as all bytes of the instruction belong to same function and same source line, which should always be the case.

> but what about the stacktracing code that wants to accurately compute the assembly return address ?

That code is not affected. PC-1 value is only used by the Debug view to build stack frame node label.

> were you planning to document that behavior in the TCF API Docs ?

This does not affect any API. The value is computed and used internally by the Debug view.

Regards,
Eugene

-----Original Message-----
From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Oberhuber, Martin
Sent: Tuesday, May 14, 2013 6:17 AM
To: TCF Development
Subject: Re: [tcf-dev] Stack trace evaluation in the UI

Hi Eugene,

I'm still a little confused.

So what you'd really want is computing the "previous instruction". But doing just PC-1 won't give you that on architectures with variable instruction length. I know that on Intel at least, it is very nontrivial to compute the "previous instruction address".

I understand that doing PC-1 might give you the expected line number from the ELF/Dwarf debug info ... but what about the stacktracing code that wants to accurately compute the assembly return address ?  And what about debugging scenarios where no debug info is available ?

If the stack crawl knows that the UI consistently always does PC-1 already that might work, though it feels strange ... were you planning to document that behavior in the TCF API Docs ?
Since it looks like any implementer of a stack crawl would need to be aware of that peculiar behavior, right ?

Thanks,
Martin
--
Martin Oberhuber, SMTS / Product Architect - Development Tools, Wind River
direct +43.662.457915.85  fax +43.662.457915.6

-----Original Message-----
From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Christophe Augier
Sent: Tuesday, May 14, 2013 3:08 PM
To: tcf-dev@xxxxxxxxxxx
Subject: Re: [tcf-dev] Stack trace evaluation in the UI

On 5/14/2013 12:57 AM, Eugene Tarassov wrote:
> 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.

Makes sense. Thanks Eugene for explaining!

- Christophe
_______________________________________________
tcf-dev mailing list
tcf-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/tcf-dev
_______________________________________________
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