]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: move execute function declarations from gdbcmd.h to top.h
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 23 Apr 2024 19:22:41 +0000 (15:22 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 25 Apr 2024 16:58:49 +0000 (12:58 -0400)
These functions are implemented in top.c, move their declarations to
top.h.

Change-Id: I8893ef91d955156a6530734fefe8002d78c3e5fc
Approved-By: Tom Tromey <tom@tromey.com>
gdb/complaints.c
gdb/gdbcmd.h
gdb/printcmd.c
gdb/record-btrace.c
gdb/record-full.c
gdb/record.c
gdb/stack.c
gdb/thread.c
gdb/top.c
gdb/top.h

index d3c72df6d41f0056798560b39fdf45dfd09caae0..7dd5205adf8322f1e0b5dc33c16e06ef7b293cd8 100644 (file)
@@ -21,6 +21,7 @@
 #include "command.h"
 #include "gdbcmd.h"
 #include "run-on-main-thread.h"
+#include "top.h"
 #include "gdbsupport/selftest.h"
 #include <unordered_map>
 #include <mutex>
index 8a1f6f200520c6804db15df5f76f75ad6e66a22f..c212a0caf7366aebb2ee94d31be6b25028b7d50b 100644 (file)
 #include "cli/cli-script.h"
 #include "cli/cli-cmds.h"
 
-extern void execute_command (const char *, int);
-
-/* Run FN.  Sends its output to FILE, do not display it to the screen.
-   The global BATCH_FLAG will be temporarily set to true.  */
-
-extern void execute_fn_to_ui_file (struct ui_file *file, std::function<void(void)> fn);
-
-/* Run FN.  Capture its output into the returned string, do not display it
-   to the screen.  The global BATCH_FLAG will temporarily be set to true.
-   When TERM_OUT is true the output is collected with terminal behaviour
-   (e.g. with styling).  When TERM_OUT is false raw output will be collected
-   (e.g. no styling).  */
-
-extern void execute_fn_to_string (std::string &res,
-                                 std::function<void(void)> fn, bool term_out);
-
-/* As execute_fn_to_ui_file, but run execute_command for P and FROM_TTY.  */
-
-extern void execute_command_to_ui_file (struct ui_file *file,
-                                       const char *p, int from_tty);
-
-/* As execute_fn_to_string, but run execute_command for P and FROM_TTY.  */
-
-extern void execute_command_to_string (std::string &res, const char *p,
-                                      int from_tty, bool term_out);
-
-/* As execute_command_to_string, but ignore resulting string.  */
-
-extern void execute_command_to_string (const char *p,
-                                      int from_tty, bool term_out);
-
 extern void print_command_line (struct command_line *, unsigned int,
                                struct ui_file *);
 extern void print_command_lines (struct ui_out *,
index 66669f105c5c4e9c8c4bedf88e53b206f028f24e..25e391b15d5c940d7a0e96adad8572d6f9cadabe 100644 (file)
@@ -22,6 +22,7 @@
 #include "frame.h"
 #include "symtab.h"
 #include "gdbtypes.h"
+#include "top.h"
 #include "value.h"
 #include "language.h"
 #include "c-lang.h"
index 0ef1dfbe652f638b022e23ac49984833909609c1..aac59ee6a6dc2fc531a412a5563d86e48a9af7a1 100644 (file)
@@ -28,6 +28,7 @@
 #include "observable.h"
 #include "cli/cli-utils.h"
 #include "source.h"
+#include "top.h"
 #include "ui-out.h"
 #include "symtab.h"
 #include "filenames.h"
index 9d8c4ee438fd0b00486ffb0314f9e7923b045dbe..d288eb957feeda31ef3d3bfb2b2679139fe1bec0 100644 (file)
@@ -39,6 +39,7 @@
 #include "gdbsupport/gdb_unlinker.h"
 #include "gdbsupport/byte-vector.h"
 #include "async-event.h"
+#include "top.h"
 #include "valprint.h"
 #include "interps.h"
 
index 5b1093dd12ee3247a9044f8d2da61fc88d86d265..2059fb7ea0cfa8ef941ab9ba0166cace6829cd8c 100644 (file)
@@ -26,6 +26,7 @@
 #include "cli/cli-utils.h"
 #include "disasm.h"
 #include "interps.h"
+#include "top.h"
 
 #include <ctype.h>
 
index d1832540d624ed35edf25a8d10565ba5999654f4..fae1fce1c39f65a84df2a543dc3f5503077c8c69 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "event-top.h"
 #include "extract-store-integer.h"
+#include "top.h"
 #include "value.h"
 #include "symtab.h"
 #include "gdbtypes.h"
index 60a1bef8cf0ac67b9f8a9ff471b49253788d3e6c..43c28be384ff9f939293c3097b046af450bbe6f4 100644 (file)
@@ -24,6 +24,7 @@
 #include "frame.h"
 #include "inferior.h"
 #include "gdbsupport/environ.h"
+#include "top.h"
 #include "value.h"
 #include "target.h"
 #include "gdbthread.h"
index d01a0c206cc99e5020184e5a78fce55d0dc860ff..ee45f48b4fdd93f7ec486b59676279660e53dda5 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -598,9 +598,10 @@ execute_command (const char *p, int from_tty)
   cleanup_if_error.release ();
 }
 
-/* See gdbcmd.h.  */
+/* Run FN.  Send its output to FILE, do not display it to the screen.
+   The global BATCH_FLAG will be temporarily set to true.  */
 
-void
+static void
 execute_fn_to_ui_file (struct ui_file *file, std::function<void(void)> fn)
 {
   /* GDB_STDOUT should be better already restored during these
@@ -627,7 +628,7 @@ execute_fn_to_ui_file (struct ui_file *file, std::function<void(void)> fn)
   }
 }
 
-/* See gdbcmd.h.  */
+/* See top.h.  */
 
 void
 execute_fn_to_string (std::string &res, std::function<void(void)> fn,
@@ -650,7 +651,7 @@ execute_fn_to_string (std::string &res, std::function<void(void)> fn,
   res = str_file.release ();
 }
 
-/* See gdbcmd.h.  */
+/* See top.h.  */
 
 void
 execute_command_to_ui_file (struct ui_file *file,
@@ -659,7 +660,7 @@ execute_command_to_ui_file (struct ui_file *file,
   execute_fn_to_ui_file (file, [=]() { execute_command (p, from_tty); });
 }
 
-/* See gdbcmd.h.  */
+/* See top.h.  */
 
 void
 execute_command_to_string (std::string &res, const char *p, int from_tty,
@@ -669,7 +670,7 @@ execute_command_to_string (std::string &res, const char *p, int from_tty,
                        term_out);
 }
 
-/* See gdbcmd.h.  */
+/* See top.h.  */
 
 void
 execute_command_to_string (const char *p, int from_tty,
index 68c637a03d839f9e87acf357374d3d245a20d1d9..dc3f2aaf614136d66b9e4d37024baba4c122388a 100644 (file)
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -47,6 +47,30 @@ extern void quit_command (const char *, int);
 extern void quit_cover (void);
 extern void execute_command (const char *, int);
 
+/* Run FN.  Capture its output into the returned string, do not display it
+   to the screen.  The global BATCH_FLAG will temporarily be set to true.
+   When TERM_OUT is true the output is collected with terminal behaviour
+   (e.g. with styling).  When TERM_OUT is false raw output will be collected
+   (e.g. no styling).  */
+
+extern void execute_fn_to_string (std::string &res,
+                                 std::function<void(void)> fn, bool term_out);
+
+/* As execute_fn_to_ui_file, but run execute_command for P and FROM_TTY.  */
+
+extern void execute_command_to_ui_file (struct ui_file *file,
+                                       const char *p, int from_tty);
+
+/* As execute_fn_to_string, but run execute_command for P and FROM_TTY.  */
+
+extern void execute_command_to_string (std::string &res, const char *p,
+                                      int from_tty, bool term_out);
+
+/* Same as the above, but ignore resulting string.  */
+
+extern void execute_command_to_string (const char *p,
+                                      int from_tty, bool term_out);
+
 /* If the interpreter is in sync mode (we're running a user command's
    list, running command hooks or similars), and we just ran a
    synchronous command that started the target, wait for that command