From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10828 invoked by alias); 6 Feb 2013 12:25:21 -0000 Received: (qmail 10686 invoked by uid 22791); 6 Feb 2013 12:25:18 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Feb 2013 12:25:10 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 06 Feb 2013 04:25:09 -0800 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga001.fm.intel.com with ESMTP; 06 Feb 2013 04:25:08 -0800 Received: from irsmsx151.ger.corp.intel.com (163.33.192.59) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.1.355.2; Wed, 6 Feb 2013 12:25:07 +0000 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.82]) by IRSMSX151.ger.corp.intel.com ([169.254.4.144]) with mapi id 14.01.0355.002; Wed, 6 Feb 2013 12:25:07 +0000 From: "Metzger, Markus T" To: Jan Kratochvil CC: "markus.t.metzger@gmail.com" , "gdb-patches@sourceware.org" Subject: RE: record-btrace Date: Wed, 06 Feb 2013 12:25:00 -0000 Message-ID: References: <20130129095303.GA12614@host2.jankratochvil.net> <20130129153617.GA28655@host2.jankratochvil.net> <20130201141829.GA24703@host2.jankratochvil.net> <20130205194508.GA9091@host2.jankratochvil.net> In-Reply-To: <20130205194508.GA9091@host2.jankratochvil.net> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 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: 2013-02/txt/msg00137.txt.bz2 > -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Tuesday, February 05, 2013 8:45 PM > > > > On a similar matter, I renamed the existing "set/show record" subco= mmands by > > > > prepending "full-", i.e. "insn-number-max" becomes "full-insn-numbe= r-max". > > > > > > Could it be a prefix command? "set record full insn-number-max" etc. > > > > > > To match "record full" (vs. "record btrace"). > > > > Done. >=20 > Use --enable-targets=3Dall (and possibly --enable-64-bit-bfd), currently = your > patch: > moxie-tdep.c:575:3: error: implicit declaration of function 'record_arch= _list_add_reg' [-Werror=3Dimplicit-function-declaration] > arm-tdep.c:12603:7: error: implicit declaration of function 'record_arch= _list_add_reg' [-Werror=3Dimplicit-function-declaration] Thanks. I'll fix that. > > When I use add_alias_cmd, I do not get the deprecated warning. Am I doi= ng something > > wrong (patch attached)? >=20 > deprecate_cmd does it, I get the warning with your patch: > (gdb) target record > Warning: command 'target record' is deprecated. > Use 'target record-full'. > [...] For "target record", I added a full command using add_cmd. When I use add_a= lias_cmd and then deprecate_cmd on the returned command, I do not get the warning. > > if (set_terminal) > > target_terminal_inferior (); > > if (q) > > @@ -1915,11 +1917,15 @@ record_goto_bookmark (gdb_byte *bookmark, int f= rom_tty) > > bookmark[strlen (bookmark) - 1] =3D '\0'; > > /* Strip leading quote. */ > > bookmark++; > > - /* Pass along to cmd_record_goto. */ > > + /* Pass along to "record goto". */ > > } > > > > - cmd_record_goto ((char *) bookmark, from_tty); > > - return; > > + cmd =3D xstrprintf ("record goto %s", bookmark); > > + cleanup =3D make_cleanup (xfree, cmd); > > + > > + execute_command (cmd, from_tty); > > + > > + do_cleanups (cleanup); >=20 > Do you have a specific reason for this execute_command call? It could ju= st > call target_goto_record. >=20 > (It was being done in record.c, I do not understand why, it is OK to keep= such > code as is but it should not be newly introduced; I understand it is diff= icult > to find out which part of GDB code should be mimicked and which not.) That was exactly the reason - I tried to do what record.c did. I'll remove = it. > > --- /dev/null > > +++ b/gdb/record-full.h > > @@ -0,0 +1,38 @@ > > +/* Process record and replay target for GDB, the GNU debugger. > > + > > + Copyright (C) 2008-2013 Free Software Foundation, Inc. >=20 > This is a new file, 2013 is enough. It has been copied from record.h so I kept the copyright. > > +/* Truncate the record log from the present point > > + of replay until the end. */ > > + > > +static void > > +cmd_record_delete (char *args, int from_tty) > > +{ > > + require_record (); > > + > > + target_delete_record (args, from_tty); >=20 > I do not think the to_delete_record (and other new to_*_record methods) s= hould > be really at such high level. target_* (to_*) methods should be at API l= evel, > not at user command level. >=20 > Communication with user should be done in cmd_record_delete and only back= end > specific data handling should be in target_delete_record. >=20 > Therefore there could be: >=20 > static void > cmd_record_delete (char *args, int from_tty) > { > require_record (); >=20 > if (target_record_at_end ()) > printf_unfiltered (_("Already at end of record list.\n")); > else if (!from_tty || query (_("Delete the log from this point forward " > "and begin to record the running message " > "at current PC?"))) > target_record_delete_to_end (); > } >=20 > Typically "from_tty" should never be passed to an API method. This will = also > lead to unification of the user interface across record backends. OK. > Sorry if I was not clear enough before, I was also offering this record.c > refactorization to do myself as it sidetracks you a lot from the btrace > implementation. Sorry, I didn't get that. You can help me hook up a stack unwinder in excha= nge;-) I'll send an updated version as an rfc patch series. Regards, Markus. Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052