]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: move annotation_level declaration/definition to annotate.{h,c}
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 23 Apr 2024 13:23:00 +0000 (09:23 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 23 Apr 2024 15:26:14 +0000 (11:26 -0400)
The declaration of annotation_level is currently in defs.h, while the
definition is in stack.c.  I don't really understand why that variable
would live in stack.c, it seems completely unrelated.  Move it to
annotate.c, and move the declaration to annotate.h.

Change-Id: I6cf8e9bd20e83959bdf5ad58dd008b6e1187d7d8
Approved-By: Tom Tromey <tom@tromey.com>
gdb/annotate.c
gdb/annotate.h
gdb/defs.h
gdb/main.c
gdb/stack.c

index 19195ac709700c9868a635038d433b5a9952ff26..4ff3eb89807bc62bd070d5a88fc654b9e29b124f 100644 (file)
 #include "source-cache.h"
 #include "ui.h"
 
+/* See annotate.h.  */
+
+int annotation_level = 0;
+
 /* Prototypes for local functions.  */
 
 static void print_value_flags (struct type *);
index b8ce63ff233292127957038f10cb1588270b6865..db471db8526ac617e2785c1b59159178c6ab28d2 100644 (file)
 #include "symtab.h"
 #include "gdbtypes.h"
 
+/* Zero means do things normally; we are interacting directly with the
+   user.  One means print the full filename and linenumber when a
+   frame is printed, and do so in a format emacs18/emacs19.22 can
+   parse.  Two means print similar annotations, but in many more
+   cases and in a slightly different syntax.  */
+
+extern int annotation_level;
+
 extern void annotate_breakpoint (int);
 extern void annotate_catchpoint (int);
 extern void annotate_watchpoint (int);
index 11e2190c3e4aec9cff07586c937618af7717d983..c3b8b0bd8f39085b7cbe2c4d02e58cc2923de228 100644 (file)
@@ -195,12 +195,6 @@ struct value;
    globals that are currently only available to main.c.  */
 extern std::string relocate_gdb_directory (const char *initial, bool relocatable);
 
-\f
-/* Annotation stuff.  */
-
-extern int annotation_level;   /* in stack.c */
-\f
-
 /* From symfile.c */
 
 extern void symbol_file_command (const char *, int);
index bf3c776dba9c075042d494c70b8bc138d4c64e60..8b81640e8d22c6e2a8285a76e5bc0710bc3badde 100644 (file)
@@ -17,6 +17,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include "annotate.h"
 #include "top.h"
 #include "ui.h"
 #include "target.h"
index 6e9312c0a0d90f53fb01d2dfa488b4059428cbb2..d1832540d624ed35edf25a8d10565ba5999654f4 100644 (file)
@@ -230,14 +230,6 @@ static void print_frame (struct ui_out *uiout,
 static frame_info_ptr find_frame_for_function (const char *);
 static frame_info_ptr find_frame_for_address (CORE_ADDR);
 
-/* Zero means do things normally; we are interacting directly with the
-   user.  One means print the full filename and linenumber when a
-   frame is printed, and do so in a format emacs18/emacs19.22 can
-   parse.  Two means print similar annotations, but in many more
-   cases and in a slightly different syntax.  */
-
-int annotation_level = 0;
-
 /* Class used to manage tracking the last symtab we displayed.  */
 
 class last_displayed_symtab_info_type