diff options
author | Tom Tromey <tom@tromey.com> | 2020-09-28 19:38:25 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-09-28 19:52:21 -0600 |
commit | 9dccd06e8a4e55adb58d8ebe7f2ed7d9d7dc17de (patch) | |
tree | 398972fcd9481ed0934281293dd8699101cb0f9b /gdb | |
parent | 841de12014d03189a7e0d8195bb77eba26648966 (diff) | |
download | gdb-9dccd06e8a4e55adb58d8ebe7f2ed7d9d7dc17de.zip gdb-9dccd06e8a4e55adb58d8ebe7f2ed7d9d7dc17de.tar.gz gdb-9dccd06e8a4e55adb58d8ebe7f2ed7d9d7dc17de.tar.bz2 |
Remove target_has_registers macro
This removes the target_has_registers object-like macro, replacing it
with the underlying function.
gdb/ChangeLog
2020-09-28 Tom Tromey <tom@tromey.com>
* tui/tui-regs.c (tui_get_register)
(tui_data_window::show_registers): Update.
* thread.c (scoped_restore_current_thread::restore)
(scoped_restore_current_thread::scoped_restore_current_thread):
Update.
* regcache-dump.c (regcache_print): Update.
* python/py-finishbreakpoint.c (bpfinishpy_detect_out_scope_cb):
Update.
* mi/mi-main.c (mi_cmd_data_write_register_values): Update.
* mep-tdep.c (current_me_module, current_options): Update.
* linux-thread-db.c (thread_db_load): Update.
* infcmd.c (registers_info, info_vector_command)
(info_float_command): Update.
* ia64-tdep.c (ia64_frame_prev_register)
(ia64_sigtramp_frame_prev_register): Update.
* ia64-libunwind-tdep.c (libunwind_frame_prev_register): Update.
* gcore.c (derive_stack_segment): Update.
* frame.c (get_current_frame, has_stack_frames): Update.
* findvar.c (language_defn::read_var_value): Update.
* arm-tdep.c (arm_pc_is_thumb): Update.
* target.c (target_has_registers): Rename from
target_has_registers_1.
* target.h (target_has_registers): Remove macro.
(target_has_registers): Rename from target_has_registers_1.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 27 | ||||
-rw-r--r-- | gdb/arm-tdep.c | 2 | ||||
-rw-r--r-- | gdb/findvar.c | 2 | ||||
-rw-r--r-- | gdb/frame.c | 5 | ||||
-rw-r--r-- | gdb/gcore.c | 2 | ||||
-rw-r--r-- | gdb/ia64-libunwind-tdep.c | 2 | ||||
-rw-r--r-- | gdb/ia64-tdep.c | 4 | ||||
-rw-r--r-- | gdb/infcmd.c | 6 | ||||
-rw-r--r-- | gdb/linux-thread-db.c | 2 | ||||
-rw-r--r-- | gdb/mep-tdep.c | 4 | ||||
-rw-r--r-- | gdb/mi/mi-main.c | 2 | ||||
-rw-r--r-- | gdb/python/py-finishbreakpoint.c | 2 | ||||
-rw-r--r-- | gdb/regcache-dump.c | 4 | ||||
-rw-r--r-- | gdb/target.c | 2 | ||||
-rw-r--r-- | gdb/target.h | 3 | ||||
-rw-r--r-- | gdb/thread.c | 4 | ||||
-rw-r--r-- | gdb/tui/tui-regs.c | 4 |
17 files changed, 52 insertions, 25 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bc9768b..dbd1e1e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,32 @@ 2020-09-28 Tom Tromey <tom@tromey.com> + * tui/tui-regs.c (tui_get_register) + (tui_data_window::show_registers): Update. + * thread.c (scoped_restore_current_thread::restore) + (scoped_restore_current_thread::scoped_restore_current_thread): + Update. + * regcache-dump.c (regcache_print): Update. + * python/py-finishbreakpoint.c (bpfinishpy_detect_out_scope_cb): + Update. + * mi/mi-main.c (mi_cmd_data_write_register_values): Update. + * mep-tdep.c (current_me_module, current_options): Update. + * linux-thread-db.c (thread_db_load): Update. + * infcmd.c (registers_info, info_vector_command) + (info_float_command): Update. + * ia64-tdep.c (ia64_frame_prev_register) + (ia64_sigtramp_frame_prev_register): Update. + * ia64-libunwind-tdep.c (libunwind_frame_prev_register): Update. + * gcore.c (derive_stack_segment): Update. + * frame.c (get_current_frame, has_stack_frames): Update. + * findvar.c (language_defn::read_var_value): Update. + * arm-tdep.c (arm_pc_is_thumb): Update. + * target.c (target_has_registers): Rename from + target_has_registers_1. + * target.h (target_has_registers): Remove macro. + (target_has_registers): Rename from target_has_registers_1. + +2020-09-28 Tom Tromey <tom@tromey.com> + * windows-tdep.c (tlb_make_value): Update. * tui/tui-regs.c (tui_data_window::show_registers): Update. * thread.c (scoped_restore_current_thread::restore) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 91ab441..a214f22 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -461,7 +461,7 @@ arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr) "display/i $pc" always show the correct mode (though if there is a symbol table we will not reach here, so it still may not be displayed in the mode it will be executed). */ - if (target_has_registers) + if (target_has_registers ()) return arm_frame_is_thumb (get_current_frame ()); /* Otherwise we're out of luck; we assume ARM. */ diff --git a/gdb/findvar.c b/gdb/findvar.c index 7e9dab5..78d727b 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -608,7 +608,7 @@ language_defn::read_var_value (struct symbol *var, sym_need = symbol_read_needs (var); if (sym_need == SYMBOL_NEEDS_FRAME) gdb_assert (frame != NULL); - else if (sym_need == SYMBOL_NEEDS_REGISTERS && !target_has_registers) + else if (sym_need == SYMBOL_NEEDS_REGISTERS && !target_has_registers ()) error (_("Cannot read `%s' without registers"), var->print_name ()); if (frame != NULL) diff --git a/gdb/frame.c b/gdb/frame.c index cc44a04..5ae8611 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1653,7 +1653,7 @@ get_current_frame (void) have registers is very confusing. Besides, "printcmd.exp" explicitly checks that ``print $pc'' with no registers prints "No registers". */ - if (!target_has_registers) + if (!target_has_registers ()) error (_("No registers.")); if (!target_has_stack ()) error (_("No stack.")); @@ -1692,7 +1692,8 @@ static struct frame_info *selected_frame; bool has_stack_frames () { - if (!target_has_registers || !target_has_stack () || !target_has_memory ()) + if (!target_has_registers () || !target_has_stack () + || !target_has_memory ()) return false; /* Traceframes are effectively a substitute for the live inferior. */ diff --git a/gdb/gcore.c b/gdb/gcore.c index f7a6bcb..ebaae88 100644 --- a/gdb/gcore.c +++ b/gdb/gcore.c @@ -224,7 +224,7 @@ derive_stack_segment (bfd_vma *bottom, bfd_vma *top) gdb_assert (top); /* Can't succeed without stack and registers. */ - if (!target_has_stack () || !target_has_registers) + if (!target_has_stack () || !target_has_registers ()) return 0; /* Can't succeed without current frame. */ diff --git a/gdb/ia64-libunwind-tdep.c b/gdb/ia64-libunwind-tdep.c index 94881bb..39b069a 100644 --- a/gdb/ia64-libunwind-tdep.c +++ b/gdb/ia64-libunwind-tdep.c @@ -335,7 +335,7 @@ libunwind_frame_prev_register (struct frame_info *this_frame, gdb_assert (regnum >= 0); - if (!target_has_registers) + if (!target_has_registers ()) error (_("No registers.")); if (uw_regnum < 0) diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 72093b6..7a1d6eb 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -1913,7 +1913,7 @@ ia64_frame_prev_register (struct frame_info *this_frame, void **this_cache, gdb_assert (regnum >= 0); - if (!target_has_registers) + if (!target_has_registers ()) error (_("No registers.")); if (regnum == gdbarch_sp_regnum (gdbarch)) @@ -2284,7 +2284,7 @@ ia64_sigtramp_frame_prev_register (struct frame_info *this_frame, gdb_assert (regnum >= 0); - if (!target_has_registers) + if (!target_has_registers ()) error (_("No registers.")); if (regnum == IA64_IP_REGNUM) diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 6f20b7d..88fca1b 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2208,7 +2208,7 @@ registers_info (const char *addr_exp, int fpregs) struct frame_info *frame; struct gdbarch *gdbarch; - if (!target_has_registers) + if (!target_has_registers ()) error (_("The program has no registers now.")); frame = get_selected_frame (NULL); gdbarch = get_frame_arch (frame); @@ -2349,7 +2349,7 @@ print_vector_info (struct ui_file *file, static void info_vector_command (const char *args, int from_tty) { - if (!target_has_registers) + if (!target_has_registers ()) error (_("The program has no registers now.")); print_vector_info (gdb_stdout, get_selected_frame (NULL), args); @@ -2887,7 +2887,7 @@ info_float_command (const char *args, int from_tty) { struct frame_info *frame; - if (!target_has_registers) + if (!target_has_registers ()) error (_("The program has no registers now.")); frame = get_selected_frame (NULL); diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index fbddfed..64b96c0 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1194,7 +1194,7 @@ thread_db_load (void) /* Don't attempt to use thread_db on executables not running yet. */ - if (!target_has_registers) + if (!target_has_registers ()) return false; /* Don't attempt to use thread_db for remote targets. */ diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 7e8247c..0efcf85 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -844,7 +844,7 @@ mep_pseudo_cr_index (int pseudo) static CONFIG_ATTR current_me_module (void) { - if (target_has_registers) + if (target_has_registers ()) { ULONGEST regval; regcache_cooked_read_unsigned (get_current_regcache (), @@ -867,7 +867,7 @@ current_me_module (void) static unsigned int current_options (void) { - if (target_has_registers) + if (target_has_registers ()) { ULONGEST regval; regcache_cooked_read_unsigned (get_current_regcache (), diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 55bb777..99da554 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1150,7 +1150,7 @@ mi_cmd_data_write_register_values (const char *command, char **argv, int argc) error (_("-data-write-register-values: Usage: -data-write-register-" "values <format> [<regnum1> <value1>...<regnumN> <valueN>]")); - if (!target_has_registers) + if (!target_has_registers ()) error (_("-data-write-register-values: No registers.")); if (!(argc - 1)) diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c index 92ac555..4badcd5 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -361,7 +361,7 @@ bpfinishpy_detect_out_scope_cb (struct breakpoint *b, try { if (b->pspace == current_inferior ()->pspace - && (!target_has_registers + && (!target_has_registers () || frame_find_by_id (b->frame_id) == NULL)) bpfinishpy_out_of_scope (finish_bp); } diff --git a/gdb/regcache-dump.c b/gdb/regcache-dump.c index 10f6e49..f1ba07b 100644 --- a/gdb/regcache-dump.c +++ b/gdb/regcache-dump.c @@ -236,7 +236,7 @@ regcache_print (const char *args, enum regcache_dump_what what_to_dump) std::unique_ptr<regcache> regs; gdbarch *gdbarch; - if (target_has_registers) + if (target_has_registers ()) gdbarch = get_current_regcache ()->arch (); else gdbarch = target_gdbarch (); @@ -257,7 +257,7 @@ regcache_print (const char *args, enum regcache_dump_what what_to_dump) { auto dump_pseudo = (what_to_dump == regcache_dump_cooked); - if (target_has_registers) + if (target_has_registers ()) dump.reset (new register_dump_regcache (get_current_regcache (), dump_pseudo)); else diff --git a/gdb/target.c b/gdb/target.c index ce8d417..ea15357 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -190,7 +190,7 @@ target_has_stack () } int -target_has_registers_1 (void) +target_has_registers () { for (target_ops *t = current_top_target (); t != NULL; t = t->beneath ()) if (t->has_registers ()) diff --git a/gdb/target.h b/gdb/target.h index 0c5da0a..f58334a 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1821,8 +1821,7 @@ extern int target_has_stack (); /* Does the target have registers? (Exec files don't.) */ -extern int target_has_registers_1 (void); -#define target_has_registers target_has_registers_1 () +extern int target_has_registers (); /* Does the target have execution? Can we make it jump (through hoops), or pop its stack a few times? This means that the current diff --git a/gdb/thread.c b/gdb/thread.c index defd51a..d499400 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -1405,7 +1405,7 @@ scoped_restore_current_thread::restore () if (inferior_ptid != null_ptid && m_was_stopped && m_thread->state == THREAD_STOPPED - && target_has_registers + && target_has_registers () && target_has_stack () && target_has_memory ()) restore_selected_frame (m_selected_frame_id, m_selected_frame_level); @@ -1439,7 +1439,7 @@ scoped_restore_current_thread::scoped_restore_current_thread () m_was_stopped = m_thread->state == THREAD_STOPPED; if (m_was_stopped - && target_has_registers + && target_has_registers () && target_has_stack () && target_has_memory ()) { diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 6ff0d00..4ba81b6 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -117,7 +117,7 @@ tui_get_register (struct frame_info *frame, { if (changedp) *changedp = false; - if (target_has_registers) + if (target_has_registers ()) { std::string new_content = tui_register_format (frame, regnum); @@ -182,7 +182,7 @@ tui_data_window::show_registers (struct reggroup *group) if (group == 0) group = general_reggroup; - if (target_has_registers && target_has_stack () && target_has_memory ()) + if (target_has_registers () && target_has_stack () && target_has_memory ()) { show_register_group (group, get_selected_frame (NULL), group == m_current_group); |