From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dan =?utf-8?B?xIxlcm3DoWs=?= Newsgroups: gmane.emacs.help Subject: Re: GDB - create buffer to show information about CPU registers Date: Thu, 26 Jan 2017 12:42:40 +0100 Message-ID: <87d1faqc7j.fsf@cgc-instruments.com> References: <87fuk8rmlj.fsf@cgc-instruments.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1485431003 29543 195.159.176.226 (26 Jan 2017 11:43:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 26 Jan 2017 11:43:23 +0000 (UTC) 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 12:43:17 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 1cWiSR-0006xh-NN for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Jan 2017 12:43:15 +0100 Original-Received: from localhost ([::1]:37790 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWiSX-0002M7-1J for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Jan 2017 06:43:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWiS5-0002Lr-Qt for help-gnu-emacs@gnu.org; Thu, 26 Jan 2017 06:42:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWiS1-0002uE-0d for help-gnu-emacs@gnu.org; Thu, 26 Jan 2017 06:42:53 -0500 Original-Received: from cgc-instruments.com ([83.169.1.125]:34296) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cWiS0-0002tU-Qz for help-gnu-emacs@gnu.org; Thu, 26 Jan 2017 06:42:48 -0500 Original-Received: from Eclipse.local (p3E9E24A3.dip0.t-ipconnect.de [62.158.36.163]) by cgc-instruments.com (Postfix) with ESMTPSA id 5125BA0CCA for ; Thu, 26 Jan 2017 12:42:45 +0100 (CET) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=cgc-instruments.com; b=jgfup41gL9y5iDP14iBli1IE4CNgvs3XklMkqzVfOSE8KptzArljK4oIsRQgcxlNRe9UJg9A7Cdza2XfyANpSJ67FBOynrNkuUluYTIufpdc/FSRIYJ8yjqp3wD5dKrVBr6xS33gY6/M13QW4gxqhnJdPKfxrJbFU8f6xCriokI=; h=From:To:Subject:In-Reply-To:References:Date:Message-ID:MIME-Version:Content-Type; In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 83.169.1.125 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:112167 Archived-At: 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