This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: translate PC to statement
- From: Ramana Radhakrishnan <ramana dot radhakrishnan at codito dot com>
- To: xu at cs dot wisc dot edu
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 26 Aug 2004 09:45:39 +0530
- Subject: Re: translate PC to statement
- References: <412B7669.1010408@cs.wisc.edu>
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