From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12512 invoked by alias); 20 Jul 2009 05:18:42 -0000 Received: (qmail 12502 invoked by uid 22791); 20 Jul 2009 05:18:40 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-px0-f183.google.com (HELO mail-px0-f183.google.com) (209.85.216.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Jul 2009 05:18:33 +0000 Received: by pxi13 with SMTP id 13so1652847pxi.12 for ; Sun, 19 Jul 2009 22:18:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.33.16 with SMTP id l16mr848255wfj.333.1248067112108; Sun, 19 Jul 2009 22:18:32 -0700 (PDT) In-Reply-To: <200907191739.n6JHcxTR008064@brahms.sibelius.xs4all.nl> References: <4A5A810B.7080603@vmware.com> <4A610EE8.1090904@vmware.com> <200907191739.n6JHcxTR008064@brahms.sibelius.xs4all.nl> From: Hui Zhu Date: Mon, 20 Jul 2009 06:14:00 -0000 Message-ID: Subject: Re: [RFA/RFC Prec] Add Linux AMD64 process record support second version, (instruction set support) 1/3 To: Mark Kettenis Cc: msnyder@vmware.com, gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00464.txt.bz2 On Mon, Jul 20, 2009 at 01:39, Mark Kettenis wrote: >> From: Hui Zhu >> Date: Mon, 20 Jul 2009 01:16:10 +0800 > >> =A0/* Parse the current instruction and record the values of the registe= rs and >> =A0 =A0 memory that will be changed in current instruction to "record_ar= ch_list". >> =A0 =A0 Return -1 if something wrong. */ >> >> +#define I386_RECORD_ARCH_LIST_ADD_REG(regnum) \ >> + =A0 =A0do { \ >> + =A0 =A0 =A0 =A0 if (record_arch_list_add_reg (ir.regcache, ir.regmap[(= regnum)])) \ >> + =A0 =A0 =A0 =A0 return -1; \ >> + =A0 =A0 =A0 } while (0) >> + > > Hmm, I really disklike this macro. =A0Having that return embedded in > there is really bad. > > The current implementation of record_arch_list_add_reg() always > returns 0, so I don't see why you need it. > > You should make record_arch_list_add_reg(). > Thanks Mark, I will change it to: +#define I386_RECORD_ARCH_LIST_ADD_REG(regnum) \ + record_arch_list_add_reg (ir.regcache, ir.regmap[(regnum)]) + And about the the "record_arch_list_add_reg", I will post a special patch to change it to void later. Thanks, Hui