mirror of
https://github.com/artizirk/dotfiles.git
synced 2024-11-22 16:30:59 +02:00
Add xxd commmand to gdb
This commit is contained in:
parent
3ddc8c5e99
commit
97ded15bdb
19
.gdbinit
19
.gdbinit
@ -39,3 +39,22 @@ set mem inaccessible-by-default off
|
|||||||
# define target remote
|
# define target remote
|
||||||
# bmconnect /dev/ttyBmpGdb
|
# bmconnect /dev/ttyBmpGdb
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
|
||||||
|
define xxd
|
||||||
|
if $argc < 2
|
||||||
|
set $size = sizeof(*$arg0)
|
||||||
|
else
|
||||||
|
set $size = $arg1
|
||||||
|
end
|
||||||
|
dump binary memory dump.bin $arg0 ((void *)$arg0)+$size
|
||||||
|
eval "shell xxd -o %d dump.bin; rm dump.bin", ((void *)$arg0)
|
||||||
|
end
|
||||||
|
document xxd
|
||||||
|
Dump memory with xxd command (keep the address as offset)
|
||||||
|
|
||||||
|
xxd addr [size]
|
||||||
|
addr -- expression resolvable as an address
|
||||||
|
size -- size (in byte) of memory to dump
|
||||||
|
sizeof(*addr) is used by default
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user