public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH 5/7] gdb: move annotation_level declaration/definition to annotate.{h,c}
Date: Tue, 23 Apr 2024 09:23:00 -0400	[thread overview]
Message-ID: <20240423132517.2625632-6-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20240423132517.2625632-1-simon.marchi@polymtl.ca>

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
---
 gdb/annotate.c | 4 ++++
 gdb/annotate.h | 8 ++++++++
 gdb/defs.h     | 6 ------
 gdb/main.c     | 1 +
 gdb/stack.c    | 8 --------
 5 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/gdb/annotate.c b/gdb/annotate.c
index 19195ac70970..4ff3eb89807b 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 b8ce63ff2332..db471db8526a 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 11e2190c3e4a..c3b8b0bd8f39 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);
 
-\f
-/* Annotation stuff.  */
-
-extern int annotation_level;	/* in stack.c */
-\f
-
 /* From symfile.c */
 
 extern void symbol_file_command (const char *, int);
diff --git a/gdb/main.c b/gdb/main.c
index bf3c776dba9c..8b81640e8d22 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 6e9312c0a0d9..d1832540d624 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
-- 
2.44.0


  parent reply	other threads:[~2024-04-23 13:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 13:22 [PATCH 0/7] More cleanup of defs.h Simon Marchi
2024-04-23 13:22 ` [PATCH 1/7] gdb: move declarations of check_quit_flag and set_quit_flag to extension.h Simon Marchi
2024-04-25  8:52   ` Alexandra Petlanova Hajkova
2024-04-29 14:46     ` Simon Marchi
2024-04-23 13:22 ` [PATCH 2/7] gdb: change return type of check_quit_flag to bool Simon Marchi
2024-04-27  9:01   ` Alexandra Petlanova Hajkova
2024-04-23 13:22 ` [PATCH 3/7] gdb: change type of quit_flag " Simon Marchi
2024-04-23 13:22 ` [PATCH 4/7] gdb: move a bunch of quit-related things to event-top.{c,h} Simon Marchi
2024-04-23 13:23 ` Simon Marchi [this message]
2024-04-23 13:23 ` [PATCH 6/7] gdb: remove enum precision_type Simon Marchi
2024-04-23 13:23 ` [PATCH 7/7] gdb: move symbol_file_command declaration to symfile.h Simon Marchi
2024-04-23 15:00 ` [PATCH 0/7] More cleanup of defs.h Tom Tromey
2024-04-23 15:30   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240423132517.2625632-6-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).