ESP32 JTAG
来自Jack's Lab
(版本间的差异)
(→Display Register) |
|||
第16行: | 第16行: | ||
<source lang=bash> | <source lang=bash> | ||
− | |||
(gdb) i r a # show all registers including float and multimedia | (gdb) i r a # show all registers including float and multimedia | ||
− | (gdb) i r | + | (gdb) i r |
+ | pc 0x40080f7f 0x40080f7f <_xt_medint3+23> | ||
+ | lbeg 0x0 0 | ||
+ | lend 0x0 0 | ||
+ | lcount 0x0 0 | ||
+ | sar 0x1e 30 | ||
+ | ps 0x60e33 396851 | ||
+ | threadptr 0x0 0 | ||
+ | br 0x0 0 | ||
+ | scompare1 0xb33f0000 3007250432 | ||
+ | acclo 0x0 0 | ||
+ | acchi 0x0 0 | ||
+ | m0 0x0 0 | ||
+ | m1 0x0 0 | ||
+ | m2 0x0 0 | ||
+ | m3 0x0 0 | ||
+ | expstate 0x0 0 | ||
+ | f64r_lo 0x0 0 | ||
+ | f64r_hi 0x0 0 | ||
+ | f64s 0x0 0 | ||
+ | fcr 0x0 0 | ||
+ | fsr 0x0 0 | ||
+ | a0 0x400ecf6b 1074712427 | ||
+ | a1 0x3ffc4e90 1073499792 | ||
+ | a2 0x17 23 | ||
+ | a3 0x3ffc178c 1073485708 | ||
+ | a4 0x1 1 | ||
+ | a5 0x3ffc47b0 1073498032 | ||
+ | a6 0x3ffc478c 1073497996 | ||
+ | a7 0x1 1 | ||
+ | a8 0x3ffb 16379 | ||
+ | a9 0x3ffc4f30 1073499952 | ||
+ | a10 0x3ffb0048 1073414216 | ||
+ | a11 0x3ffc1780 1073485696 | ||
+ | a12 0x3ffbfe68 1073479272 | ||
+ | a13 0x0 0 | ||
+ | a14 0x3ffc4848 1073498184 | ||
+ | a15 0x3ffc4810 1073498128 | ||
(gdb) i r pc | (gdb) i r pc | ||
+ | pc 0x40080f7f 0x40080f7f <_xt_medint3+23> | ||
+ | (gdb) i r epc1 | ||
+ | epc1 0x0 0 | ||
</source> | </source> | ||
− | |||
=== Display Memory === | === Display Memory === |
2016年11月6日 (日) 14:08的版本
目录 |
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
2.1 Display Register
(gdb) i r a # show all registers including float and multimedia (gdb) i r pc 0x40080f7f 0x40080f7f <_xt_medint3+23> lbeg 0x0 0 lend 0x0 0 lcount 0x0 0 sar 0x1e 30 ps 0x60e33 396851 threadptr 0x0 0 br 0x0 0 scompare1 0xb33f0000 3007250432 acclo 0x0 0 acchi 0x0 0 m0 0x0 0 m1 0x0 0 m2 0x0 0 m3 0x0 0 expstate 0x0 0 f64r_lo 0x0 0 f64r_hi 0x0 0 f64s 0x0 0 fcr 0x0 0 fsr 0x0 0 a0 0x400ecf6b 1074712427 a1 0x3ffc4e90 1073499792 a2 0x17 23 a3 0x3ffc178c 1073485708 a4 0x1 1 a5 0x3ffc47b0 1073498032 a6 0x3ffc478c 1073497996 a7 0x1 1 a8 0x3ffb 16379 a9 0x3ffc4f30 1073499952 a10 0x3ffb0048 1073414216 a11 0x3ffc1780 1073485696 a12 0x3ffbfe68 1073479272 a13 0x0 0 a14 0x3ffc4848 1073498184 a15 0x3ffc4810 1073498128 (gdb) i r pc pc 0x40080f7f 0x40080f7f <_xt_medint3+23> (gdb) i r epc1 epc1 0x0 0
2.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)
2.3 Modify Register
(gdb) set $v0 = 0x004000000 (gdb) set $epc = 0xbfc00000
2.4 Modify Memory
(gdb) set {unsigned int}0x8048a51=0x0 (gdb) set *(unsigned int*)0x8048a54=0x55aa55aa
2.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
2.6 Breakpoint & Watchpoint
(gdb) b *0x80400000 (gdb) watch *(unsigned int *)0xbffff400==0x90909090