From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8327 invoked by alias); 15 Sep 2005 12:33:45 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 8310 invoked by uid 22791); 15 Sep 2005 12:33:41 -0000 Received: from eastrmmtao01.cox.net (HELO eastrmmtao01.cox.net) (68.230.240.38) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 15 Sep 2005 12:33:41 +0000 Received: from white ([68.9.64.121]) by eastrmmtao01.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20050915123339.WDNZ9903.eastrmmtao01.cox.net@white>; Thu, 15 Sep 2005 08:33:39 -0400 Received: from bob by white with local (Exim 3.36 #1 (Debian)) id 1EFsvr-0000j8-00; Thu, 15 Sep 2005 08:33:39 -0400 Date: Thu, 15 Sep 2005 12:33:00 -0000 From: Bob Rossi To: wmaple Cc: gdb Subject: Re: Is there a way to define a macro? Message-ID: <20050915123338.GA2777@white> Mail-Followup-To: wmaple , gdb References: <20050915122428.XNUA13028.eastrmgxi08.cox.net@sourceware.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050915122428.XNUA13028.eastrmgxi08.cox.net@sourceware.org> User-Agent: Mutt/1.5.9i X-SW-Source: 2005-09/txt/msg00104.txt.bz2 On Thu, Sep 15, 2005 at 08:22:44PM +0800, wmaple wrote: > Hi. > > When I debug a program on disassambly level, for inspecting registers or memory units, I have to enter same commands again and again. For example, after execution of each instruction, I want to inspecting all common registers. So, every time, I have to enter command 'info register' several times. Is there a way to define a macro, by which I can enter these commands conveniently. > > Thanks! Yes, try something like this, define macro1 b main r next next next end Put that in your .gdbinit file and then start up GDB and type 'macro1' to get it to execute the commands. Bob Rossi