From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10988 invoked by alias); 16 Oct 2009 01:27:27 -0000 Received: (qmail 10972 invoked by uid 22791); 16 Oct 2009 01:27:27 -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-pz0-f192.google.com (HELO mail-pz0-f192.google.com) (209.85.222.192) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Oct 2009 01:27:22 +0000 Received: by pzk30 with SMTP id 30so1325253pzk.24 for ; Thu, 15 Oct 2009 18:27:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.21.42 with SMTP id y42mr73588wfi.207.1255656441158; Thu, 15 Oct 2009 18:27:21 -0700 (PDT) In-Reply-To: <4AD75AAD.8040200@vmware.com> References: <4AD75AAD.8040200@vmware.com> From: Hui Zhu Date: Fri, 16 Oct 2009 01:27:00 -0000 Message-ID: Subject: Re: [PATCH] make record_insn_max_num uinteger To: Michael Snyder Cc: "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-10/txt/msg00357.txt.bz2 Cool. Thanks Michael. Hui On Fri, Oct 16, 2009 at 01:23, Michael Snyder wrote: > Treating this as obvious. =A0This variable can't be negative, so use > an unsigned. =A0And use uinteger set command instead of zinteger, so > that it will report itself as "unlimited" when set to zero. > > > 2009-10-15 =A0Michael Snyder =A0 > > =A0 =A0 =A0 =A0* record.c (record_insn_max_num): Make unsigned. > =A0 =A0 =A0 =A0(_initialize_record): Use uinteger instead of zinteger for > =A0 =A0 =A0 =A0set command, so that it will report "unlimited" for zero. > > Index: record.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/record.c,v > retrieving revision 1.22 > diff -u -p -r1.22 record.c > --- record.c =A0 =A015 Oct 2009 17:15:56 -0000 =A0 =A0 =A01.22 > +++ record.c =A0 =A015 Oct 2009 17:26:08 -0000 > @@ -98,7 +98,7 @@ static struct record_entry *record_arch_ > > =A0/* 1 ask user. 0 auto delete the last struct record_entry. =A0*/ > =A0static int record_stop_at_limit =3D 1; > -static int record_insn_max_num =3D DEFAULT_RECORD_INSN_MAX_NUM; > +static unsigned int record_insn_max_num =3D DEFAULT_RECORD_INSN_MAX_NUM; > =A0static int record_insn_num =3D 0; > > =A0/* The target_ops of process record. =A0*/ > @@ -1438,7 +1438,7 @@ When OFF, if the record/replay buffer be > =A0delete the oldest recorded instruction to make room for each new one."= ), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 NULL, NULL, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &set_record_cmdlist, = &show_record_cmdlist); > - =A0add_setshow_zinteger_cmd ("insn-number-max", no_class, > + =A0add_setshow_uinteger_cmd ("insn-number-max", no_class, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&record_insn_max_n= um, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0_("Set record/repl= ay buffer limit."), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0_("Show record/rep= lay buffer limit."), _("\ > >