This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] gdb/riscv: Use TYPE_SAFE_NAME
- From: Andrew Burgess <aburgess at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 10 Jul 2018 11:57:59 -0000
- Subject: [binutils-gdb] gdb/riscv: Use TYPE_SAFE_NAME
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=42ecac1732194293568ab6093c742ca74c1dbdf6
commit 42ecac1732194293568ab6093c742ca74c1dbdf6
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date: Sun Apr 8 11:07:56 2018 +0100
gdb/riscv: Use TYPE_SAFE_NAME
In debug printing, use TYPE_SAFE_NAME instead of replicating the
functionality using TYPE_NAME and a null check.
gdb/ChangeLog:
* riscv-tdep.c (riscv_print_arg_location): Use TYPE_SAFE_NAME.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/riscv-tdep.c | 6 +-----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 25aded3..bae1d91 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2018-07-10 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * riscv-tdep.c (riscv_print_arg_location): Use TYPE_SAFE_NAME.
+
2018-07-09 Andrew Burgess <andrew.burgess@embecosm.com>
* remote.c (show_hardware_watchpoint_limit): New function.
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 4c68ef7..e2be993 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -1939,12 +1939,8 @@ riscv_print_arg_location (ui_file *stream, struct gdbarch *gdbarch,
struct riscv_arg_info *info,
CORE_ADDR sp_refs, CORE_ADDR sp_args)
{
- const char* type_name = TYPE_NAME (info->type);
- if (type_name == nullptr)
- type_name = "???";
-
fprintf_unfiltered (stream, "type: '%s', length: 0x%x, alignment: 0x%x",
- type_name, info->length, info->align);
+ TYPE_SAFE_NAME (info->type), info->length, info->align);
switch (info->argloc[0].loc_type)
{
case riscv_arg_info::location::in_reg: