help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GDB - create buffer to show information about CPU registers


From: Augusto Fraga Giachero
Subject: Re: GDB - create buffer to show information about CPU registers
Date: Thu, 26 Jan 2017 12:55:58 -0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

I use emacs to do embedded firmware development for ARM Cortex M microcontrollers. Recently I've found an interesting python extension for gdb that uses the SVD (System View Description) files provided by the manufacturer: https://github.com/Palmitoxico/PyCortexMDebug (my patched version, the original repository is https://github.com/bnahill/PyCortexMDebug). You can find the respective SVD file for your microcontroller here: https://github.com/posborne/cmsis-svd.

This extension provides detailed information of the peripheral's registers at the bit level. For now it can't write to the registers, but this functionality may be added in the future.



On 26-01-2017 09:42, Dan Čermák wrote:
Thanks for the tip, I think that is everything that I need to get
started!

This solution even has the advantage that I can share it with other
users who don't use Emacs but are still using gdb.

Considering a 'less portable' extension: do you happen to know what
would be the easiest way to create a buffer where the evaluation of
these gdb macros would be shown? So basically to have a gui?


Dan

Stefan Monnier <monnier@iro.umontreal.ca> writes:

My currently biggest issue with my setup is, that to get some
information from a register, I have to print its content with gdb (from
inside Emacs), put that into the mate-calculator to find which bits are
set and which are not and finally open up the datasheet of the CPU and
look up the meaning of each bit.
I don't have a ready-made solution for you, but note that GDB
is scriptable.  If you look at Emacs's src/.gdbinit file
(http://git.savannah.gnu.org/cgit/emacs.git/tree/src/.gdbinit)
you can see what we do to help ourselves debug Emacs's C code.

Note how you can use C-like operations in it, so you could code up some
.gdbinit file for yourself where you write some handy commands that
print the state of your devices's registers in a meaningful manner.

Note that this is a "GDB-only" solution (the only Emacs part of it is
that you got the info in an Emacs discussion group, and that the sample
file provided came from Emacs's source code).


         Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]