Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of "info locals" to dump local variable in hex

Tags:

gdb

Do we have an equivalent of "info locals" to dump local variable in hex?

(gdb) info locals
sa = 33554433
dp = 16
pr = 6
da = 67108865
sp = 16
like image 830
Tectrendz Avatar asked Jan 21 '26 03:01

Tectrendz


1 Answers

You want set output-radix 16. Example:

Temporary breakpoint 1, main () at t.c:3
3         int a = 12, b = 42;
(gdb) n      
4         return a + b;
(gdb) info locals
a = 12
b = 42

(gdb) set output-radix 16
Output radix now set to decimal 16, hex 10, octal 20.

(gdb) info locals
a = 0xc
b = 0x2a
like image 64
Employed Russian Avatar answered Jan 23 '26 20:01

Employed Russian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!