Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tcf-dev] get_location_info()

Hi Stefan,

Here is my understanding:

> Since I want to debug a small single threaded device like an i8051, I think there shouldn’t exist anything “relative”.
> That’s why I think the agent can treat everything as “absolute” am I right?

For functions like main, they should be absolute in your case.

A relative symbol might be a local variable which as a Dwarf rule to compute it's value.
The local variable is stored relatively from a stack pointer.
In the Dwarf specs (http://dwarfstd.org/doc/Dwarf3.pdf), you might want to look at DW_OP_fbreg for instance.
DW_OP_fbreg: -12
It says your variable is 12 bytes away from the frame pointer.
And the frame pointer also a rule like a register, or a location list.

>
Are there any further information about how the LocationExpressionCommand works? The macros SFT_CMD_* are not really clear to me.

Look at Dwarf _expression_ : To compute a variable location, you might need to parse a Dwarf _expression_.
Tags like DW_OP_addr / DW_OP_swap / ...

In dwarfframe.c, you'll see these tags are converted into SFT_CMD_ to be processed as a command sequence.

Hope it helps a bit.

Best Regards,
Xavier.



On 09/12/2014 10:58 AM, Stefan.Falk@xxxxxxxxxxxx wrote:

Hi Xavier and thank you for answering!

 

 

I think I understand most of it but I’m not quite sure what this means for my symbols.

 

Since I want to debug a small single threaded device like an i8051, I think there shouldn’t exist anything “relative”.

Everything is defined and has its place and I can resolve basically every single symbol to its absolute position in the device RAM.

 

That’s why I think the agent can treat everything as “absolute” am I right?

 

Are there any further information about how the LocationExpressionCommand works? The macros SFT_CMD_* are not really clear to me.

 

Thank you!

 

 

From: tcf-dev-bounces@xxxxxxxxxxx [mailto:tcf-dev-bounces@xxxxxxxxxxx] On Behalf Of Xavier Pouyollon
Sent: Tuesday, September 09, 2014 2:02 PM
To: TCF Development
Subject: Re: [tcf-dev] get_location_info()

 

Hi Peter,

In case of a fully linked, symbols like functions or global variables are at fixed location.
For instance, do nm vmlinux : You'll see a list of symbols and their absolute location.

Now do a nm <kernel_module> : You'll see a list of symbols but the @ will be very low. When you do nm, you can not know where the module will be loaded.
So these symbols are "relative" to where the .text section (if the symbols belong to .text section). The debugger knows where the module will be loaded and get_location will be able to compute the "final" @ (relative location + where the .text section has been loaded)

If you do a readelf -wi, you can see some rule like AT_location : Either a relative location from a register or an address.

Hope it helps a bit.

Xavier.

On 09/09/2014 01:08 PM, Stefan.Falk@xxxxxxxxxxxx wrote:

Hi folks!

 

Does anybody know some things about the whole get_location_info() part?

 

In symbols.c I see that it is being differentiated between an absolute location and a relative location. I’m not quite sure about what symbols fall into “relative location”.

 

I’m also not quite sure about the SFT_CMD_* macros and what exactly a location info “command” is.

 

Thank you for any information!

 

Best regards

 




_______________________________________________
tcf-dev mailing list
tcf-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tcf-dev

 



_______________________________________________
tcf-dev mailing list
tcf-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tcf-dev


Back to the top