+2017-03-07 Peter Bergner <bergner@vnet.ibm.com>
+
+ * gdbarch.sh (pstring_ptr): New static function.
+ (gdbarch_disassembler_options): Use it.
+ (gdbarch_verify_disassembler_options): Print valid_disassembler_options,
+ not valid_disassembler_option->name.
+ * gdbarch.c: Regenerate.
+
2017-03-07 Peter Bergner <bergner@vnet.ibm.com>
* config/powerpc/ppc64-linux.mh (MH_CFLAGS): Delete.
return string;
}
+static char *
+pstring_ptr (char **string)
+{
+ if (string == NULL || *string == NULL)
+ return "(null)";
+ return *string;
+}
+
/* Helper function to print a list of strings, represented as "const
char *const *". The list is printed comma-separated. */
core_addr_to_string_nz (gdbarch->deprecated_function_start_offset));
fprintf_unfiltered (file,
"gdbarch_dump: disassembler_options = %s\n",
- pstring (*gdbarch->disassembler_options));
+ pstring_ptr (gdbarch->disassembler_options));
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_displaced_step_copy_insn_p() = %d\n",
gdbarch_displaced_step_copy_insn_p (gdbarch));
host_address_to_string (gdbarch->unwind_sp));
fprintf_unfiltered (file,
"gdbarch_dump: valid_disassembler_options = %s\n",
- host_address_to_string (gdbarch->valid_disassembler_options->name));
+ host_address_to_string (gdbarch->valid_disassembler_options));
fprintf_unfiltered (file,
"gdbarch_dump: value_from_register = <%s>\n",
host_address_to_string (gdbarch->value_from_register));
m:int:addressable_memory_unit_size:void:::default_addressable_memory_unit_size::0
# Functions for allowing a target to modify its disassembler options.
-v:char **:disassembler_options:::0:0::0:pstring (*gdbarch->disassembler_options)
-v:const disasm_options_t *:valid_disassembler_options:::0:0::0:host_address_to_string (gdbarch->valid_disassembler_options->name)
+v:char **:disassembler_options:::0:0::0:pstring_ptr (gdbarch->disassembler_options)
+v:const disasm_options_t *:valid_disassembler_options:::0:0::0:host_address_to_string (gdbarch->valid_disassembler_options)
EOF
}
return string;
}
+static char *
+pstring_ptr (char **string)
+{
+ if (string == NULL || *string == NULL)
+ return "(null)";
+ return *string;
+}
+
/* Helper function to print a list of strings, represented as "const
char *const *". The list is printed comma-separated. */