Remove target_has_stack macro
authorTom Tromey <tom@tromey.com>
Tue, 29 Sep 2020 01:38:25 +0000 (19:38 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 29 Sep 2020 01:52:21 +0000 (19:52 -0600)
This removes the target_has_stack object-like macro, replacing it with
the underlying function.

gdb/ChangeLog
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)
(scoped_restore_current_thread::scoped_restore_current_thread)
(thread_command): Update.
* stack.c (backtrace_command_1, frame_apply_level_command)
(frame_apply_all_command, frame_apply_command): Update.
* infrun.c (siginfo_make_value, restore_infcall_control_state):
Update.
* gcore.c (derive_stack_segment): Update.
* frame.c (get_current_frame, has_stack_frames): Update.
* auxv.c (info_auxv_command): Update.
* ada-tasks.c (ada_build_task_list): Update.
* target.c (target_has_stack): Rename from target_has_stack_1.
* target.h (target_has_stack): Remove macro.
(target_has_stack): Rename from target_has_stack_1.

12 files changed:
gdb/ChangeLog
gdb/ada-tasks.c
gdb/auxv.c
gdb/frame.c
gdb/gcore.c
gdb/infrun.c
gdb/stack.c
gdb/target.c
gdb/target.h
gdb/thread.c
gdb/tui/tui-regs.c
gdb/windows-tdep.c

index 1e2bee69b4ba9e31e47640191a2ac06d6662b2de..bc9768bb4a70b90579109845582c11643d3f98cb 100644 (file)
@@ -1,3 +1,22 @@
+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)
+       (scoped_restore_current_thread::scoped_restore_current_thread)
+       (thread_command): Update.
+       * stack.c (backtrace_command_1, frame_apply_level_command)
+       (frame_apply_all_command, frame_apply_command): Update.
+       * infrun.c (siginfo_make_value, restore_infcall_control_state):
+       Update.
+       * gcore.c (derive_stack_segment): Update.
+       * frame.c (get_current_frame, has_stack_frames): Update.
+       * auxv.c (info_auxv_command): Update.
+       * ada-tasks.c (ada_build_task_list): Update.
+       * target.c (target_has_stack): Rename from target_has_stack_1.
+       * target.h (target_has_stack): Remove macro.
+       (target_has_stack): Rename from target_has_stack_1.
+
 2020-09-28  Tom Tromey  <tom@tromey.com>
 
        * target.c (target_has_memory): Rename from target_has_memory_1.
