Adding architecture-specific commands in GDB

Basile STARYNKEVITCH basile@starynkevitch.net
Mon Sep 7 17:28:16 GMT 2026


On Wed, 2026-06-24 at 17:13 +0100, Andrew Burgess via Gdb wrote:
> Matthieu Longo via Gdb <gdb@sourceware.org> writes:
> 
> > Hi all,
> > 
> > Today, GDB seems to support architecture-specific commands for
> > show/set [1]. However, it is not
> > clear to me whether any commands beyond the scope of show/set
> > can/should be easily added.
> > 
> > My usecase consists in adding AArch64-specific commands to dump
> > some tables and permissions set up
> > by the Linux kernel.

GNU GDB is both open source and extensible with Python

So the hard way is to patch the source code of GDB (mostly C)

The easy way might be (if you are less allergic to Python than I am) to
write Python extensions to GDB
https://www.pythonsheets.com/notes/appendix/python-gdb.html
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Extending-GDB.html#Extending-GDB

I (Basile S.) personally prefer GNU guile to Python and GDB can be
extended using GN§U guile
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Guile.html#Guile

Of course, both Python and GNU guile are interpreters and in some cases
(think of dozen of watchpoints) GDB becomes slow.

I even dream of future GDB accepting open source plugins (coded in C
and dlopen-ed on Linux), like the GCC compiler already does:
https://arxiv.org/abs/1109.0779
https://gcc.gnu.org/onlinedocs/gccint/Plugins.html

Sadly, I don't have the skills to implement them.

NB: my open source project (which I dream to become a GNU one) is an
inference engine for expert systems.


-- 

Basile STARYNKEVITCH                           
<basile@starynkevitch.net>
8 rue de la Faïencerie                      
http://starynkevitch.net/Basile/  
92340 Bourg-la-Reine                        
https://github.com/bstarynk
France                               
https://github.com/RefPerSys/RefPerSys
                  https://orcid.org/0000-0003-0908-5250


More information about the Gdb mailing list