Printing string pointed to from Register in GDB

c gdb
17,622

Is there any way to do this in one step?

 (gdb) print *(char**)$esp
Share:
17,622

Related videos on Youtube

user994165
Author by

user994165

Updated on October 17, 2022

Comments

  • user994165
    user994165 over 1 year

    I have a string being moved and i want to print it based on the register.

    I did the following:

    gdb x $esp
    0xbffff110:  "\274\205\004\b\324\361\377\277\334\361\377\277]\257\344\267\304s\374\267"
    
    {then I copied the address}
    
    >> x *0xbffff110
    0x80485bc <__dso_handle+12>:     "test1"
    

    Is there any way to do this in one step?