translate PC to statement

Ramana Radhakrishnan ramana.radhakrishnan@codito.com
Thu Aug 26 04:16:00 GMT 2004


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
> 



More information about the Gdb mailing list