aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-09-28 19:38:25 -0600
committerTom Tromey <tom@tromey.com>2020-09-28 19:52:21 -0600
commita739972c7c9818241fac0da589edb29adafc78c9 (patch)
treeab19c4558884aa6ea0c852249622992365748b88
parent5b8a477608a972184e03b6950965757a0d057543 (diff)
downloadgdb-a739972c7c9818241fac0da589edb29adafc78c9.zip
gdb-a739972c7c9818241fac0da589edb29adafc78c9.tar.gz
gdb-a739972c7c9818241fac0da589edb29adafc78c9.tar.bz2
Remove target_has_memory macro
This removes the target_has_memory object-like macro, replacing it with the underlying function. gdb/ChangeLog 2020-09-28 Tom Tromey <tom@tromey.com> * target.c (target_has_memory): Rename from target_has_memory_1. * tui/tui-regs.c (tui_data_window::show_registers): Update. * thread.c (scoped_restore_current_thread::restore) (scoped_restore_current_thread::scoped_restore_current_thread): Update. * frame.c (get_current_frame, has_stack_frames): Update. * target.h (target_has_memory): Remove macro. (target_has_memory): Rename from target_has_memory_1.
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/frame.c4
-rw-r--r--gdb/target.c2
-rw-r--r--gdb/target.h3
-rw-r--r--gdb/thread.c4
-rw-r--r--gdb/tui/tui-regs.c2
6 files changed, 18 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9bdd1f2..1e2bee6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,16 @@
2020-09-28 Tom Tromey <tom@tromey.com>
+ * target.c (target_has_memory): Rename from target_has_memory_1.
+ * tui/tui-regs.c (tui_data_window::show_registers): Update.
+ * thread.c (scoped_restore_current_thread::restore)
+ (scoped_restore_current_thread::scoped_restore_current_thread):
+ Update.
+ * frame.c (get_current_frame, has_stack_frames): Update.
+ * target.h (target_has_memory): Remove macro.
+ (target_has_memory): Rename from target_has_memory_1.
+
+2020-09-28 Tom Tromey <tom@tromey.com>
+
* target.c (target_has_all_memory_1): Remove.
* target.h (target_has_all_memory): Remove define.
(target_has_all_memory_1): Don't declare.
diff --git a/gdb/frame.c b/gdb/frame.c
index 0b708e6..113fe8a 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1657,7 +1657,7 @@ get_current_frame (void)
error (_("No registers."));
if (!target_has_stack)
error (_("No stack."));
- if (!target_has_memory)
+ if (!target_has_memory ())
error (_("No memory."));
/* Traceframes are effectively a substitute for the live inferior. */
if (get_traceframe_number () < 0)
@@ -1692,7 +1692,7 @@ 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/target.c b/gdb/target.c
index 6596efa..3bcd6cb 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -170,7 +170,7 @@ show_targetdebug (struct ui_file *file, int from_tty,
}
int
-target_has_memory_1 (void)
+target_has_memory ()
{
for (target_ops *t = current_top_target (); t != NULL; t = t->beneath ())
if (t->has_memory ())
diff --git a/gdb/target.h b/gdb/target.h
index 23022a1..2024b13 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1812,8 +1812,7 @@ extern void default_target_pass_ctrlc (struct target_ops *ops);
/* Does the target include memory? (Dummy targets don't.) */
-extern int target_has_memory_1 (void);
-#define target_has_memory target_has_memory_1 ()
+extern int target_has_memory ();
/* Does the target have a stack? (Exec files don't, VxWorks doesn't, until
we start a process.) */
diff --git a/gdb/thread.c b/gdb/thread.c
index 0217f3b..ba119b0 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1407,7 +1407,7 @@ scoped_restore_current_thread::restore ()
&& m_thread->state == THREAD_STOPPED
&& target_has_registers
&& target_has_stack
- && target_has_memory)
+ && target_has_memory ())
restore_selected_frame (m_selected_frame_id, m_selected_frame_level);
}
@@ -1441,7 +1441,7 @@ scoped_restore_current_thread::scoped_restore_current_thread ()
if (m_was_stopped
&& target_has_registers
&& target_has_stack
- && target_has_memory)
+ && target_has_memory ())
{
/* When processing internal events, there might not be a
selected frame. If we naively call get_selected_frame
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 04d7469..d7d1304 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -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);