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] S390: Name "invisible" registers with the empty string instead of NULL


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

commit 87de11c05253566abb04479a4842cc934d0c822e
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date:   Wed Mar 4 10:40:41 2015 +0100

    S390: Name "invisible" registers with the empty string instead of NULL
    
    When adding vector register support to GDB, s390_register_name() was
    added to suppress the right halves of the first 16 vector registers.
    However, that function returned NULL instead of an empty string in such
    a case.  This leads to an incomplete list of registers returned by
    "complete info registers ", because completion stops at the first NULL
    return value from user_reg_map_regnum_to_name().
    
    gdb/ChangeLog:
    
    	* s390-linux-tdep.c (s390_register_name): Return empty string
    	instead of NULL for registers that shouldn't be visible.

Diff:
---
 gdb/ChangeLog         | 5 +++++
 gdb/s390-linux-tdep.c | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3d1a082..ed9d355 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2015-03-04  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
+	* s390-linux-tdep.c (s390_register_name): Return empty string
+	instead of NULL for registers that shouldn't be visible.
+
+2015-03-04  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
 	* s390-linux-tdep.c (s390_gdbarch_init): Use the correct syscall
 	XML file for 64-bit targets.
 
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 2dfd8e4..e60951f 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -269,15 +269,15 @@ regnum_is_vxr_full (struct gdbarch_tdep *tdep, int regnum)
 	  && regnum <= tdep->v0_full_regnum + 15);
 }
 
-/* Return the name of register REGNO.  Return NULL for registers that
-   shouldn't be visible.  */
+/* Return the name of register REGNO.  Return the empty string for
+   registers that shouldn't be visible.  */
 
 static const char *
 s390_register_name (struct gdbarch *gdbarch, int regnum)
 {
   if (regnum >= S390_V0_LOWER_REGNUM
       && regnum <= S390_V15_LOWER_REGNUM)
-    return NULL;
+    return "";
   return tdesc_register_name (gdbarch, regnum);
 }


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