hugsy / gef-extras

Extra goodies for GEF to (try to) make GDB suck even less
https://hugsy.github.io/gef-extras
MIT License
148 stars 50 forks source link

[Bug] GEF with openocd #96

Open AnduinBrian opened 9 months ago

AnduinBrian commented 9 months ago

GEF+GDB version

GEF: rev:295cbf7afa5fd59a88c066e478bd3ef22760a6de (Git - clean)
GDB: 12.1
GDB-Python: 3.10

Operating System

Ubuntu

Describe the issue you encountered

No Stack and Code segment

Architecture impacted

Describe your issue. Without a proper reproduction step-by-step, your issue will be ignored.

I use openocd to debug my STM32 chip. openocd command:

openocd -f /usr/share/openocd/scripts/interface/stlink.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg

gdb-multiarch command:

file <xxx> # my ELF file
b * loop
gef-remote localhost 3333

I can see there is no Code or Stack segment. image

I can see stack value and code only when i type the command like

x/10x $sp
disass $pc

image

Grazfather commented 9 months ago

Please use gef-extras. See this PR for a work in progress. You could help test it out, in fact.

You'll need to checkout the branch from this PR to get the memory maps working. You'll use pi set_arch("ARMOpenOCD") to get it working.