Home > On-Demand Archives > Theatre Talks >

GDB Deep Dive

Gillian Minnehan - Memfault - Watch Now - EOC 2024 - Duration: 32:29

GDB Deep Dive
Gillian Minnehan

GDB is a powerful tool to analyze and debug firmware. It enables developers to step through instructions, view disassembly, peer into registers, analyze back traces, and so much more to help debug. Without it, I cannot imagine developing firmware! There is a lot to unpack about how to use GDB effectively, so this talk will focus on a few key topics including a rundown of important GDB commands, the GDB Python API, options for visual debugging, and how GDB plays a role even after you ship IoT device firmware.

M↓ MARKDOWN HELP
italicssurround text with
*asterisks*
boldsurround text with
**two asterisks**
hyperlink
[hyperlink](https://example.com)
or just a bare URL
code
surround text with
`backticks`
strikethroughsurround text with
~~two tilde characters~~
quote
prefix with
>

SimonSmith
Score: 0 | 7 months ago | no reply

A well put together presentation. What I didn’t get was why should use GDB, vs something like IAR with integrated visual debugger (apart from cost)?

JoeTrainor
Score: 0 | 7 months ago | no reply

Gillian great presentation. I have been recently debugging systems with the debugger locked for deployment. I am starting to monitor registered in the DebugMon ISR. Do you have any experience with monitors and could recommend reference material/additional resources? I found an article from Memfault (https://interrupt.memfault.com/blog/cortex-m-debug-monitor) that helped so far and this tool (https://github.com/adamgreen/mri). Not sure if there is anything else available.

George
Score: 0 | 7 months ago | no reply

Nathan, regarding the question of MCU watchpoints memfault already has a great article on how they work in cortex-m devices:
https://interrupt.memfault.com/blog/cortex-m-watchpoints

Also regarding SVD support on GDB. AFAIK there is no native SVD support in GDB, I tried this tool before and it worked OK for me:
https://github.com/bnahill/PyCortexMDebug

nathancharlesjones
Score: 0 | 7 months ago | no reply

Great talk, Gillian! My mind is a-flurry with ideas and questions.

  • Could you explain what you meant by "GDB server is too complex for MCUs"? I had thought, after reading this article, that MCUs could run at least a minimal version of gdbserver.
  • Is it possible to use watchpoints if my MCU doesn't have hardware support for those?
  • Do you know how I can import SVD files into GDB to more easily inspect memory-mapped registers?
  • Is there any important difference between target remote and target extended-remote? I'm reading that it has to do with whether or not GDB remains attached to gdbserver when the program exits, but maybe that ends up being the same for embedded systems since there's only ever one program running at a time.
  • For visual debugging, I also really like gdbgui!
  • Do you have a favorite GDB cheatsheet?
  • Is there a standard format for coredumps? Can I not use gdb to inspect a coredump I create from an MCU that isn't running Linux?
Andre.Hartmann
Score: 0 | 7 months ago | no reply

Thank you for this nice presentation, Gillian. I was able to improve my gdb knowledge.

davek
Score: 0 | 7 months ago | no reply

That was a very informative presentation. I wasn’t aware of the python API. Is memfault open source?

Carlos.Amaya
Score: 0 | 7 months ago | no reply

Thank you Gillian, very informative!

mck
Score: 0 | 7 months ago | no reply

Great presentation! You mentioned using silabs and simplicity studio which has gdb support. Do you have any tips for using what you showed in the presentation with the GDB there?

datamstr
Score: 0 | 7 months ago | no reply

Gillian, that was a very good and interesting presentation! I plan on looking into GDB! Thanks!

OUR SPONSORS

OUR PARTNERS