Latest GDB version problems

sha0coder sha0 at badchecksum.net
Sat Jun 1 22:04:30 PDT 2013


>> (gdb) p s
>> $1 = 578159222890430469
>>
>> No luck :(
>
> try this:
>
> (gdb) x/dwx &mystirng
> 0xbffff4f4:	0x0000003c        <- size of string
> (gdb)
> 0xbffff4f8:	0xb7ca2540        <- ptr to the string
>
> (gdb) x/s 0xb7ca2540
> 0xb7ca2540:	"this is my string"
> (gdb)

add this macro to your ~/.gdbinit


define ps
   x/s *(unsigned long *)(((char *)&$arg0)+4)
end

then you can do:

(gdb) ps myString
0xb7ca2540:	"this is my string"



More information about the Digitalmars-d-learn mailing list