LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-25-2014, 08:40 PM   #1
rabbit2345
Member
 
Registered: Apr 2007
Location: 中国上海
Distribution: openSUSE 11.3
Posts: 371

Rep: Reputation: 40
How to resolve memory arguments in gdb?


Hi,

If possible, it'd be really nice if gdb could translate arguments into hard memory addresses. As in:

Code:
   0x0804945b <+7>:	lea    0x14(%eax),%edx
   0x0804945e <+10>:	mov    %edx,0x1c(%esp)
   0x08049462 <+14>:	lea    0x10(%eax),%edx
   0x08049465 <+17>:	mov    %edx,0x18(%esp)
   0x08049469 <+21>:	lea    0xc(%eax),%edx
to

Code:
   0x0804945b <+7>:	lea    0x0804945b,%edx
   0x0804945e <+10>:	mov    %edx,0x0804945b
   0x08049462 <+14>:	lea    0x0804945c,%edx
   0x08049465 <+17>:	mov    %edx,0x0804945c
   0x08049469 <+21>:	lea    0x0804945d,%edx
It's a bit tedious to translate every argument manually. Does anyone know of a way to do this?


-rabbit
 
Old 09-26-2014, 12:59 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 6,465
Blog Entries: 12

Rep: Reputation: 2221Reputation: 2221Reputation: 2221Reputation: 2221Reputation: 2221Reputation: 2221Reputation: 2221Reputation: 2221Reputation: 2221Reputation: 2221Reputation: 2221
My read is that it can never do that because those are registers and subject to being different content depending on the state of the system at the time of debug and also that this is how most disassemblers work, they give you just the reference register not the content until you resolve the content in that tedious mannger you're mentioning. However you can add watches to various registers to see them change and see their present values as you progress through your disassemble.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stack memory area print that would show symbols and memory address using GDB narasimhap Linux - Software 2 09-21-2014 07:40 PM
gdb debugger and dynamic variables from command line arguments. GNakul Linux - Newbie 0 12-08-2011 02:29 AM
[SOLVED] gdb and memory map itz2000 Linux - Security 1 04-21-2010 10:08 PM
Passing program arguments to gdb eddyq Linux - General 2 11-18-2009 11:17 AM
examine memory with gdb Ephracis Programming 2 05-31-2005 06:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration