From patchwork Tue Apr 23 13:23:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 88914 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A301E3849AC0 for ; Tue, 23 Apr 2024 13:32:16 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 078F63858404 for ; Tue, 23 Apr 2024 13:31:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 078F63858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 078F63858404 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713879098; cv=none; b=FkJAc1NiO8TsCfdE4OaRi4utyH74j3nyJKbS4jNgFteSOnZ0giuu8AepYn6IdxsnRGND65/IgxFjJAyIX9eSDbsWGST2araFTGjPw7gygA1dsnvu5c8B05t+VZ0b0/bpYwo4nIPG0ibnvxIZH8jLLG6zF7NlEGM0/kfGZt2N04E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713879098; c=relaxed/simple; bh=LtCLoouV3WhRfct/hlHSMIQwfJPjQlfKntPmOugFTsY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=q0cODZH6l8Mv7TXxs6caKc4tiRy6+K5FzEXJTEHPQ7DmiptrV8sNjH49yFoTCFrUTDd1DngZPutMXWAj08tk3LvOysAM+9XGS9Cp5ILZdFL2fySHtCLDY4juelMyvmWLIbyyfZtgoE71UvNSU0se4Zv1YN8h7QY1hs2KCQIqywE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 43NDVQtQ059045 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Apr 2024 09:31:31 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 43NDVQtQ059045 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1713879091; bh=v+zaPnfmWp6sGUj4R94y1taUiYVwg7P8aRs7I4AD46o=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=C3+ClGB/zAFx8ZdqfD7oIvtf5GehCQpUZEduj1V3Iw7hSKsBrAWcz4u9QiP/7VwOw Mrp1CZe3prNpGSvbP2a1OfetHSAo879/DgWJYdgc/4wZGl1g3AzSLmCXtGb9d2enhD I9MvYj8NDu80K7p+A9uto2khoDDbyaKbzLRp7udw= Received: from simark.localdomain (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id F01531E0D2; Tue, 23 Apr 2024 09:25:19 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 5/7] gdb: move annotation_level declaration/definition to annotate.{h, c} Date: Tue, 23 Apr 2024 09:23:00 -0400 Message-ID: <20240423132517.2625632-6-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423132517.2625632-1-simon.marchi@polymtl.ca> References: <20240423132517.2625632-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 23 Apr 2024 13:31:26 +0000 X-Spam-Status: No, score=-3188.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org 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); - -/* 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 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 . */ +#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