From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6792 invoked by alias); 26 Aug 2004 13:53:33 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 6467 invoked from network); 26 Aug 2004 13:53:26 -0000 Received: from unknown (HELO everest.cs.wisc.edu) (128.105.166.17) by sourceware.org with SMTP; 26 Aug 2004 13:53:26 -0000 Received: (from xu@localhost) by everest.cs.wisc.edu (8.9.2/8.9.2) id IAA11281; Thu, 26 Aug 2004 08:53:13 -0500 (CDT) Date: Thu, 26 Aug 2004 13:53:00 -0000 From: "Min Xu (Hsu)" To: Ramana Radhakrishnan Cc: gdb@sources.redhat.com Subject: Re: translate PC to statement Message-ID: <20040826135300.GA11242@cs.wisc.edu> References: <412B7669.1010408@cs.wisc.edu> <412D63EB.8070504@codito.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <412D63EB.8070504@codito.com> User-Agent: Mutt/1.5.5.1i X-SW-Source: 2004-08/txt/msg00386.txt.bz2 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. 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 > > >