Open shibumi opened 10 years ago
x/c is internal gdb function and afaik it means only the length of the hex display and never displays the correspondent ascii character. ascii_char is an internal function used somewhere else that requires no newline.
thx but why is gdb showing without your config the current ascii character?
(gdb) x/s 0x80484c0
0x80484c0: "Hello World!"
(gdb) x/c 0x80484c0
0x80484c0: 72 'H'
I want the same behaviour with your config. How can I fix this?
I have no idea, probably some setting conflict.
I got the setting conflict...
just uncomment the following lines:
#set output-radix 0x10
#set input-radix 0x10
This fixed it for me thx..
Ah, those would be my two strongest bets on the source of the problem. Not sure if I want to remove them because they mess a bit the calculations with decimal and hexadecimal values. Need to test it again.
I can confirm it: With the .gdbinit config, x/c is same as x/x. Above proposal restores the original functionality with x/c.
I counldn't reproduce any problems with the hex/dec calculations:
gdb$ x/c 0x8048540 0x8048540: 68 'D' gdb$ x/10c 0x8048540 0x8048540: 68 'D' 111 'o' 32 ' ' 105 'i' 116 't' 0 '\000' 66 'B' 117 'u' 0x8048548: 102 'f' 102 'f' gdb$ x/10x 0x8048540 0x8048540: 0x44 0x6f 0x20 0x69 0x74 0x00 0x42 0x75 0x8048548: 0x66 0x66 gdb$ p 0x44 $1 = 68 gdb$ p 68 $2 = 68 gdb$ p/x 68 $3 = 0x44 gdb$ p/x 0x10+0x10 $4 = 0x20 gdb$ p 0x10+0x10 $5 = 32
Hey, Your gdbinit file is nice! Thx. But I have a problem with it:
x/c 0x80484c0 should show: 0x48 'H' ... where is the char output? I can't find something about it in your config.
...........................................................................................................................
The second Issue:
This is reallly ugly.. why no adding "\n"?
nice greetings from Germany and thx for your gdbinit :+1:
Chris