File 0005-S390-Name-invisible-registers-with-the-empty-string-.patch of Package gdb.783
Part of fate#318039
From 87de11c05253566abb04479a4842cc934d0c822e Mon Sep 17 00:00:00 2001
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date: Wed, 4 Mar 2015 10:40:41 +0100
Subject: [PATCH] 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.
---
gdb/ChangeLog | 5 +++++
gdb/s390-linux-tdep.c | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
Index: gdb-7.9.1/gdb/s390-linux-tdep.c
===================================================================
--- gdb-7.9.1.orig/gdb/s390-linux-tdep.c 2015-07-10 16:18:36.000000000 +0200
+++ gdb-7.9.1/gdb/s390-linux-tdep.c 2015-07-10 16:19:20.000000000 +0200
@@ -263,15 +263,15 @@ regnum_is_vxr_full (struct gdbarch_tdep
&& 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);
}