From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6IRuM8cIjl9yRwAAWB0awg (envelope-from ) for ; Mon, 19 Oct 2020 17:44:39 -0400 Received: by simark.ca (Postfix, from userid 112) id 996AB1EFBB; Mon, 19 Oct 2020 17:44:39 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 17F321EFBD for ; Mon, 19 Oct 2020 17:44:37 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C51F388EC2D; Mon, 19 Oct 2020 21:44:36 +0000 (GMT) Received: from gateway32.websitewelcome.com (gateway32.websitewelcome.com [192.185.145.111]) by sourceware.org (Postfix) with ESMTPS id 34DC23844013 for ; Mon, 19 Oct 2020 21:44:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 34DC23844013 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway32.websitewelcome.com (Postfix) with ESMTP id B74A85B11F for ; Mon, 19 Oct 2020 16:44:33 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id UcxFkUxB1BD8bUcxFkRu9i; Mon, 19 Oct 2020 16:44:33 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HkdtxinMomVBTmsI+vhsphSpRRUtZ3n/v5o3AhuWd4Q=; b=wFodg3Dyb0y5Jkyj9/5mZWhKLC /9e4d2nev4pIKW/yZzyDQc8pvgfQXOhOn6UsPFAWimtESaVop5egVM36fmhDTEOqb1t/aSLf3ZzSh ZT0uYZQ9dJ3D4xNMHd4t14Ow0; Received: from 75-166-102-113.hlrn.qwest.net ([75.166.102.113]:45712 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kUcxF-004Oci-Fo; Mon, 19 Oct 2020 15:44:33 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH v2 05/16] Remove exec_bfd_mtime define Date: Mon, 19 Oct 2020 15:44:18 -0600 Message-Id: <20201019214429.13815-6-tom@tromey.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20201019214429.13815-1-tom@tromey.com> References: <20201019214429.13815-1-tom@tromey.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.102.113 X-Source-L: No X-Exim-ID: 1kUcxF-004Oci-Fo X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-102-113.hlrn.qwest.net (bapiya.Home) [75.166.102.113]:45712 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Tromey Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This removes the exec_bfd_mtime define, in favor of directly using the appropriate member of the current program space. gdb/ChangeLog 2020-10-19 Tom Tromey * source-cache.c (source_cache::get_plain_source_lines): Use current_program_space. * corefile.c (reopen_exec_file): Use current_program_space. * exec.c (exec_file_attach): Use current_program_space. * exec.h (exec_bfd_mtime): Remove. --- gdb/ChangeLog | 8 ++++++++ gdb/corefile.c | 4 +++- gdb/exec.c | 2 +- gdb/exec.h | 1 - gdb/source-cache.c | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gdb/corefile.c b/gdb/corefile.c index c1eec199342..1586e9f175a 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -115,7 +115,9 @@ reopen_exec_file (void) std::string filename = bfd_get_filename (exec_bfd); res = stat (filename.c_str (), &st); - if (res == 0 && exec_bfd_mtime && exec_bfd_mtime != st.st_mtime) + if (res == 0 + && current_program_space->ebfd_mtime + && current_program_space->ebfd_mtime != st.st_mtime) exec_file_attach (filename.c_str (), 0); else /* If we accessed the file since last opening it, close it now; diff --git a/gdb/exec.c b/gdb/exec.c index 96164ddfd02..22be006a9c0 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -482,7 +482,7 @@ exec_file_attach (const char *filename, int from_tty) target_section_table sections = build_section_table (exec_bfd); - exec_bfd_mtime = bfd_get_mtime (exec_bfd); + current_program_space->ebfd_mtime = bfd_get_mtime (exec_bfd); validate_files (); diff --git a/gdb/exec.h b/gdb/exec.h index f98dd83da21..658112a0f28 100644 --- a/gdb/exec.h +++ b/gdb/exec.h @@ -31,7 +31,6 @@ struct bfd; struct objfile; #define exec_bfd current_program_space->ebfd -#define exec_bfd_mtime current_program_space->ebfd_mtime /* Builds a section table, given args BFD. */ diff --git a/gdb/source-cache.c b/gdb/source-cache.c index 9196e3a19e3..c67d087c76d 100644 --- a/gdb/source-cache.c +++ b/gdb/source-cache.c @@ -69,7 +69,7 @@ source_cache::get_plain_source_lines (struct symtab *s, if (SYMTAB_OBJFILE (s) != NULL && SYMTAB_OBJFILE (s)->obfd != NULL) mtime = SYMTAB_OBJFILE (s)->mtime; else if (exec_bfd) - mtime = exec_bfd_mtime; + mtime = current_program_space->ebfd_mtime; if (mtime && mtime < st.st_mtime) warning (_("Source file is more recent than executable.")); -- 2.17.2