This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Don't throw an error in "show mpx bound" implementation


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=118ca22445afc728069ca80be2f30dae6913059e

commit 118ca22445afc728069ca80be2f30dae6913059e
Author: Patrick Palka <patrick@parcs.ath.cx>
Date:   Thu Jul 2 11:55:01 2015 -0400

    Don't throw an error in "show mpx bound" implementation
    
    "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.

Diff:
---
 gdb/ChangeLog   |  9 +++++++++
 gdb/i386-tdep.c | 16 +++++++++++-----
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 201af51..5131927 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2015-07-06  Patrick Palka  <patrick@parcs.ath.cx>
+
+	* 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.
+
 2015-07-02  Kevin Buettner  <kevinb@redhat.com>
 
 	* rx-tdep.c (RX_USP_REGNUM, RX_BPC_REGNUM): New constants.
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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]