ESP32 JTAG
来自Jack's Lab
(版本间的差异)
(→Display Memory) |
(→GDB Tips) |
||
第34行: | 第34行: | ||
(gdb) x /24i 0x8048a51 # Display the data at the specified address as instruction (24 instructions) | (gdb) x /24i 0x8048a51 # Display the data at the specified address as instruction (24 instructions) | ||
</source> | </source> | ||
+ | |||
=== Modify Register === | === Modify Register === |
2016年11月6日 (日) 12:56的版本
目录 |
1 Overview
$ sudo apt-get install libftdi-dev make libtool pkg-config autoconf automake texinfo $ git clone --recursive git://github.com/espressif/openocd-esp32.git $ cd openocd-esp32 $ ./bootstrap $ make && sudo make install
2 GDB Tips
3 GDB Tips
3.1 Display Register
(gdb) i r (gdb) i r a # show all registers including float and multimedia (gdb) i r esp (gdb) i r pc
3.2 Display Memory
(gdb) x /wx 400801c3 # Display the data at the specified address in hexadecimal (gdb) x /8x $esp (gdb) x /16x $esp+12 (gdb) x /16s 0x86468700 # Display the data at the specified address as a string (gdb) x /24i 0x8048a51 # Display the data at the specified address as instruction (24 instructions)
3.3 Modify Register
(gdb) set $v0 = 0x004000000 (gdb) set $epc = 0xbfc00000
3.4 Modify Memory
(gdb) set {unsigned int}0x8048a51=0x0 (gdb) set *(unsigned int*)0x8048a54=0x55aa55aa
3.5 Search Memory
Usage: find <start> <end> <count> <value> (gdb) define find set $ptr = $arg0 set $cnt = 0 while ( ($ptr<=$arg1) && ($cnt<$arg2) ) if ( *(unsigned int *)$ptr == $arg3 ) x /wx $ptr set $cnt = $cnt + 1 end set $ptr = $ptr + 4 end end
3.6 Breakpoint & Watchpoint
(gdb) b *0x80400000 (gdb) watch *(unsigned int *)0xbffff400==0x90909090