unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Augusto Fraga Giachero <augustofg96@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: GDB - create buffer to show information about CPU registers
Date: Thu, 26 Jan 2017 12:55:58 -0200	[thread overview]
Message-ID: <b60544fb-dd51-9789-56dc-c4b192c97441@gmail.com> (raw)
In-Reply-To: <87d1faqc7j.fsf@cgc-instruments.com>

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	other threads:[~2017-01-26 14:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25  0:48 GDB - create buffer to show information about CPU registers Dan Čermák
2017-01-25  5:16 ` Stefan Monnier
2017-01-25 12:09   ` Skip Montanaro
2017-01-26 11:42   ` Dan Čermák
2017-01-26 14:55     ` Augusto Fraga Giachero [this message]
2017-01-27  0:58     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b60544fb-dd51-9789-56dc-c4b192c97441@gmail.com \
    --to=augustofg96@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).