From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15555 invoked by alias); 27 Mar 2013 07:53:34 -0000 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 Received: (qmail 15532 invoked by uid 89); 27 Mar 2013 07:53:27 -0000 X-Spam-SWARE-Status: No, score=-8.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 27 Mar 2013 07:53:23 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 27 Mar 2013 00:53:21 -0700 X-ExtLoop1: 1 Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga001.jf.intel.com with ESMTP; 27 Mar 2013 00:53:20 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.244]) by IRSMSX104.ger.corp.intel.com ([169.254.5.19]) with mapi id 14.01.0355.002; Wed, 27 Mar 2013 07:53:18 +0000 From: "Metzger, Markus T" To: Pedro Alves CC: GDB Patches Subject: RE: "set record instruction-history" ? Date: Wed, 27 Mar 2013 10:03:00 -0000 Message-ID: References: <51507403.6030208@redhat.com> <51508D60.6040906@redhat.com> <5151836D.90401@redhat.com> <5151E3BE.90603@redhat.com> In-Reply-To: <5151E3BE.90603@redhat.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-03/txt/msg01004.txt.bz2 > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourcewa= re.org] On Behalf Of Pedro Alves > Sent: Tuesday, March 26, 2013 7:07 PM > To: Metzger, Markus T > Thanks! Taking into account the push back in making the > set history size command signed, I've adjusted the patch > to keep this command signed as well and checked it in. > I tried the different numbers that should be affected manually > and I believe it to be an equivalent patch from what you tested. > Let me know, if something broke. There is a single regression... [...] > +static int > +command_size_to_target_size (unsigned int *command) > +{ > + gdb_assert (*command <=3D INT_MAX || *command =3D=3D UINT_MAX); > + > + if (record_call_history_size =3D=3D UINT_MAX) ...here. We should have used *command in the comparison. I also changed the parameter type to "unsigned int" since we're not updating our argument. record: fix instruction-history-size regression =20=20=20=20 (gdb) PASS: gdb.btrace/instruction_history.exp: set record instruction-= history-size 0 record instruction-history 0 Bad range. (gdb) FAIL: gdb.btrace/instruction_history.exp: record instruction-hist= ory - unlimited =20=20=20=20 2013-03-13 Markus Metzger =20=20=20=20 * record.c (command_size_to_target_size): Fix size comparison. Change parameter type from pointer to integer to integer. Update all users. =20=20=20=20 diff --git a/gdb/record.c b/gdb/record.c index b64f3bc..2736a1e 100644 --- a/gdb/record.c +++ b/gdb/record.c @@ -442,18 +442,18 @@ get_insn_history_modifiers (char **arg) meaning unlimited. The target interfaces works with signed int though, to indicate direction, so map "unlimited" to INT_MAX, which is about the same as unlimited in practice. If the user does have - a log that huge, she can can fetch it in chunks across several - requests, but she'll likely have other problems first... */ + a log that huge, she can fetch it in chunks across several requests, + but she'll likely have other problems first... */ =20 static int -command_size_to_target_size (unsigned int *command) +command_size_to_target_size (unsigned int size) { - gdb_assert (*command <=3D INT_MAX || *command =3D=3D UINT_MAX); + gdb_assert (size <=3D INT_MAX || size =3D=3D UINT_MAX); =20 - if (record_call_history_size =3D=3D UINT_MAX) + if (size =3D=3D UINT_MAX) return INT_MAX; else - return *command; + return size; } =20 /* The "record instruction-history" command. */ @@ -467,7 +467,7 @@ cmd_record_insn_history (char *arg, int from_tty) =20 flags =3D get_insn_history_modifiers (&arg); =20 - size =3D command_size_to_target_size (&record_insn_history_size); + size =3D command_size_to_target_size (record_insn_history_size); =20 if (arg =3D=3D NULL || *arg =3D=3D 0 || strcmp (arg, "+") =3D=3D 0) target_insn_history (size, flags); @@ -583,7 +583,7 @@ cmd_record_call_history (char *arg, int from_tty) =20 flags =3D get_call_history_modifiers (&arg); =20 - size =3D command_size_to_target_size (&record_call_history_size); + size =3D command_size_to_target_size (record_call_history_size); =20 if (arg =3D=3D NULL || *arg =3D=3D 0 || strcmp (arg, "+") =3D=3D 0) target_call_history (size, flags); OK to commit? Does this also go onto the 7.6 branch? Thanks, 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