ESP32 JTAG

来自Jack's Lab
(版本间的差异)
跳转到: 导航, 搜索
(GDB Tips)
第10行: 第10行:
  
 
<br><br>
 
<br><br>
 
== GDB Tips ==
 
  
 
== GDB Tips ==
 
== GDB Tips ==

2016年11月6日 (日) 12:57的版本

目录

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
(gdb) i r a                     # show all registers including float and multimedia
(gdb) i r esp
(gdb) i r pc


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





















































个人工具
名字空间

变换
操作
导航
工具箱