This is the mail archive of the gdb-patches@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]

[PATCH] sh64-tdep.c don't print unavailabel/optimized-out values.


Spotted that in sh64-tdep.c we sometimes try to print optimized
out or unavailable values.

This patch is untested (other than building with enable all targets),
but I find it hard to believe what we have is the desired behaviour.
I'm also comparing to infcmd.c:default_print_one_register_info as an
example of how other targets behave.

OK to apply?

Andrew

gdb/ChangeLog

2013-08-28  Andrew Burgess  <aburgess@broadcom.com>

	* sh64-tdep.c (sh64_do_register): Return after printing message
	about unavailable register contents.

diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index b640b1d..e9ce42b 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -2045,7 +2045,10 @@ sh64_do_register (struct gdbarch *gdbarch, struct ui_file *file,
 
   /* Get the data in raw format.  */
   if (!deprecated_frame_register_read (frame, regnum, raw_buffer))
-    fprintf_filtered (file, "*value not available*\n");
+    {
+      fprintf_filtered (file, "*value not available*\n");
+      return;
+    }
 
   get_formatted_print_options (&opts, 'x');
   opts.deref_ref = 1;


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