Skip to content

coredump

  • limit -c unlimited
  • core file name /proc/sys/kernet/core_pattern

change it: echo "./my_core" > /proc/sys/kernet/core_pattern

  • load a core
    gdb ./xx.elf ./my_core

Remote

GDB 在调试的时候,会通过 RSP 协议进行交互,默认这些信息是不显示的,增加 “set debug remote 1” 的配置,开启这些显示:

GDB指令

  • program settings
  • set args
  • show args
  • expression evaluation
  • display - print -x
  • infomation
  • info address - info registers - info files - info line - info registers - info source - info symbol - info types - info variables
  • Stack-info
  • bt - frame - up
    - down - info args - info frame - info locals - select-frame
  • lay next
  • break

break main - break main - clear - delete - disable - enable - info

  • run
  • next
  • nexti
  • step
  • ref
  • x/i $pc
  • info registers

load

  • file file_name
  • load
  • target remote :3333
  • info register
  • i
  • info breakpoint
  • break
  • c

use tty target with BMG

  • tar ext /dev/ttyACM0
target extended-remote  /dev/cu.usbmodem39A2337132331
目标板的测试程序
  • mon s
  • att 1
  • load

tui

  • tui enable /disable
  • layout next | prev | src | asm| regs |