This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: translate PC to statement


Hi Min,

> Ramana,
>
> Thank you very much for the reply. I realize I didn't explain my question
> well
> enough. Basically, the instructions that I am interested in are always
> loads
> or stores on SPARC. I am particularly interested in known what's the
> variable
> the instruction is accessing. I Imagine that information can be obtained
> statically, without need of a live frame, since the instruction is always
> accessing some variable encoded in some source code statements.

Yes that information can certainly be obtained statically using a dwarf
dump utility. Recently gcc (3.5 onwards) introduced location lists for
tracking information regarding local variables in a frame and to track the
same (Even though I am not sure about how much it works since I saw a post
on the gcc mailing list which claimed a few regressions in the debug
output vis a vis gdb ). .
I am not sure though if dwarfdump gives you the output for this.


In any case if you are looking at only tracking a fixed number of 
variables changing maybe you could use watchpoints to do that  ?


Hope this helps.

cheers
Ramana











>
> Thanks for the info on RTL debug dump and dwarfdump, I will check it out.
>
> -Min
>
> On Thu, 26 Aug 2004 Ramana Radhakrishnan wrote :
>> Hey Min,
>>
>>
>> >Hi There,
>> >
>> >Sorry if this is a stupid question, but I couldn't find answer using
>> >either google or gdb manual.
>> >
>> >Basically I want to know what part of a source code statement produced
>> a
>> >instruction in the final binary. I have used "info line *(pc)" command,
>> >which gives me pretty good information on what line produced the PC.
>> >However, I wanted more information than just the source line.
>>
>> Can you define more information and then maybe we can suggest something
>> ?
>>
>>
>> >I compiled
>> >my program with -g. I wonder if this information is kept in the debug
>> >information? How can I query it? It would be nice if I can obtain some
>> >information such as why a given instruction is generated from a source
>> >line.
>>
>> Because the compiler generated it ;-) . If you want more information
>> about how an instruction is generated by gcc / which pattern in the
>> backend of gcc matches with the instruction, maybe you could use the RTL
>> debug dumps to look at stuff. But this might not be the right list to
>> query about it.
>>
>>
>>
>> >This is some times not obvious at all. For example, I often get a
>> >instruction that map back to a source line that has only a "{"!
>>
>> Further if the debug format is in Dwarf2 you might try using dwarfdump
>> (Don't remember the link , so do a google for it ) and use the
>> information it prints out about the debug information in your program .
>>
>> Hope this helps.
>>
>> cheers
>> Ramana
>>
>>
>> >
>> >I'd really appreciate your help.
>> >
>> >-Min
>> >
>>
>


----
Ramana Radhakrishnan
Codito Technologies


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]