* [PATCH] S390: Name "invisible" registers with the empty string instead of NULL
@ 2015-03-03 16:12 Andreas Arnez
2015-03-03 16:15 ` Ulrich Weigand
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Arnez @ 2015-03-03 16:12 UTC (permalink / raw)
To: gdb-patches; +Cc: Ulrich Weigand
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/s390-linux-tdep.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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);
}
--
2.1.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] S390: Name "invisible" registers with the empty string instead of NULL
2015-03-03 16:12 [PATCH] S390: Name "invisible" registers with the empty string instead of NULL Andreas Arnez
@ 2015-03-03 16:15 ` Ulrich Weigand
0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Weigand @ 2015-03-03 16:15 UTC (permalink / raw)
To: Andreas Arnez; +Cc: gdb-patches
Andreas Arnez wrote:
> 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.
This is OK.
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-03 16:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03 16:12 [PATCH] S390: Name "invisible" registers with the empty string instead of NULL Andreas Arnez
2015-03-03 16:15 ` Ulrich Weigand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).