gdb/riscv: Use TYPE_SAFE_NAME
authorAndrew Burgess <andrew.burgess@embecosm.com>
Sun, 8 Apr 2018 10:07:56 +0000 (11:07 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 10 Jul 2018 11:46:56 +0000 (12:46 +0100)
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.

gdb/ChangeLog
gdb/riscv-tdep.c

index 25aded3c2929b73d706e0df14c0830b41f29966f..bae1d91987738a07fd434724f30a459172e5dfd3 100644 (file)
@@ -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.
index 4c68ef73fc50fd950a2fd4e921fc24b539599f4b..e2be993eaf0e4f77e52d1e13c27ff8c2dfa316d0 100644 (file)
@@ -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: