Assembly GDB Print String

Posted by Ken on Stack Overflow See other posts from Stack Overflow or by Ken
Published on 2010-05-12T17:03:02Z Indexed on 2010/05/12 17:04 UTC
Read the original article Hit count: 208

Filed under:
|
|
|

So in assembly I declare the following String:

Sample db "This is a sample string",0

In GDB I type "p Sample" (without quotes) and it spits out 0x73696854. I want the actual String to print out. So I tried "printf "%s", Sample" (again, without quotes) and it spits out "Cannot access memory at address 0x73696854."

Short version: How do I print a string in GDB?

© Stack Overflow or respective owner

Related posts about assembly

Related posts about gdb