LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to resolve memory arguments in gdb? (https://www.linuxquestions.org/questions/programming-9/how-to-resolve-memory-arguments-in-gdb-4175520097/)

rabbit2345 09-25-2014 08:40 PM

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

rtmistler 09-26-2014 12:59 PM

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.


All times are GMT -5. The time now is 02:57 PM.