From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81354 invoked by alias); 2 Jul 2015 16:19:01 -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 81337 invoked by uid 89); 2 Jul 2015 16:19:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-qk0-f173.google.com Received: from mail-qk0-f173.google.com (HELO mail-qk0-f173.google.com) (209.85.220.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 02 Jul 2015 16:18:59 +0000 Received: by qkbp125 with SMTP id p125so55274368qkb.2 for ; Thu, 02 Jul 2015 09:18:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uadZfOAt8bLy7UqdBYdQ3VBmKu+mRwqbb7/CIsc06Ak=; b=LNjV0HmRqDEjmPif/ehtDEzWb7S/GA3edbMtxIUnoKBc/3M8cmz52x7QUHwKRJvvz8 9oryeBkO8nhrF6TuSvu/+8CTIAHrToANnaF2FP4YJjXabi/kNggQQCOSPZtRNoX7idVs DBjOosbWsa8saIatm1An4aq7ekhrejN3HLk90SJCCZ8B+02s1j7KK7P1pkBMc83SWM6W NF1rcJtVgwo7IIx3rTwms4EsK+QkY3ja/rPnWtnLXizq+/PHRZk8KHBl9INDddbNoCWz ZNjnrdmPOiiBcqLfn/UmwXT1Tx3oMl46M/oWhERdPqnNz4p7QouXAWnn68rhNNKF1L+h 0oMw== X-Gm-Message-State: ALoCoQniHRCGZqINL9XGrzEJShguMnF+Z+gG5FQaqbAamAp6tfo3VBEnIllJ8+JPJBDGPp92eMgM X-Received: by 10.140.84.104 with SMTP id k95mr43660059qgd.45.1435853937542; Thu, 02 Jul 2015 09:18:57 -0700 (PDT) Received: from localhost.localdomain (ool-4353acd8.dyn.optonline.net. [67.83.172.216]) by mx.google.com with ESMTPSA id z81sm2962513qkg.44.2015.07.02.09.18.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Jul 2015 09:18:56 -0700 (PDT) From: Patrick Palka To: gdb-patches@sourceware.org Cc: qiyaoltc@gmail.com, Patrick Palka Subject: [PATCH] Don't throw an error in "show mpx bound" implementation Date: Thu, 02 Jul 2015 16:19:00 -0000 Message-Id: <1435853930-32119-1-git-send-email-patrick@parcs.ath.cx> In-Reply-To: <559559F2.90700@gmail.com> References: <559559F2.90700@gmail.com> X-SW-Source: 2015-07/txt/msg00084.txt.bz2 "show" functions should not throw an exception in part because it causes the output of the commands "info set" and "show" to get truncated. This fixes the following fails: FAIL: gdb.base/default.exp: info set FAIL: gdb.base/default.exp: show gdb/ChangeLog: * i386-tdep.c (i386_mpx_info_bounds): Don't call error, instead use printf_unfiltered. (set_mpx_cmd): Add missing trailing space to command string literal. (_initialize_i386_tdep): Give the "mpx" prefix command its correct name. --- gdb/i386-tdep.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 85e433e..371a282 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -8775,11 +8775,17 @@ i386_mpx_info_bounds (char *args, int from_tty) struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr; 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 == NULL) - error (_("Address of pointer variable expected.")); + { + printf_unfiltered (_("Address of pointer variable expected.\n")); + return; + } addr = parse_and_eval_address (args); @@ -8854,7 +8860,7 @@ static struct cmd_list_element *mpx_set_cmdlist, *mpx_show_cmdlist; static void set_mpx_cmd (char *args, int from_tty) { - help_list (mpx_set_cmdlist, "set mpx", all_commands, gdb_stdout); + help_list (mpx_set_cmdlist, "set mpx ", all_commands, gdb_stdout); } /* Helper function for the CLI commands. */ @@ -8899,7 +8905,7 @@ is \"default\"."), add_prefix_cmd ("mpx", class_support, set_mpx_cmd, _("\ Set Intel(R) Memory Protection Extensions specific variables."), - &mpx_set_cmdlist, "set tdesc ", + &mpx_set_cmdlist, "set mpx ", 0 /* allow-unknown */, &setlist); /* Add "mpx" prefix for the show commands. */ -- 2.5.0.rc0.5.g91e10c5.dirty