From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89466 invoked by alias); 24 Jun 2015 11:55:14 -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 89456 invoked by uid 89); 24 Jun 2015 11:55:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f50.google.com Received: from mail-pa0-f50.google.com (HELO mail-pa0-f50.google.com) (209.85.220.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 24 Jun 2015 11:55:12 +0000 Received: by pactm7 with SMTP id tm7so27811653pac.2 for ; Wed, 24 Jun 2015 04:55:10 -0700 (PDT) X-Received: by 10.70.42.233 with SMTP id r9mr78687421pdl.140.1435146910475; Wed, 24 Jun 2015 04:55:10 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id u14sm26515167pbs.0.2015.06.24.04.55.07 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 24 Jun 2015 04:55:09 -0700 (PDT) From: Yao Qi To: Patrick Palka Cc: Doug Evans , Keith Seitz , gdb-patches Subject: Re: Several regressions and we branch soon. References: <5589BECB.7090200@redhat.com> Date: Wed, 24 Jun 2015 11:55:00 -0000 In-Reply-To: (Patrick Palka's message of "Tue, 23 Jun 2015 17:45:02 -0400 (EDT)") Message-ID: <86mvzpqq1z.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00521.txt.bz2 Patrick Palka writes: > The problem here seems to be that the "show" function corresponding to > the "mpx bound" command calls error("Intel(R) Memory Protection > Extensions not supported on this target."); which throws an exception > that causes the entire "info set"/"show" loop to exit early. Should Yes, I think your analysis is correct. > "show foo" ever throw an exception? Should the "info set"/"show" loop > expect an exception to be thrown from a show function? IMO, "show foo" shouldn't throw an exception. > > This diff fixes the default.exp FAILs as far as I can tell: > Thanks for the fix, but I feel that the original code has some drawbacks, > diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c > index 42d0346..d11efa1 100644 > --- a/gdb/i386-tdep.c > +++ b/gdb/i386-tdep.c > @@ -8777,11 +8777,17 @@ i386_mpx_info_bounds (char *args, int from_tty) > struct type *data_ptr_type =3D builtin_type (gdbarch)->builtin_data_pt= r; > > if (!i386_mpx_enabled ()) > - error (_("Intel(R) Memory Protection Extensions not\ > - supported on this target.")); > + { > + printf_unfiltered (_("Intel(R) Memory Protection Extensions not " > + "supported on this target.\n")); > + return; > + } > > if (args =3D=3D NULL) > - error (_("Address of pointer variable expected.")); > + { > + printf_unfiltered (_("Address of pointer variable expected.\n")); > + return; > + } > > addr =3D parse_and_eval_address (args); It is odd that command "info mpx bounds" requires an argument, which is an address. The set/show command pair works in a way that command set modify or update some state of GDB, and command info just display the state of GDB. That is to say, "set mpx bounds ADDRESS" should set address, which is stored somewhere in GDB (in a global variable or a per-inferior variable), and "info mpx bounds" shows the current state or setting in GDB, no argument is needed. If this is a right direction, I can give a patch. b.t.w, is it a good (or bad) idea to register this command if mpx is supported on the target? --=20 Yao (=E9=BD=90=E5=B0=A7)