diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-08-31 15:42:43 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-10-02 14:21:25 +0100 |
commit | 637b2f86138a8ec0ab0fe89d3e4c5c111559d7f2 (patch) | |
tree | 3d2f7482d06adeecbfddada36372cb20a3c70a12 /gdb/mi | |
parent | 9b9e61c7cf49abdf9c2703c4d1f555d762c6e49f (diff) | |
download | fsf-binutils-gdb-637b2f86138a8ec0ab0fe89d3e4c5c111559d7f2.zip fsf-binutils-gdb-637b2f86138a8ec0ab0fe89d3e4c5c111559d7f2.tar.gz fsf-binutils-gdb-637b2f86138a8ec0ab0fe89d3e4c5c111559d7f2.tar.bz2 |
gdb: update now gdbarch_register_name doesn't return nullptr
After the previous few commit, gdbarch_register_name no longer returns
nullptr. This commit audits all the calls to gdbarch_register_name
and removes any code that checks the result against nullptr.
There should be no visible change after this commit.
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-main.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index b758f39..80b5cd9 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -880,8 +880,7 @@ mi_cmd_data_list_register_names (const char *command, char **argv, int argc) regnum < numregs; regnum++) { - if (gdbarch_register_name (gdbarch, regnum) == NULL - || *(gdbarch_register_name (gdbarch, regnum)) == '\0') + if (*(gdbarch_register_name (gdbarch, regnum)) == '\0') uiout->field_string (NULL, ""); else uiout->field_string (NULL, gdbarch_register_name (gdbarch, regnum)); @@ -895,8 +894,7 @@ mi_cmd_data_list_register_names (const char *command, char **argv, int argc) if (regnum < 0 || regnum >= numregs) error (_("bad register number")); - if (gdbarch_register_name (gdbarch, regnum) == NULL - || *(gdbarch_register_name (gdbarch, regnum)) == '\0') + if (*(gdbarch_register_name (gdbarch, regnum)) == '\0') uiout->field_string (NULL, ""); else uiout->field_string (NULL, gdbarch_register_name (gdbarch, regnum)); @@ -940,8 +938,7 @@ mi_cmd_data_list_changed_registers (const char *command, char **argv, int argc) regnum < numregs; regnum++) { - if (gdbarch_register_name (gdbarch, regnum) == NULL - || *(gdbarch_register_name (gdbarch, regnum)) == '\0') + if (*(gdbarch_register_name (gdbarch, regnum)) == '\0') continue; if (register_changed_p (regnum, prev_regs.get (), @@ -957,7 +954,6 @@ mi_cmd_data_list_changed_registers (const char *command, char **argv, int argc) if (regnum >= 0 && regnum < numregs - && gdbarch_register_name (gdbarch, regnum) != NULL && *gdbarch_register_name (gdbarch, regnum) != '\000') { if (register_changed_p (regnum, prev_regs.get (), @@ -1067,8 +1063,7 @@ mi_cmd_data_list_register_values (const char *command, char **argv, int argc) regnum < numregs; regnum++) { - if (gdbarch_register_name (gdbarch, regnum) == NULL - || *(gdbarch_register_name (gdbarch, regnum)) == '\0') + if (*(gdbarch_register_name (gdbarch, regnum)) == '\0') continue; output_register (frame, regnum, format, skip_unavailable); @@ -1082,7 +1077,6 @@ mi_cmd_data_list_register_values (const char *command, char **argv, int argc) if (regnum >= 0 && regnum < numregs - && gdbarch_register_name (gdbarch, regnum) != NULL && *gdbarch_register_name (gdbarch, regnum) != '\000') output_register (frame, regnum, format, skip_unavailable); else @@ -1163,8 +1157,7 @@ mi_cmd_data_write_register_values (const char *command, char **argv, int argc) int regnum = atoi (argv[i]); if (regnum >= 0 && regnum < numregs - && gdbarch_register_name (gdbarch, regnum) - && *gdbarch_register_name (gdbarch, regnum)) + && *gdbarch_register_name (gdbarch, regnum) != '\0') { LONGEST value; @@ -2632,8 +2625,7 @@ mi_cmd_trace_frame_collected (const char *command, char **argv, int argc) for (regnum = 0; regnum < numregs; regnum++) { - if (gdbarch_register_name (gdbarch, regnum) == NULL - || *(gdbarch_register_name (gdbarch, regnum)) == '\0') + if (*(gdbarch_register_name (gdbarch, regnum)) == '\0') continue; output_register (frame, regnum, registers_format, 1); |