index 734b25034f46e763467d6293e337e031ab5c72d6..a434563c604375f08d378521ec149ab56b0c7d3c 100644 (file)
@@ -999,7 +999,7 @@ ada_build_task_list ()
 {
   struct ada_tasks_inferior_data *data;
 
-  if (!target_has_stack)
+  if (!target_has_stack ())
     error (_("Cannot inspect Ada tasks when program is not running"));
 
   data = get_ada_tasks_inferior_data (current_inferior ());
index 2ffcd73b9882bd3d9833b9999cbae9f00539ee70..87fc01db25c535dd2fa522aff2189d16c41a0ced 100644 (file)
@@ -576,7 +576,7 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
 static void
 info_auxv_command (const char *cmd, int from_tty)
 {
-  if (! target_has_stack)
+  if (! target_has_stack ())
     error (_("The program has no auxiliary information now."));
   else
     {
index 113fe8ace400c530d1937798550f228b86c467cd..cc44a04787a4038f9989a61a25886968bb674625 100644 (file)
@@ -1655,7 +1655,7 @@ get_current_frame (void)
      registers".  */
   if (!target_has_registers)
     error (_("No registers."));
-  if (!target_has_stack)
+  if (!target_has_stack ())
     error (_("No stack."));
   if (!target_has_memory ())
     error (_("No memory."));
@@ -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.  */
index 46ca2da5003e04a3af2b0718d951666a50e924d6..f7a6bcb588fb84bed2287b058e8e95e0f47e8745 100644 (file)
@@ -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.  */
index 6532b06ae52efc0264b5d2112f4e130c9f91825a..118538dfbc01582eaea8831fe2c931c45b67bb76 100644 (file)
@@ -8843,7 +8843,7 @@ static struct value *
 siginfo_make_value (struct gdbarch *gdbarch, struct internalvar *var,
                    void *ignore)
 {
-  if (target_has_stack
+  if (target_has_stack ()
       && inferior_ptid != null_ptid
       && gdbarch_get_siginfo_type_p (gdbarch))
     {
@@ -9078,7 +9078,7 @@ restore_infcall_control_state (struct infcall_control_state *inf_status)
   stop_stack_dummy = inf_status->stop_stack_dummy;
   stopped_by_random_signal = inf_status->stopped_by_random_signal;
 
-  if (target_has_stack)
+  if (target_has_stack ())
     {
       /* The point of the try/catch is that if the stack is clobbered,
          walking the stack might encounter a garbage pointer and
index 616b629e208e6893025de7d3c3e2f5fd855426fa..4ba5500b31c9e0735e57611816536c9cc76e6f74 100644 (file)
@@ -2001,7 +2001,7 @@ backtrace_command_1 (const frame_print_options &fp_opts,
   int py_start = 0, py_end = 0;
   enum ext_lang_bt_status result = EXT_LANG_BT_ERROR;
 
-  if (!target_has_stack)
+  if (!target_has_stack ())
     error (_("No stack."));
 
   if (count_exp)
@@ -3164,7 +3164,7 @@ frame_apply_cmd_completer (struct cmd_list_element *ignore,
 static void
 frame_apply_level_command (const char *cmd, int from_tty)
 {
-  if (!target_has_stack)
+  if (!target_has_stack ())
     error (_("No stack."));
 
   bool level_found = false;
@@ -3212,7 +3212,7 @@ frame_apply_level_command (const char *cmd, int from_tty)
 static void
 frame_apply_all_command (const char *cmd, int from_tty)
 {
-  if (!target_has_stack)
+  if (!target_has_stack ())
     error (_("No stack."));
 
   frame_apply_command_count ("frame apply all", cmd, from_tty,
@@ -3227,7 +3227,7 @@ frame_apply_command (const char* cmd, int from_tty)
   int count;
   struct frame_info *trailing;
 
-  if (!target_has_stack)
+  if (!target_has_stack ())
     error (_("No stack."));
 
   if (cmd == NULL)
index 3bcd6cbc91f895e7384de98dc652a323f3ef93da..ce8d4177fac975069842f3a7119a575a4667eb1a 100644 (file)
@@ -180,7 +180,7 @@ target_has_memory ()
 }
 
 int
-target_has_stack_1 (void)
+target_has_stack ()
 {
   for (target_ops *t = current_top_target (); t != NULL; t = t->beneath ())
     if (t->has_stack ())
index 2024b1340be7e7d89945025148dec51587dc32ea..0c5da0af5f58b865b0ddb23553fa4afdb7d8c07f 100644 (file)
@@ -1817,8 +1817,7 @@ extern int target_has_memory ();
 /* Does the target have a stack?  (Exec files don't, VxWorks doesn't, until
    we start a process.)  */
 
-extern int target_has_stack_1 (void);
-#define target_has_stack target_has_stack_1 ()
+extern int target_has_stack ();
 
 /* Does the target have registers?  (Exec files don't.)  */
 
index ba119b009b2caf83f372fe57cbf5b0ed4bf36f68..defd51a80983fabd723df084eca91ba797d154f6 100644 (file)
@@ -1406,7 +1406,7 @@ scoped_restore_current_thread::restore ()
       && m_was_stopped
       && m_thread->state == THREAD_STOPPED
       && target_has_registers
-      && target_has_stack
+      && target_has_stack ()
       && target_has_memory ())
     restore_selected_frame (m_selected_frame_id, m_selected_frame_level);
 }
@@ -1440,7 +1440,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_stack
+         && target_has_stack ()
          && target_has_memory ())
        {
          /* When processing internal events, there might not be a
@@ -1876,7 +1876,7 @@ thread_command (const char *tidstr, int from_tty)
       if (inferior_ptid == null_ptid)
        error (_("No thread selected"));
 
-      if (target_has_stack)
+      if (target_has_stack ())
        {
          struct thread_info *tp = inferior_thread ();
 
index d7d13045d092ce7f61a0a0cf6a5e2510c31bbdd5..6ff0d001854aa3b1ff4d2dbf8366da09e7340ff9 100644 (file)
@@ -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);
index 0c3fa911da1e04ddd1ed11198731dd0401892751..2a5524ed1286fdc92a02780dbc546e4f8b53710b 100644 (file)
@@ -435,7 +435,7 @@ static const struct lval_funcs tlb_value_funcs =
 static struct value *
 tlb_make_value (struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
 {
-  if (target_has_stack && inferior_ptid != null_ptid)
+  if (target_has_stack () && inferior_ptid != null_ptid)
     {
       struct type *type = windows_get_tlb_type (gdbarch);
       return allocate_computed_value (type, &tlb_value_funcs, NULL);
This page took 0.042973 seconds and 4 git commands to generate.