aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-04-23 09:23:00 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2024-04-23 11:26:14 -0400
commitdcff5e80e6672ad09c413ad2a3003de01b91ad6b (patch)
treea8f5d6189898fc6e357a55cdf6f2fe6cb6639c42
parente5dc0d5d04e68328242fc171098e78f79589c7b7 (diff)
downloadgdb-dcff5e80e6672ad09c413ad2a3003de01b91ad6b.zip
gdb-dcff5e80e6672ad09c413ad2a3003de01b91ad6b.tar.gz
gdb-dcff5e80e6672ad09c413ad2a3003de01b91ad6b.tar.bz2
gdb: move annotation_level declaration/definition to annotate.{h,c}
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>
-rw-r--r--gdb/annotate.c4
-rw-r--r--gdb/annotate.h8
-rw-r--r--gdb/defs.h6
-rw-r--r--gdb/main.c1
-rw-r--r--gdb/stack.c8
5 files changed, 13 insertions, 14 deletions
diff --git a/gdb/annotate.c b/gdb/annotate.c
index 19195ac..4ff3eb8 100644
--- a/gdb/annotate.c
+++ b/gdb/annotate.c
@@ -29,6 +29,10 @@
#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 *);
diff --git a/gdb/annotate.h b/gdb/annotate.h
index b8ce63f..db471db 100644
--- a/gdb/annotate.h
+++ b/gdb/annotate.h
@@ -22,6 +22,14 @@
#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);
diff --git a/gdb/defs.h b/gdb/defs.h
index 11e2190..c3b8b0b 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -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);
-
-/* Annotation stuff. */
-
-extern int annotation_level; /* in stack.c */
-
-
/* From symfile.c */
extern void symbol_file_command (const char *, int);
diff --git a/gdb/main.c b/gdb/main.c
index bf3c776..8b81640 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -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"
diff --git a/gdb/stack.c b/gdb/stack.c
index 6e9312c..d183254 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -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