From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Augusto Fraga Giachero Newsgroups: gmane.emacs.help Subject: Re: GDB - create buffer to show information about CPU registers Date: Thu, 26 Jan 2017 12:55:58 -0200 Message-ID: References: <87fuk8rmlj.fsf@cgc-instruments.com> <87d1faqc7j.fsf@cgc-instruments.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1485442630 20868 195.159.176.226 (26 Jan 2017 14:57:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 26 Jan 2017 14:57:10 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 26 15:57:04 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWlTd-0003F3-Ee for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Jan 2017 15:56:41 +0100 Original-Received: from localhost ([::1]:39115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWlTi-00013a-JG for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Jan 2017 09:56:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWlT8-0000yz-FR for help-gnu-emacs@gnu.org; Thu, 26 Jan 2017 09:56:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWlT3-0000q5-Dz for help-gnu-emacs@gnu.org; Thu, 26 Jan 2017 09:56:10 -0500 Original-Received: from mail-vk0-x242.google.com ([2607:f8b0:400c:c05::242]:36785) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cWlT3-0000pi-9W for help-gnu-emacs@gnu.org; Thu, 26 Jan 2017 09:56:05 -0500 Original-Received: by mail-vk0-x242.google.com with SMTP id n19so19006260vkd.3 for ; Thu, 26 Jan 2017 06:56:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=ZCuth5VcKTmpMq2R+flpjdkvTDCbB7lORSmq4odunj0=; b=Ave7N5J+ShAlnoYwLXgABKfAvzeALZBRYQZcaiEEp4tCxK8eyByKXBeWrn98JGTQlp +EKNf1kvtxfkciyAdL3xFy1Q5exy2WRA4Kngp9pnsdzVWnwbr59eebyQxuytDgIya3h/ +5sj69Wofx7MQ0EyPGgyEclQBRS1+cdrM4dx4R1jmGfZQLWQ0V9rBbDX7aRYi+3LQ3+S I3zMUQ2Z7NYAfBIZWu34WsoQNzmZ3fOiSEMcdueeKdBEzYRBt98vBy+uV00qd7ogcIQg vOf4sz+bGr2WSNvJHI8yaMqbyT2i2NpgJ9PUnohw1zOqjWIEvSgH2wNplTx+Je01Ypns GriQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ZCuth5VcKTmpMq2R+flpjdkvTDCbB7lORSmq4odunj0=; b=ZPZPpDwZjb47FTVA9ZJ93xWciOj3DoAz72NHdu3u+7oA9ku1ECd3xmhg0xBZytY+3B TThB4C9y+n8BYbl/nk53Ekm+70rHNbHkARalLTo2qwCPrW+QcqimqO6bWdm2ZZwoQ1WC 1FrOXb+DcLaWR4N3gttKH8rDKb/inY57YANKqYoaNor2iT9PCDR5G9U26wSbjs9YUmeV FE/74wEaS2mbsR4paz5vFTXHrdrXwVW1OMuB6tlKE6d9mUlmtgAYh6ZgvA6nUm7VTMnm hVnFQgGukZCJeaP/EX0nBQVhu090LoDg8N28eE5kkwAem2m/3tskc7afAxAoaNvGBKIp Qy8w== X-Gm-Message-State: AIkVDXKhkPXrRCQD9IdY8qWfaX/ZsswDXuAmK833sDr3a9nUvrlPFvsOjD8VDLRdzXNn3g== X-Received: by 10.31.86.196 with SMTP id k187mr1555478vkb.4.1485442563087; Thu, 26 Jan 2017 06:56:03 -0800 (PST) Original-Received: from [192.168.1.107] ([201.76.20.188]) by smtp.gmail.com with ESMTPSA id q78sm648045vkb.17.2017.01.26.06.56.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jan 2017 06:56:02 -0800 (PST) In-Reply-To: <87d1faqc7j.fsf@cgc-instruments.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c05::242 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112168 Archived-At: 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 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