From patchwork Thu Jul 11 19:51:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93755 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 234EA3875DC6 for ; Thu, 11 Jul 2024 19:53:44 +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 1C9DF3875462 for ; Thu, 11 Jul 2024 19:53:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C9DF3875462 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 1C9DF3875462 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=1720727597; cv=none; b=Tqz4eDqtkuSiItC8UGI/Zg+e3cH+oS6MwFFAAkKoxfMPKbkR3wR38Kyw7fFUkNt8pTzqgqyoasou54kHliMDxhd9NTS0iShJAR9leG1ZmcnAPiAthzbDZ5yDldEoEz3OdXn9LvaO5V6Q3EB1F5XsFGnGPDdbBCAjDkb1yCWb0Jw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720727597; c=relaxed/simple; bh=04bF0Cq5kzJLDe22VD22s2CfoJHQ6RMZSsfJqolDdtg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ufmCxh/ZWtvbRO78VVqTfnHLBG22wUmIRrdD/+eso3i7Ien4YrEJ/j2XVToobAYVRdX0nQz2VXb9G01JZ46IYKH1+o94XMe90Zq512mh5NJZL2I31R+oAtOd9cQjIMu2ErIByOexl6Gp5B04E/su4pkV04vcbUBxr8QH7VYfttE= 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 46BJr8ba001327 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 15:53:13 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BJr8ba001327 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720727594; bh=A8T8OL44o8zePKAZhXHdKIS9BsPjulU+Ifh3tCC/bc4=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=clGSr8tLcpDJB3Xm2x7cL9Pro5vWQWTIvZtMM+IYmst8WvWuyt4D5+F8GlAp9Mab8 Fi9VuDZaFwPoAdWp8wq1oUYKd6HoIFq0IwZgBL7KRCuzZhe+xuNtVsej5ahyS3n5JP 68awTj6YUPy9MajZ8g7n9Jyv2SIRDNniYivtvAtQ= 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 C05BE1E0AC; Thu, 11 Jul 2024 15:53:08 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 01/14] gdb: use objfile::pspace in objfile::unlink Date: Thu, 11 Jul 2024 15:51:57 -0400 Message-ID: <20240711195307.1544451-2-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 19:53:08 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 I think it would make sense to use objfile::pspace instead of the current program space here. It reduces the risks of calling this method with the wrong current program space set. Change-Id: Id4f3644719f232640c83a1c7f4aa92eaa6af6c5c --- gdb/objfiles.c | 2 +- gdb/objfiles.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 368e129b49d3..d2917c5323cc 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -463,7 +463,7 @@ objfile::make (gdb_bfd_ref_ptr bfd_, const char *name_, objfile_flags flags_, void objfile::unlink () { - current_program_space->remove_objfile (this); + this->pspace->remove_objfile (this); } /* Free all separate debug objfile of OBJFILE, but don't free OBJFILE diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 88dfb33e45c9..ea511459627c 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -439,7 +439,7 @@ struct objfile static objfile *make (gdb_bfd_ref_ptr bfd_, const char *name_, objfile_flags flags_, objfile *parent = nullptr); - /* Remove an objfile from the current program space, and free + /* Remove this objfile from its program space's objfile list, and frees it. */ void unlink (); From patchwork Thu Jul 11 19:51:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93754 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 E268B3875DDA for ; Thu, 11 Jul 2024 19:53:42 +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 DBE7D387545A for ; Thu, 11 Jul 2024 19:53:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DBE7D387545A 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 DBE7D387545A 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=1720727597; cv=none; b=QGTlu1BW3ooXHI3p2sm5Q0iCTKCux2iysSe8X2LUjUHkM9oH+B9cVMlFCBEJZySG1/9Vb63SqdGOcQeZ73RCTJ4U54BFRBccIEmJ28iFrJuiyk3WjuOaV/k1Xmb6nLSAP6WC5aU59sDSysQWvhEwWHXmI8fWJQlSPR+BR4ryBmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720727597; c=relaxed/simple; bh=jhEGvSarhygp6X69CZ8ASKhveR9N/6TqmQdmNfb3lZc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=BIja0Qj2iCt4nGerU7I/QkNgIHkvk6MKFEBIlPKSVKy8Ww5T26Up5+9zfmWIsiH0ZdRowMgXdytcfrNPhwuIHcBuhC5mmBqmOWsEG/lP3vstwBYI1lmbG3iofycLmhayyYPeKofgb8oka0sLvH7m+Dkh6f+Ubm7pG+NMDDQRY0E= 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 46BJr9gS001330 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 15:53:14 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BJr9gS001330 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720727594; bh=crg22Ot8DIkgYR8jVupZ1KLExcAsgSIyvLwcMtSbFoo=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=sUKVI9XcY6YIZbHeoM4lBbk4eGVMAUBeaneb/YHj3brgW9QbS74DjqRw2KirYBdME z8gjq+nUafF3N/FyhdvYP+lpRmoeFlq121Wttrj4nBLOOKN7FseKG9hlPPostioPwS IaBHjp7Y35C17Gz4Fm1ak1Dd6QnGm7Xi3w+em19c= 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 064A91E0C3; Thu, 11 Jul 2024 15:53:08 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 02/14] gdb: pass program space to objfile_purge_solibs Date: Thu, 11 Jul 2024 15:51:58 -0400 Message-ID: <20240711195307.1544451-3-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 19:53:09 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Make the current program space reference bubble up one level. Change-Id: I08cfa77a0351c9602131ed2a294eabb1f1f59a6e --- gdb/objfiles.c | 8 +++----- gdb/objfiles.h | 6 +++--- gdb/solib.c | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index d2917c5323cc..b2f17ba82052 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -784,14 +784,12 @@ have_full_symbols (void) } -/* This operations deletes all objfile entries that represent solibs that - weren't explicitly loaded by the user, via e.g., the add-symbol-file - command. */ +/* See objfiles.h. */ void -objfile_purge_solibs (void) +objfile_purge_solibs (program_space *pspace) { - for (objfile *objf : current_program_space->objfiles_safe ()) + for (objfile *objf : pspace->objfiles_safe ()) { /* We assume that the solib package has been purged already, or will be soon. */ diff --git a/gdb/objfiles.h b/gdb/objfiles.h index ea511459627c..7e56cae4c7dd 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -942,11 +942,11 @@ extern bool is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile); extern bool shared_objfile_contains_address_p (struct program_space *pspace, CORE_ADDR address); -/* This operation deletes all objfile entries that represent solibs that - weren't explicitly loaded by the user, via e.g., the add-symbol-file +/* This operation deletes all objfile entries in PSPACE that represent solibs + that weren't explicitly loaded by the user, via e.g., the add-symbol-file command. */ -extern void objfile_purge_solibs (void); +extern void objfile_purge_solibs (program_space *pspace); /* Functions for dealing with the minimal symbol table, really a misc address<->symbol mapping for things we don't have debug symbols for. */ diff --git a/gdb/solib.c b/gdb/solib.c index 881f0d965027..8cfcc2f4024c 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1248,7 +1248,7 @@ no_shared_libraries (const char *ignored, int from_tty) solibs' objfiles before clear_solib has been called. */ clear_solib (current_program_space); - objfile_purge_solibs (); + objfile_purge_solibs (current_program_space); } /* See solib.h. */ From patchwork Thu Jul 11 19:51:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93756 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 34B883875DD1 for ; Thu, 11 Jul 2024 19:54:12 +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 96886385DDE6 for ; Thu, 11 Jul 2024 19:53:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96886385DDE6 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 96886385DDE6 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=1720727597; cv=none; b=O3U2WKxqJInAqL2snr3OZI2dRsizeRjyokDo0flnebYQN9g4stcfeihjiYQkF26dCXSvBhK7O95vTCfcIiRStsuN/KAzfAH7h4ojT1owQLtT9ViIWhDzKOfvArqRQqoOSdcV7UsUwCWsDBx86bK7Yg078dD07Wtl05HYsXjgXX8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720727597; c=relaxed/simple; bh=6+WQS1IPhJfasaVEpMNCDqOfi1+uLJVShcjrBOKOq8I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=X/04j0zFkZKLD9ZT/fV2sKX9W/oILJ6+MCI2HuoF7fNp837capC6vuduv55OZDuDayOQoptQMA9JiG9O55cZXLePd4Xk0UwN6cqeCmekz2bBAZt/DLLaw+sFChW8FihOtW19n/wKSHI9q3sd/MjpEwgAz2f8oepYW4fwDB8oCMI= 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 46BJr96M001333 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 15:53:14 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BJr96M001333 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720727594; bh=k9HrGsZko7Z+UOiem3+8JmypPFuJ4uswlDAlICSqv98=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=It7CHXhEwEyJaQDbYUflZm3jm6MhYiV6X18RtUxxg6UvnxEt30m/3eNXz1BtQw+mw +aGmltaH7fdRIAYP4LpIuQvU/+SRcSVt4UsQ3tL9JIfw/oGXEhqRp2Ev8bWenzzy0o cA4oyCp6uZnVHfCiXC+M2P2wOFZxWJxPo0785goA= 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 4F4951E0D0; Thu, 11 Jul 2024 15:53:09 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 03/14] gdb: split no_shared_libraries, command vs implementation Date: Thu, 11 Jul 2024 15:51:59 -0400 Message-ID: <20240711195307.1544451-4-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 19:53:09 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 `no_shared_libraries` function is currently used to implement the `nosharedlibrary` command, but it also used internally by other functions. This does not make a very good internal API. Add the `no_shared_libraries_command` function to implement the CLI command. Remove the unused parameters from `no_shared_libraries`. Remove the `from_tty` parameter of `target_pre_inferior`, since it's now unused. Change-Id: I4fcba5ee1e0f7d250aab1a7b62b9ea16265fe962 --- gdb/infcmd.c | 8 ++++---- gdb/infrun.c | 2 +- gdb/progspace.c | 2 +- gdb/remote.c | 2 +- gdb/solib.c | 20 ++++++++++++++------ gdb/solib.h | 2 +- gdb/symfile.c | 2 +- gdb/target.c | 6 +++--- gdb/target.h | 2 +- 9 files changed, 27 insertions(+), 19 deletions(-) diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 71514d5ba66e..5738bf05bf6b 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -383,7 +383,7 @@ run_command_1 (const char *args, int from_tty, enum run_how run_how) /* Clean up any leftovers from other runs. Some other things from this function should probably be moved into target_pre_inferior. */ - target_pre_inferior (from_tty); + target_pre_inferior (); /* The comment here used to read, "The exec file is re-read every time we do a generic_mourn_inferior, so we just have to worry @@ -2628,7 +2628,7 @@ attach_command (const char *args, int from_tty) /* Clean up any leftovers from other runs. Some other things from this function should probably be moved into target_pre_inferior. */ - target_pre_inferior (from_tty); + target_pre_inferior (); gdb::unique_xmalloc_ptr stripped = strip_bg_char (args, &async_exec); args = stripped.get (); @@ -2827,7 +2827,7 @@ detach_command (const char *args, int from_tty) /* If the solist is global across inferiors, don't clear it when we detach from a single inferior. */ if (!gdbarch_has_global_solist (inf->arch ())) - no_shared_libraries (nullptr, from_tty); + no_shared_libraries (); if (deprecated_detach_hook) deprecated_detach_hook (); @@ -2853,7 +2853,7 @@ disconnect_command (const char *args, int from_tty) query_if_trace_running (from_tty); disconnect_tracing (); target_disconnect (args, from_tty); - no_shared_libraries (nullptr, from_tty); + no_shared_libraries (); init_thread_list (); update_previous_thread (); if (deprecated_detach_hook) diff --git a/gdb/infrun.c b/gdb/infrun.c index 1f32a63ad541..b2dfd0c96b15 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1317,7 +1317,7 @@ follow_exec (ptid_t ptid, const char *exec_file_target) /* Also, loading a symbol file below may trigger symbol lookups, and we don't want those to be satisfied by the libraries of the previous incarnation of this process. */ - no_shared_libraries (nullptr, 0); + no_shared_libraries (); inferior *execing_inferior = current_inferior (); inferior *following_inferior; diff --git a/gdb/progspace.c b/gdb/progspace.c index d5b5ef20023b..580ebfbb6d1a 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -115,7 +115,7 @@ program_space::~program_space () set_current_program_space (this); breakpoint_program_space_exit (this); - no_shared_libraries (NULL, 0); + no_shared_libraries (); free_all_objfiles (); /* Defer breakpoint re-set because we don't want to create new locations for this pspace which we're tearing down. */ diff --git a/gdb/remote.c b/gdb/remote.c index 90a4bd57a828..bff61ac8c52c 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -6271,7 +6271,7 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p) } /* First delete any symbols previously loaded from shared libraries. */ - no_shared_libraries (NULL, 0); + no_shared_libraries (); /* Start the remote connection. If error() or QUIT, discard this target (we'd otherwise be in an inconsistent state) and then diff --git a/gdb/solib.c b/gdb/solib.c index 8cfcc2f4024c..75eb9ecfd299 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1234,13 +1234,10 @@ sharedlibrary_command (const char *args, int from_tty) solib_add (args, from_tty, 1); } -/* Implements the command "nosharedlibrary", which discards symbols - that have been auto-loaded from shared libraries. Symbols from - shared libraries that were added by explicit request of the user - are not discarded. Also called from remote.c. */ +/* See solib.h. */ void -no_shared_libraries (const char *ignored, int from_tty) +no_shared_libraries () { /* The order of the two routines below is important: clear_solib notifies the solib_unloaded observers, and some of these observers might need @@ -1251,6 +1248,17 @@ no_shared_libraries (const char *ignored, int from_tty) objfile_purge_solibs (current_program_space); } +/* Implements the command "nosharedlibrary", which discards symbols + that have been auto-loaded from shared libraries. Symbols from + shared libraries that were added by explicit request of the user + are not discarded. */ + +static void +no_shared_libraries_command (const char *ignored, int from_tty) +{ + no_shared_libraries (); +} + /* See solib.h. */ void @@ -1725,7 +1733,7 @@ _initialize_solib () = add_info ("sharedlibrary", info_sharedlibrary_command, _ ("Status of loaded shared object libraries.")); add_info_alias ("dll", info_sharedlibrary_cmd, 1); - add_com ("nosharedlibrary", class_files, no_shared_libraries, + add_com ("nosharedlibrary", class_files, no_shared_libraries_command, _ ("Unload all shared object library symbols.")); add_setshow_boolean_cmd ("auto-solib-add", class_support, &auto_solib_add, diff --git a/gdb/solib.h b/gdb/solib.h index f7a93c0718f0..6b275c580fa4 100644 --- a/gdb/solib.h +++ b/gdb/solib.h @@ -82,7 +82,7 @@ extern bool in_solib_dynsym_resolve_code (CORE_ADDR); /* Discard symbols that were auto-loaded from shared libraries. */ -extern void no_shared_libraries (const char *ignored, int from_tty); +extern void no_shared_libraries (); /* Synchronize GDB's shared object list with inferior's. diff --git a/gdb/symfile.c b/gdb/symfile.c index b0510b4b4090..688dd74c32c0 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1209,7 +1209,7 @@ symbol_file_clear (int from_tty) /* solib descriptors may have handles to objfiles. Wipe them before their objfiles get stale by free_all_objfiles. */ - no_shared_libraries (NULL, from_tty); + no_shared_libraries (); current_program_space->free_all_objfiles (); diff --git a/gdb/target.c b/gdb/target.c index 1b5aa11ed6f5..0ca708729a7a 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2428,7 +2428,7 @@ info_target_command (const char *args, int from_tty) resets (things which might change between targets). */ void -target_pre_inferior (int from_tty) +target_pre_inferior () { /* Clear out solib state. Otherwise the solib state of the previous inferior might have survived and is entirely wrong for the new @@ -2452,7 +2452,7 @@ target_pre_inferior (int from_tty) memory regions and features. */ if (!gdbarch_has_global_solist (current_inferior ()->arch ())) { - no_shared_libraries (NULL, from_tty); + no_shared_libraries (); invalidate_target_mem_regions (); @@ -2504,7 +2504,7 @@ target_preopen (int from_tty) live process to a core of the same program. */ current_inferior ()->pop_all_targets_above (file_stratum); - target_pre_inferior (from_tty); + target_pre_inferior (); } /* See target.h. */ diff --git a/gdb/target.h b/gdb/target.h index 81de4a678c3f..d0af584a2bb0 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -2427,7 +2427,7 @@ struct target_unpusher typedef std::unique_ptr target_unpush_up; -extern void target_pre_inferior (int); +extern void target_pre_inferior (); extern void target_preopen (int); From patchwork Thu Jul 11 19:52: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: 93769 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 D0DB43875470 for ; Thu, 11 Jul 2024 20:13:14 +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 85E393875DDB for ; Thu, 11 Jul 2024 20:12:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 85E393875DDB 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 85E393875DDB 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=1720728731; cv=none; b=MTaIyr1KYvr9LquVPA5u2VuY8oLzvt7Agi8N+Fy10bFR15uezMN+pY0bGr6tDXt74eWLnKozwr94GUy2anuVxL/iz6b3xSCa9zY/VOmP9S/9Ox0ntoseKjrVeimhgBxG8WEwSVCnpW7DiZja3UVWSmTJSVA/wHTlmRacXeP/r+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720728731; c=relaxed/simple; bh=b72+BTmBwof56Eq21dT3EZFTEwBXyv/oYjeZOLab2vY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Sus33pfIGroJie4ApvGx475825hJ3sox+D1QNQQ3XFVp3AtCQbjyzvkxFXzpyVI3imv5ukjyN77aXp9Y//gceeRRrb2FaPcryWzmchWTZsA7WlEJpjUK7TzH7hEeGGxv2RTB8guR+TZmKlZ67G5Owd+4JwstsAGmW5o/w0x+/EU= 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 46BKC2oP006568 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 16:12:07 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BKC2oP006568 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720728727; bh=TvQ+A/QJBqn9yVspYvI4zcGaukk7p1iug1FTjSIb+TM=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=r20nfoTxONO2SsPgKLkU0MimWuMtdS409jn0WcbVsQWJIhUIMx8/a0tsHubMPHSu6 5R5zSWq4HtXvDSdfgyEYblwtJ/EqlUL7VWfGZOrFWLkIcqSFw/jSH7KSW+HGqVPNsj wKgRts1k6lndzllUKeISsw0UQBrBXO2PBf0ZXe8g= 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 689441E0D1; Thu, 11 Jul 2024 15:53:09 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 04/14] gdb: pass program space to no_shared_libraries Date: Thu, 11 Jul 2024 15:52:00 -0400 Message-ID: <20240711195307.1544451-5-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 20:12:02 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Make the current program space reference bubble up one level. Pass `current_program_space` everywhere, except in `program_space::~program_space`, where we pass `this` (which is the current program space at that point). Change-Id: Id86b79f1e44f92a398f49d137d57457174dfa96d --- gdb/infcmd.c | 4 ++-- gdb/infrun.c | 2 +- gdb/progspace.c | 2 +- gdb/remote.c | 2 +- gdb/solib.c | 8 ++++---- gdb/solib.h | 4 ++-- gdb/symfile.c | 2 +- gdb/target.c | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 5738bf05bf6b..f021d3f8a62d 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2827,7 +2827,7 @@ detach_command (const char *args, int from_tty) /* If the solist is global across inferiors, don't clear it when we detach from a single inferior. */ if (!gdbarch_has_global_solist (inf->arch ())) - no_shared_libraries (); + no_shared_libraries (current_program_space); if (deprecated_detach_hook) deprecated_detach_hook (); @@ -2853,7 +2853,7 @@ disconnect_command (const char *args, int from_tty) query_if_trace_running (from_tty); disconnect_tracing (); target_disconnect (args, from_tty); - no_shared_libraries (); + no_shared_libraries (current_program_space); init_thread_list (); update_previous_thread (); if (deprecated_detach_hook) diff --git a/gdb/infrun.c b/gdb/infrun.c index b2dfd0c96b15..06b454bf78f7 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1317,7 +1317,7 @@ follow_exec (ptid_t ptid, const char *exec_file_target) /* Also, loading a symbol file below may trigger symbol lookups, and we don't want those to be satisfied by the libraries of the previous incarnation of this process. */ - no_shared_libraries (); + no_shared_libraries (current_program_space); inferior *execing_inferior = current_inferior (); inferior *following_inferior; diff --git a/gdb/progspace.c b/gdb/progspace.c index 580ebfbb6d1a..224b61e0d7f8 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -115,7 +115,7 @@ program_space::~program_space () set_current_program_space (this); breakpoint_program_space_exit (this); - no_shared_libraries (); + no_shared_libraries (this); free_all_objfiles (); /* Defer breakpoint re-set because we don't want to create new locations for this pspace which we're tearing down. */ diff --git a/gdb/remote.c b/gdb/remote.c index bff61ac8c52c..ba46c990c123 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -6271,7 +6271,7 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p) } /* First delete any symbols previously loaded from shared libraries. */ - no_shared_libraries (); + no_shared_libraries (current_program_space); /* Start the remote connection. If error() or QUIT, discard this target (we'd otherwise be in an inconsistent state) and then diff --git a/gdb/solib.c b/gdb/solib.c index 75eb9ecfd299..a83adf6fb656 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1237,15 +1237,15 @@ sharedlibrary_command (const char *args, int from_tty) /* See solib.h. */ void -no_shared_libraries () +no_shared_libraries (program_space *pspace) { /* The order of the two routines below is important: clear_solib notifies the solib_unloaded observers, and some of these observers might need access to their associated objfiles. Therefore, we can not purge the solibs' objfiles before clear_solib has been called. */ - clear_solib (current_program_space); - objfile_purge_solibs (current_program_space); + clear_solib (pspace); + objfile_purge_solibs (pspace); } /* Implements the command "nosharedlibrary", which discards symbols @@ -1256,7 +1256,7 @@ no_shared_libraries () static void no_shared_libraries_command (const char *ignored, int from_tty) { - no_shared_libraries (); + no_shared_libraries (current_program_space); } /* See solib.h. */ diff --git a/gdb/solib.h b/gdb/solib.h index 6b275c580fa4..25ed77c10509 100644 --- a/gdb/solib.h +++ b/gdb/solib.h @@ -80,9 +80,9 @@ extern bool solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size); extern bool in_solib_dynsym_resolve_code (CORE_ADDR); -/* Discard symbols that were auto-loaded from shared libraries. */ +/* Discard symbols that were auto-loaded from shared libraries in PSPACE. */ -extern void no_shared_libraries (); +extern void no_shared_libraries (program_space *pspace); /* Synchronize GDB's shared object list with inferior's. diff --git a/gdb/symfile.c b/gdb/symfile.c index 688dd74c32c0..312e3b77ca88 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1209,7 +1209,7 @@ symbol_file_clear (int from_tty) /* solib descriptors may have handles to objfiles. Wipe them before their objfiles get stale by free_all_objfiles. */ - no_shared_libraries (); + no_shared_libraries (current_program_space); current_program_space->free_all_objfiles (); diff --git a/gdb/target.c b/gdb/target.c index 0ca708729a7a..18027037d3bd 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2452,7 +2452,7 @@ target_pre_inferior () memory regions and features. */ if (!gdbarch_has_global_solist (current_inferior ()->arch ())) { - no_shared_libraries (); + no_shared_libraries (current_program_space); invalidate_target_mem_regions (); From patchwork Thu Jul 11 19:52:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93767 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 522DD3875DD5 for ; Thu, 11 Jul 2024 20:12:46 +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 13E7D3875470 for ; Thu, 11 Jul 2024 20:12:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 13E7D3875470 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 13E7D3875470 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=1720728730; cv=none; b=PBqyGRfjtW7DecvQqb90EV3EYgNfgb4nKivXskS310gvMGfnoSY99y7/47csDUwdNwlg9PVfsGkaNXmlF8bMp2/Y/SgI6RpfGDg21NjTbj+3KwkWLuaWKes8qL22J1UjTFalh+7IkpM165veDE1MCr0+qQF56Z793etbtTE42xM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720728730; c=relaxed/simple; bh=tNnrTS0BxAKfIGcyeYRclGYsot+18OcFK50sPqv0gyA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pvzcqnXCpERbP1FP4LnNubc0CYl82ARkl03kOdsCVxcnc80LqSF7XIjt4lhArxKcs2o0gOsI4uQKDpf8eszlxQRIDTAGHNoVFQNsd4Lxl54HV80Fmkevmu8O96rSCQeCiix9pGJb1xmPUK/oc0kp0Ot+4Mn8225nwtsNOH7HYnM= 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 46BKC2uY006575 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 16:12:07 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BKC2uY006575 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720728727; bh=kwa9b0Y8foCRKZW5vYzoFiYwBa7hXFvJB5IMrV3prGw=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=NRIF1jQvrpEJgauQ+9qR6inbXJ5B/Rl5VTQxH80NUGwGCVBncP/QbuqUBMoKV/s5f 7E9j6e3U27a4yHYIdBk808+kREXkztACWup7pnxxHng2A5P/1l40T4RjBw9r3wVsyo ibWCMv83CRrHXTwWdZyucaHQY16KCxQW1qX+mi8o= 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 A48F51E0DA; Thu, 11 Jul 2024 15:53:09 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 05/14] gdb: make `program_space::free_all_objfiles` use `this` Date: Thu, 11 Jul 2024 15:52:01 -0400 Message-ID: <20240711195307.1544451-6-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 20:12:02 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Use `this` instead of `current_program_space`. Presumably, the method wants to check the solibs of "this" program space, not the current global program space (although they are likely always the same at the moment). Change-Id: Iaf0534f36bfd47c04c53ed0657da332bdb8fb906 --- gdb/progspace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/progspace.c b/gdb/progspace.c index 224b61e0d7f8..28198c1e8a43 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -128,7 +128,7 @@ void program_space::free_all_objfiles () { /* Any objfile reference would become stale. */ - for (const solib &so : current_program_space->solibs ()) + for (const solib &so : this->solibs ()) gdb_assert (so.objfile == NULL); while (!objfiles_list.empty ()) From patchwork Thu Jul 11 19:52:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93765 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 143163875DC9 for ; Thu, 11 Jul 2024 20:03:28 +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 1897D387546D for ; Thu, 11 Jul 2024 20:02:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1897D387546D 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 1897D387546D 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=1720728130; cv=none; b=nqyUVTGLO9yioUeTj4++3LsLcWZOSrljnlQjqnNcR5ufhdpUIUWEKar4IZN845Uwuyp8JpMGbEowy96GBq4KvdvUMzTLvBdso5ig9/pZHWeDWbuAwKYp3IPGweDB6pdm5FbHWSrdlZpWupe0XM8I7Q+L32ax+82U0rItccQD8YE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720728130; c=relaxed/simple; bh=875ZwvuvFULDCe2N896zcl4zAebyujxvHnwfq+KwS20=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=R4e9tLsYChCCllE+JarYF+qcXDZ4APxhJhsMvLGjSCSv2jfp2/QS5VHNIBBy76itmVrl0LPpU9xFKt0wB1MsQyIXWvwhjLjqtVysHwWKcpkXKbbAYCzjeAP8GhZdRmi34lR0HutgNU0E31wmtQrXq5K/JiJzrJ5OKStgm2/9IHw= 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 46BK22ck003803 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 16:02:07 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BK22ck003803 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720728127; bh=plkbED9JLA6cWlVnv4GReXs5Wtl9R2+hkYswqaT6r08=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=XUZdRYy2v8vp6q81aDjOQB2MnRKzYq6lmfRREaMdDP97l06GDN5gkzM0JetAVVsbQ bxbEyGLRko4rtEwkilaLu99l6n7j+5eka48xcGuFMW5yXSCVMwj55wJSFT+B8Ch0c2 nDxMljXxn66LXsldhnY+FXf79DcbqYH/yogBebyE= 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 CAD5E1E0FF; Thu, 11 Jul 2024 15:53:09 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 06/14] gdb: pass program space to clear_current_source_symtab_and_line Date: Thu, 11 Jul 2024 15:52:02 -0400 Message-ID: <20240711195307.1544451-7-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 20:02:02 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Make the current program space reference bubble up one level. Change-Id: I692554474d17e4f4708fd8ad662bf6c0bb964726 --- gdb/cli/cli-cmds.c | 2 +- gdb/objfiles.c | 2 +- gdb/source.c | 2 +- gdb/source.h | 3 ++- gdb/symfile.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 3af794cebaf2..450009156d4b 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -1295,7 +1295,7 @@ list_command (const char *arg, int from_tty) { /* The inferior is not running, so reset the current source location to the default (usually the main function). */ - clear_current_source_symtab_and_line (); + clear_current_source_symtab_and_line (current_program_space); try { set_default_source_symtab_and_line (); diff --git a/gdb/objfiles.c b/gdb/objfiles.c index b2f17ba82052..0c10841ba123 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -564,7 +564,7 @@ objfile::~objfile () struct symtab_and_line cursal = get_current_source_symtab_and_line (); if (cursal.symtab && cursal.symtab->compunit ()->objfile () == this) - clear_current_source_symtab_and_line (); + clear_current_source_symtab_and_line (current_program_space); } /* Rebuild section map next time we need it. */ diff --git a/gdb/source.c b/gdb/source.c index 9e528d3f705d..b80eeae68a7d 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -298,7 +298,7 @@ set_current_source_symtab_and_line (const symtab_and_line &sal) /* Reset any information stored about a default file and line to print. */ void -clear_current_source_symtab_and_line (void) +clear_current_source_symtab_and_line (program_space *pspace) { current_source_location *loc = get_source_location (current_program_space); loc->set (nullptr, 0); diff --git a/gdb/source.h b/gdb/source.h index 144ee48f7223..4eb179378993 100644 --- a/gdb/source.h +++ b/gdb/source.h @@ -21,6 +21,7 @@ #include "gdbsupport/scoped_fd.h" +struct program_space; struct symtab; /* See openp function definition for their description. */ @@ -126,7 +127,7 @@ extern symtab_and_line set_current_source_symtab_and_line (const symtab_and_line &sal); /* Reset any information stored about a default file and line to print. */ -extern void clear_current_source_symtab_and_line (void); +extern void clear_current_source_symtab_and_line (program_space *pspace); /* Add a source path substitution rule. */ extern void add_substitute_path_rule (const char *, const char *); diff --git a/gdb/symfile.c b/gdb/symfile.c index 312e3b77ca88..0bdec9af1987 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2884,7 +2884,7 @@ clear_symtab_users (symfile_add_flags add_flags) /* Clear the "current" symtab first, because it is no longer valid. breakpoint_re_set may try to access the current symtab. */ - clear_current_source_symtab_and_line (); + clear_current_source_symtab_and_line (current_program_space); clear_displays (); clear_last_displayed_sal (); From patchwork Thu Jul 11 19:52:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93763 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 5B1483875DED for ; Thu, 11 Jul 2024 20:02:38 +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 67087387545A for ; Thu, 11 Jul 2024 20:02:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 67087387545A 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 67087387545A 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=1720728130; cv=none; b=LtbDFJgvzIzK5+bme6hpgaspEnE6TqVQGCXdjWrjpzjGvfTHioeMZ5Xd3D6fHTM+YQbTKkk2gt9lFEVPoriicsAMzoPgF0dw3JayUYwA+WmbuNOjxjK/M6bYW9ESz1JqgW2gaSeumtw3Quf2ncyLRAUSeR2zO9SxOorwkt66Dj8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720728130; c=relaxed/simple; bh=exj+94VBSp3U0QezTplaKygzT5/I9wog9xVULEYegsY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=F8kN+2VtZ4jVd8xLDs71slh/VpASEdrIYYqifuW4DHmn+x7iAacbuwry39Xp/x9aJ4IgT4mjmWuJ7IxE/TvVrGtLjJFctcImcUFYH8bjwEkcma0W7XysptgRH+A8k8bbwHgSGwxpGVoL/dLnu1u6d+D5mc1/1TwB3hJe1kd4MFw= 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 46BK22xu003811 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 16:02:07 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BK22xu003811 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720728127; bh=P6yHeGLRBIMq9nBT0KejFJkRi9H/L0WPc5mCsZHJ900=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=Tp/Io5FAcgyqopw9ZwVUR6msLWlF7u3ef+bdClfDL4w6fmxztcSrAP6XirD5wweS+ 5nZ0TORIHMvyLHftMH6rz/k9kfhC9GAyXWu6SBg/apzRKPeslh7NhlNy0kqUIKXfUw 7Z5t6IieQ080h3Sn2h62nDzcXQb6WS7wTPPk9/Ac= 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 081071E100; Thu, 11 Jul 2024 15:53:09 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 07/14] gdb: bool-ify a few functions in objfiles.{c,h} Date: Thu, 11 Jul 2024 15:52:03 -0400 Message-ID: <20240711195307.1544451-8-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 20:02:02 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Change return types to bool, and make a few stylistic adjustments. Change-Id: I784c3c33af0394a77c25064b06eb3e128e69222f --- gdb/objfiles.c | 77 +++++++++++++++++++++----------------------------- gdb/objfiles.h | 23 +++++++++++---- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 0c10841ba123..e4ab73775a22 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -731,56 +731,49 @@ objfile_rebase (struct objfile *objfile, CORE_ADDR slide) if (changed) breakpoint_re_set (); } - -/* Return non-zero if OBJFILE has full symbols. */ -int -objfile_has_full_symbols (struct objfile *objfile) +/* See objfiles.h. */ + +bool +objfile_has_full_symbols (objfile *objfile) { - return objfile->compunit_symtabs != NULL; + return objfile->compunit_symtabs != nullptr; } -/* Return non-zero if OBJFILE has full or partial symbols, either directly - or through a separate debug file. */ +/* See objfiles.h. */ -int -objfile_has_symbols (struct objfile *objfile) +bool +objfile_has_symbols (objfile *objfile) { for (::objfile *o : objfile->separate_debug_objfiles ()) if (o->has_partial_symbols () || objfile_has_full_symbols (o)) - return 1; - return 0; -} + return true; + return false; +} -/* Many places in gdb want to test just to see if we have any partial - symbols available. This function returns zero if none are currently - available, nonzero otherwise. */ +/* See objfiles.h. */ -int -have_partial_symbols (void) +bool +have_partial_symbols () { for (objfile *ofp : current_program_space->objfiles ()) - { - if (ofp->has_partial_symbols ()) - return 1; - } - return 0; + if (ofp->has_partial_symbols ()) + return true; + + return false; } -/* Many places in gdb want to test just to see if we have any full - symbols available. This function returns zero if none are currently - available, nonzero otherwise. */ +/* See objfiles.h. */ -int -have_full_symbols (void) +bool +have_full_symbols () { for (objfile *ofp : current_program_space->objfiles ()) - { - if (objfile_has_full_symbols (ofp)) - return 1; - } - return 0; + if (objfile_has_full_symbols (ofp)) + return true; + + return false; } @@ -799,22 +792,16 @@ objfile_purge_solibs (program_space *pspace) } } +/* See objfiles.h. */ -/* Many places in gdb want to test just to see if we have any minimal - symbols available. This function returns zero if none are currently - available, nonzero otherwise. */ - -int -have_minimal_symbols (void) +bool +have_minimal_symbols () { for (objfile *ofp : current_program_space->objfiles ()) - { - if (ofp->per_bfd->minimal_symbol_count > 0) - { - return 1; - } - } - return 0; + if (ofp->per_bfd->minimal_symbol_count > 0) + return true; + + return false; } /* Qsort comparison function. */ diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 7e56cae4c7dd..e81cfe68c2de 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -918,13 +918,23 @@ extern void free_objfile_separate_debug (struct objfile *); extern void objfile_relocate (struct objfile *, const section_offsets &); extern void objfile_rebase (struct objfile *, CORE_ADDR); -extern int objfile_has_full_symbols (struct objfile *objfile); +/* Return true if OBJFILE has full symbols. */ -extern int objfile_has_symbols (struct objfile *objfile); +extern bool objfile_has_full_symbols (objfile *objfile); -extern int have_partial_symbols (void); +/* Return true if OBJFILE has full or partial symbols, either directly + or through a separate debug file. */ -extern int have_full_symbols (void); +extern bool objfile_has_symbols (objfile *objfile); + +/* Return true if any objfile of the current program space has partial + symbols. */ + +extern bool have_partial_symbols (); + +/* Return true if any objfile of the current program space has full symbols. */ + +extern bool have_full_symbols (); extern void objfile_set_sym_fns (struct objfile *objfile, const struct sym_fns *sf); @@ -951,7 +961,10 @@ extern void objfile_purge_solibs (program_space *pspace); /* Functions for dealing with the minimal symbol table, really a misc address<->symbol mapping for things we don't have debug symbols for. */ -extern int have_minimal_symbols (void); +/* Return true if any objfile of the current program space has minimal + symbols. */ + +extern bool have_minimal_symbols (); extern struct obj_section *find_pc_section (CORE_ADDR pc); From patchwork Thu Jul 11 19:52:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93759 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 6C5A83875DC3 for ; Thu, 11 Jul 2024 19:56:03 +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 6BB98387546A for ; Thu, 11 Jul 2024 19:55:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6BB98387546A 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 6BB98387546A 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=1720727721; cv=none; b=XrRkxjSuhdyT54p1vzGrfuY0t4X7WJuNzUFeXattpDEGF92KFzCev26XeFWJfAWpiU0TGyVVAKmaRxny2c+prhmWbmpXpEnVaMpuhh2BUiFUB0VQfMzn5dJYs3q1qhIcSUo5KVi1tSZDI3YRuQZRTKJTqPU2uS1NREeY9hMscWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720727721; c=relaxed/simple; bh=4qb3toBkQPeMfy3EpyYsj4qk5Hve2Atf762Uf+tOWlI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=p4pO5T42mL81upM2p1rb9uF0sMpRoCI4pwWfFQr0gig3yjXxyycCMASTl1E/+g+XC2Q8+ZkT6/RhxE3su7BPTEadKkAY87uVm1qPwBs0hG7lMqYk1SOQMLAEF5Vz7Gz9QFpvin0oOhTvtEqWLwKjxUe+YtUY4qNSTKCJSAHo9Xs= 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 46BJtAjR001819 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 15:55:15 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BJtAjR001819 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720727716; bh=kDYldLF94P07ErREQWJP6/BCI5bnXLgph8xxBmJ3POE=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=uIMGGBzdMS4Duad/bx3ygYGMSGTIBiAdWJgtumxJNRfmVz10asZsCjNqaW1jH3haR DgU4Ig4cmsq63E9O67Pa6Z9/kgqx7XI+hNolNYg3oBNmpjrcSU7bxxDSo/i0lVJX/x CVYq6l78fPh8MCJ4EtiHtCi0NeSUSEieNe5GqNQI= 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 71DC51E030; Thu, 11 Jul 2024 15:55:10 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 08/14] gdb: pass program space to have_{full,partial}_symbols Date: Thu, 11 Jul 2024 15:52:04 -0400 Message-ID: <20240711195307.1544451-9-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 19:55:10 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Make the current program space reference bubble up one level. Change-Id: I19c4fc2ca955f9c828ef426a077b43983865697b --- gdb/ada-exp.y | 4 +++- gdb/c-exp.y | 3 ++- gdb/cli/cli-cmds.c | 3 ++- gdb/d-exp.y | 3 ++- gdb/go-exp.y | 4 ++-- gdb/infcmd.c | 2 +- gdb/linespec.c | 9 +++++---- gdb/objfiles.c | 12 ++++++------ gdb/objfiles.h | 14 ++++++-------- gdb/p-exp.y | 4 ++-- gdb/parse.c | 3 ++- gdb/source.c | 5 +++-- gdb/symfile.c | 8 +++++--- gdb/symtab.c | 8 +++++--- gdb/tui/tui-disasm.c | 3 ++- 15 files changed, 48 insertions(+), 37 deletions(-) diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 0126db5f2bee..dfcbb2bebd98 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1857,7 +1857,9 @@ write_var_or_type (struct parser_state *par_state, } } - if (!have_full_symbols () && !have_partial_symbols () && block == NULL) + if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space) + && block == NULL) error (_("No symbol table is loaded. Use the \"file\" command.")); if (block == par_state->expression_context_block) error (_("No definition of \"%s\" in current context."), name0.ptr); diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 60223172a23c..a1a74a985a6f 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1213,7 +1213,8 @@ variable: name_not_typename = lookup_bound_minimal_symbol (arg.c_str ()); if (msymbol.minsym == NULL) { - if (!have_full_symbols () && !have_partial_symbols ()) + if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space)) error (_("No symbol table is loaded. Use the \"file\" command.")); else error (_("No symbol \"%s\" in current context."), diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 450009156d4b..9d3a90b057d2 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -1327,7 +1327,8 @@ list_command (const char *arg, int from_tty) and clear NO_END; however, if one of the arguments is blank, set DUMMY_BEG or DUMMY_END to record that fact. */ - if (!have_full_symbols () && !have_partial_symbols ()) + if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space)) error (_("No symbol table is loaded. Use the \"file\" command.")); std::vector sals; diff --git a/gdb/d-exp.y b/gdb/d-exp.y index 13d2cfa44d88..6feacd8e3648 100644 --- a/gdb/d-exp.y +++ b/gdb/d-exp.y @@ -466,7 +466,8 @@ PrimaryExpression: msymbol = lookup_bound_minimal_symbol (copy.c_str ()); if (msymbol.minsym != NULL) pstate->push_new (msymbol); - else if (!have_full_symbols () && !have_partial_symbols ()) + else if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space)) error (_("No symbol table is loaded. Use the \"file\" command")); else error (_("No symbol \"%s\" in current context."), diff --git a/gdb/go-exp.y b/gdb/go-exp.y index 1a6ebbe135be..115c71ba8ea9 100644 --- a/gdb/go-exp.y +++ b/gdb/go-exp.y @@ -577,8 +577,8 @@ variable: name_not_typename if (msymbol.minsym != NULL) pstate->push_new (msymbol); - else if (!have_full_symbols () - && !have_partial_symbols ()) + else if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space)) error (_("No symbol table is loaded. " "Use the \"file\" command.")); else diff --git a/gdb/infcmd.c b/gdb/infcmd.c index f021d3f8a62d..e34ce80dbf0c 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -519,7 +519,7 @@ start_command (const char *args, int from_tty) /* Some languages such as Ada need to search inside the program minimal symbols for the location where to put the temporary breakpoint before starting. */ - if (!have_minimal_symbols ()) + if (!have_minimal_symbols (current_program_space)) error (_("No symbol table loaded. Use the \"file\" command.")); /* Run the program until reaching the main procedure... */ diff --git a/gdb/linespec.c b/gdb/linespec.c index 7a1fbc2ebec5..7a6b21e1b741 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1550,9 +1550,9 @@ symbol_not_found_error (const char *symbol, const char *filename) if (symbol == NULL) symbol = ""; - if (!have_full_symbols () - && !have_partial_symbols () - && !have_minimal_symbols ()) + if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space) + && !have_minimal_symbols (current_program_space)) throw_error (NOT_FOUND_ERROR, _("No symbol table is loaded. Use the \"file\" command.")); @@ -3716,7 +3716,8 @@ symtabs_from_filename (const char *filename, if (result.empty ()) { - if (!have_full_symbols () && !have_partial_symbols ()) + if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space)) throw_error (NOT_FOUND_ERROR, _("No symbol table is loaded. " "Use the \"file\" command.")); diff --git a/gdb/objfiles.c b/gdb/objfiles.c index e4ab73775a22..77d759b3aa59 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -755,9 +755,9 @@ objfile_has_symbols (objfile *objfile) /* See objfiles.h. */ bool -have_partial_symbols () +have_partial_symbols (program_space *pspace) { - for (objfile *ofp : current_program_space->objfiles ()) + for (objfile *ofp : pspace->objfiles ()) if (ofp->has_partial_symbols ()) return true; @@ -767,9 +767,9 @@ have_partial_symbols () /* See objfiles.h. */ bool -have_full_symbols () +have_full_symbols (program_space *pspace) { - for (objfile *ofp : current_program_space->objfiles ()) + for (objfile *ofp : pspace->objfiles ()) if (objfile_has_full_symbols (ofp)) return true; @@ -795,9 +795,9 @@ objfile_purge_solibs (program_space *pspace) /* See objfiles.h. */ bool -have_minimal_symbols () +have_minimal_symbols (program_space *pspace) { - for (objfile *ofp : current_program_space->objfiles ()) + for (objfile *ofp : pspace->objfiles ()) if (ofp->per_bfd->minimal_symbol_count > 0) return true; diff --git a/gdb/objfiles.h b/gdb/objfiles.h index e81cfe68c2de..2fb786592b64 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -927,14 +927,13 @@ extern bool objfile_has_full_symbols (objfile *objfile); extern bool objfile_has_symbols (objfile *objfile); -/* Return true if any objfile of the current program space has partial - symbols. */ +/* Return true if any objfile of PSPACE has partial symbols. */ -extern bool have_partial_symbols (); +extern bool have_partial_symbols (program_space *pspace); -/* Return true if any objfile of the current program space has full symbols. */ +/* Return true if any objfile of PSPACE has full symbols. */ -extern bool have_full_symbols (); +extern bool have_full_symbols (program_space *pspace); extern void objfile_set_sym_fns (struct objfile *objfile, const struct sym_fns *sf); @@ -961,10 +960,9 @@ extern void objfile_purge_solibs (program_space *pspace); /* Functions for dealing with the minimal symbol table, really a misc address<->symbol mapping for things we don't have debug symbols for. */ -/* Return true if any objfile of the current program space has minimal - symbols. */ +/* Return true if any objfile of PSPACE has minimal symbols. */ -extern bool have_minimal_symbols (); +extern bool have_minimal_symbols (program_space *pspace); extern struct obj_section *find_pc_section (CORE_ADDR pc); diff --git a/gdb/p-exp.y b/gdb/p-exp.y index f334db6b5237..0a0fa95e8688 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -725,8 +725,8 @@ variable: name_not_typename if (msymbol.minsym != NULL) pstate->push_new (msymbol); - else if (!have_full_symbols () - && !have_partial_symbols ()) + else if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space)) error (_("No symbol table is loaded. " "Use the \"file\" command.")); else diff --git a/gdb/parse.c b/gdb/parse.c index 0a2b2a5b2abf..c10b09af485e 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -148,7 +148,8 @@ parser_state::push_symbol (const char *name, block_symbol sym) struct bound_minimal_symbol msymbol = lookup_bound_minimal_symbol (name); if (msymbol.minsym != NULL) push_new (msymbol); - else if (!have_full_symbols () && !have_partial_symbols ()) + else if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space)) error (_("No symbol table is loaded. Use the \"file\" command.")); else error (_("No symbol \"%s\" in current context."), name); diff --git a/gdb/source.c b/gdb/source.c index b80eeae68a7d..854ba0f90f31 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -260,8 +260,9 @@ get_current_source_symtab_and_line (void) void set_default_source_symtab_and_line (void) { - if (!have_full_symbols () && !have_partial_symbols ()) - error (_("No symbol table is loaded. Use the \"file\" command.")); + if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space)) + error (_ ("No symbol table is loaded. Use the \"file\" command.")); /* Pull in a current source symtab if necessary. */ current_source_location *loc = get_source_location (current_program_space); diff --git a/gdb/symfile.c b/gdb/symfile.c index 0bdec9af1987..b9a576f24c9c 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1053,9 +1053,10 @@ symbol_file_add_with_addrs (const gdb_bfd_ref_ptr &abfd, const char *name, if (from_tty && (always_confirm - || ((have_full_symbols () || have_partial_symbols ()) + || ((have_full_symbols (current_program_space) + || have_partial_symbols (current_program_space)) && mainline)) - && !query (_("Load new symbol table from \"%s\"? "), name)) + && !query (_ ("Load new symbol table from \"%s\"? "), name)) error (_("Not confirmed.")); if (mainline) @@ -1199,7 +1200,8 @@ symbol_file_add_main_1 (const char *args, symfile_add_flags add_flags, void symbol_file_clear (int from_tty) { - if ((have_full_symbols () || have_partial_symbols ()) + if ((have_full_symbols (current_program_space) + || have_partial_symbols (current_program_space)) && from_tty && (current_program_space->symfile_object_file ? !query (_("Discard symbol table from `%s'? "), diff --git a/gdb/symtab.c b/gdb/symtab.c index 41d71beec2ac..e075c17a0fd0 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4764,8 +4764,9 @@ info_sources_worker (struct ui_out *uiout, static void info_sources_command (const char *args, int from_tty) { - if (!have_full_symbols () && !have_partial_symbols ()) - error (_("No symbol table is loaded. Use the \"file\" command.")); + if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space)) + error (_ ("No symbol table is loaded. Use the \"file\" command.")); filename_partial_match_opts match_opts; auto group = make_info_sources_options_def_group (&match_opts); @@ -6381,7 +6382,8 @@ make_source_files_completion_list (const char *text, const char *word) const char *base_name; struct add_partial_filename_data datum; - if (!have_full_symbols () && !have_partial_symbols ()) + if (!have_full_symbols (current_program_space) + && !have_partial_symbols (current_program_space)) return list; filename_seen_cache filenames_seen; diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 0727d3a90a82..2f25fedbcab3 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -389,7 +389,8 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p) if (tui_location.addr () == 0) { - if (have_full_symbols () || have_partial_symbols ()) + if (have_full_symbols (current_program_space) + || have_partial_symbols (current_program_space)) { set_default_source_symtab_and_line (); struct symtab_and_line sal = get_current_source_symtab_and_line (); From patchwork Thu Jul 11 19:52:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93760 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 A72033875DE1 for ; Thu, 11 Jul 2024 19:56:31 +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 7D62B387546D for ; Thu, 11 Jul 2024 19:55:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D62B387546D 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 7D62B387546D 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=1720727721; cv=none; b=xAPYnvpOwzUTxJF0A8MsuH0DQ6dnKOg/+f6F9Bsyz721h6XRdXoHgV4BBbLd5pfNOyNPMZ3UUKm4g1rhu8+oh/c1xXdPPRgBIC5d/16RTj6S+f23+EF8UUbhgfEYSjJPZKfWPIWQRF5sueguwvzKWtOKJryG1aQ+txuizf9oCBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720727721; c=relaxed/simple; bh=T7+3T1Uh+5Tp1cUH7fiLXwag3zMCYR1/nX+NFChW4lY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=p3oe6aDZN6pqg/JdHXAQnq6eLxCBkn8ZvDjTb1yuiZPauN8fSzJKtA5eiR377njr4nf3YsPR3Y9MVKytdtr3hKvj/8S8dN9APKblBhJw4FEVaRF9vA3TDNK78SDW+ojxxUPB1Sy4/6iqIT1CNY3RPHZifzeUwBJHB8+UgwQwFnI= 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 46BJtAMl001820 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 15:55:15 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BJtAMl001820 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720727716; bh=UNvk98FZEJq89e5rPm3mGFi1yfBDcUXr5gMlqRzd14s=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=Dim70eKQ4ZMJijPEhgXzGfN8xaVIzm5BbJZ16mmwW14cPkuBnsNY90A1/qRxyD43C R78KXgVHBad8+9d8vektomx3iphJGDOVcic1xybz/0J9mLgWa7vHLzYBcMZN+bzWvc HF/mTeii+vdS0v0udHqQ8YBkQ36JzJY9zVp1OIUA= 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 8D7E61E0AC; Thu, 11 Jul 2024 15:55:10 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 09/14] gdb: pass program space to get_current_source_symtab_and_line Date: Thu, 11 Jul 2024 15:52:05 -0400 Message-ID: <20240711195307.1544451-10-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 19:55:10 +0000 X-Spam-Status: No, score=-3188.3 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 Make the current program space reference bubble up one level. Change-Id: I6ba6dc4a2cb188720cbb61b84ab5c954aac105c6 --- gdb/breakpoint.c | 5 ++--- gdb/cli/cli-cmds.c | 14 +++++++++----- gdb/compile/compile.c | 4 +++- gdb/infcmd.c | 3 ++- gdb/linespec.c | 9 +++++---- gdb/macroscope.c | 6 +++--- gdb/mi/mi-cmd-file.c | 4 ++-- gdb/objfiles.c | 3 ++- gdb/parse.c | 4 ++-- gdb/python/python.c | 2 +- gdb/source.c | 11 +++++------ gdb/source.h | 4 +++- gdb/tui/tui-disasm.c | 3 ++- gdb/tui/tui-hooks.c | 3 ++- gdb/tui/tui-source.c | 5 +++-- gdb/tui/tui-winsource.c | 10 +++++----- 16 files changed, 51 insertions(+), 39 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index a973518ac5f0..46ac8d655c65 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -8825,8 +8825,6 @@ static void parse_breakpoint_sals (location_spec *locspec, struct linespec_result *canonical) { - struct symtab_and_line cursal; - if (locspec->type () == LINESPEC_LOCATION_SPEC) { const char *spec @@ -8875,7 +8873,8 @@ parse_breakpoint_sals (location_spec *locspec, ObjC: However, don't match an Objective-C method name which may have a '+' or '-' succeeded by a '['. */ - cursal = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); if (last_displayed_sal_is_valid ()) { const char *spec = NULL; diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 9d3a90b057d2..92bb8fc21420 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -984,7 +984,7 @@ edit_command (const char *arg, int from_tty) if (arg == 0) { set_default_source_symtab_and_line (); - sal = get_current_source_symtab_and_line (); + sal = get_current_source_symtab_and_line (current_program_space); } /* Bare "edit" edits file with present line. */ @@ -1240,7 +1240,8 @@ list_command (const char *arg, int from_tty) if (get_first_line_listed () == 0 && (arg == nullptr || arg[0] != '.')) { set_default_source_symtab_and_line (); - list_around_line (arg, get_current_source_symtab_and_line ()); + list_around_line + (arg, get_current_source_symtab_and_line (current_program_space)); } /* "l" and "l +" lists the next few lines, unless we're listing past @@ -1248,7 +1249,8 @@ list_command (const char *arg, int from_tty) else if (arg == nullptr || arg[0] == '+') { set_default_source_symtab_and_line (); - const symtab_and_line cursal = get_current_source_symtab_and_line (); + const symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); if (last_symtab_line (cursal.symtab) >= cursal.line) print_source_lines (cursal.symtab, source_lines_range (cursal.line), 0); @@ -1262,7 +1264,8 @@ list_command (const char *arg, int from_tty) else if (arg[0] == '-') { set_default_source_symtab_and_line (); - const symtab_and_line cursal = get_current_source_symtab_and_line (); + const symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); if (get_first_line_listed () == 1) error (_("Already at the start of %s."), @@ -1305,7 +1308,8 @@ list_command (const char *arg, int from_tty) error (_("Insufficient debug info for showing source " "lines at default location")); } - cursal = get_current_source_symtab_and_line (); + cursal + = get_current_source_symtab_and_line (current_program_space); gdb_assert (cursal.symtab != nullptr); } diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 88531a217814..8896b44a8c41 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.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 "progspace.h" #include "ui.h" #include "ui-out.h" #include "command.h" @@ -487,7 +488,8 @@ get_expr_block_and_pc (CORE_ADDR *pc) if (block == NULL) { - struct symtab_and_line cursal = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); if (cursal.symtab) block = cursal.symtab->compunit ()->blockvector ()->static_block (); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index e34ce80dbf0c..d7a4674bda20 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1078,7 +1078,8 @@ jump_command (const char *arg, int from_tty) { /* If multiple sal-objects were found, try dropping those that aren't from the current symtab. */ - struct symtab_and_line cursal = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); sals.erase (std::remove_if (sals.begin (), sals.end (), [&] (const symtab_and_line &sal) { diff --git a/gdb/linespec.c b/gdb/linespec.c index 7a6b21e1b741..abefe3440aff 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -3205,7 +3205,8 @@ decode_line_with_current_source (const char *string, int flags) /* We use whatever is set as the current source line. We do not try and get a default source symtab+line or it will recursively call us! */ - symtab_and_line cursal = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); location_spec_up locspec = string_to_location_spec (&string, current_language); @@ -3255,9 +3256,9 @@ initialize_defaults (struct symtab **default_symtab, int *default_line) /* Use whatever we have for the default source line. We don't use get_current_or_default_symtab_and_line as it can recurse and call us back! */ - struct symtab_and_line cursal = - get_current_source_symtab_and_line (); - + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); + *default_symtab = cursal.symtab; *default_line = cursal.line; } diff --git a/gdb/macroscope.c b/gdb/macroscope.c index 4c1304f119ad..c1b2238b173f 100644 --- a/gdb/macroscope.c +++ b/gdb/macroscope.c @@ -121,9 +121,9 @@ default_macro_scope (void) symbol files loaded, then get_current_or_default would raise an error. But `set width' shouldn't raise an error just because it can't decide which scope to macro-expand its argument in. */ - struct symtab_and_line cursal - = get_current_source_symtab_and_line (); - + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); + sal.symtab = cursal.symtab; sal.line = cursal.line; } diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c index 3e2702e04ed1..f2fe4351f873 100644 --- a/gdb/mi/mi-cmd-file.c +++ b/gdb/mi/mi-cmd-file.c @@ -35,7 +35,6 @@ void mi_cmd_file_list_exec_source_file (const char *command, const char *const *argv, int argc) { - struct symtab_and_line st; struct ui_out *uiout = current_uiout; if (!mi_valid_noargs ("-file-list-exec-source-file", argc, argv)) @@ -43,7 +42,8 @@ mi_cmd_file_list_exec_source_file (const char *command, /* Set the default file and line, also get them. */ set_default_source_symtab_and_line (); - st = get_current_source_symtab_and_line (); + symtab_and_line st + = get_current_source_symtab_and_line (current_program_space); /* We should always get a symtab. Apparently, filename does not need to be tested for NULL. The documentation in symtab.h diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 77d759b3aa59..600d205d0645 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -561,7 +561,8 @@ objfile::~objfile () and if so, call clear_current_source_symtab_and_line. */ { - struct symtab_and_line cursal = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); if (cursal.symtab && cursal.symtab->compunit ()->objfile () == this) clear_current_source_symtab_and_line (current_program_space); diff --git a/gdb/parse.c b/gdb/parse.c index c10b09af485e..2541a2eb143f 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -375,8 +375,8 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc, if (!expression_context_block) { - struct symtab_and_line cursal - = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); if (cursal.symtab) expression_context_block diff --git a/gdb/python/python.c b/gdb/python/python.c index e9092b4d9943..d86a031ee95d 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -963,7 +963,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args) else { set_default_source_symtab_and_line (); - def_sal = get_current_source_symtab_and_line (); + def_sal = get_current_source_symtab_and_line (current_program_space); sals = def_sal; } } diff --git a/gdb/source.c b/gdb/source.c index 854ba0f90f31..dbdec90881bd 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -231,16 +231,15 @@ get_source_location (program_space *pspace) return loc; } -/* Return the current source file for listing and next line to list. - NOTE: The returned sal pc and end fields are not valid. */ +/* See source.h. */ -struct symtab_and_line -get_current_source_symtab_and_line (void) +symtab_and_line +get_current_source_symtab_and_line (program_space *pspace) { symtab_and_line cursal; - current_source_location *loc = get_source_location (current_program_space); + current_source_location *loc = get_source_location (pspace); - cursal.pspace = current_program_space; + cursal.pspace = pspace; cursal.symtab = loc->symtab (); cursal.line = loc->line (); cursal.pc = 0; diff --git a/gdb/source.h b/gdb/source.h index 4eb179378993..541ee3b7a124 100644 --- a/gdb/source.h +++ b/gdb/source.h @@ -23,6 +23,7 @@ struct program_space; struct symtab; +struct symtab_and_line; /* See openp function definition for their description. */ @@ -108,7 +109,8 @@ extern int get_lines_to_list (void); /* Return the current source file for listing and next line to list. NOTE: The returned sal pc and end fields are not valid. */ -extern struct symtab_and_line get_current_source_symtab_and_line (void); +extern symtab_and_line get_current_source_symtab_and_line + (program_space *pspace); /* If the current source file for listing is not set, try and get a default. Usually called before get_current_source_symtab_and_line() is called. diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 2f25fedbcab3..53be866187e2 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -393,7 +393,8 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p) || have_partial_symbols (current_program_space)) { set_default_source_symtab_and_line (); - struct symtab_and_line sal = get_current_source_symtab_and_line (); + symtab_and_line sal + = get_current_source_symtab_and_line (current_program_space); if (sal.symtab != nullptr) find_line_pc (sal.symtab, sal.line, &addr); diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index e6673ab650d8..25358d08352b 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -127,7 +127,8 @@ tui_refresh_frame_and_register_information () /* Make sure that the source window is displayed. */ tui_add_win_to_layout (SRC_WIN); - struct symtab_and_line sal = get_current_source_symtab_and_line (); + symtab_and_line sal + = get_current_source_symtab_and_line (current_program_space); tui_update_source_windows_with_line (sal); } } diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 444c0f7a90e6..ee64e4172b51 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -136,7 +136,8 @@ tui_source_window::do_scroll_vertical (int num_to_scroll) if (!m_content.empty ()) { struct symtab *s; - struct symtab_and_line cursal = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); struct gdbarch *arch = m_gdbarch; if (cursal.symtab == NULL) @@ -220,7 +221,7 @@ void tui_source_window::display_start_addr (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p) { - struct symtab_and_line cursal = get_current_source_symtab_and_line (); + symtab_and_line cursal = get_current_source_symtab_and_line (current_program_space); *gdbarch_p = m_gdbarch; find_line_pc (cursal.symtab, m_start_line_or_addr.u.line_no, addr_p); diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 80297e59dd60..b08fca7a7e3e 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -440,8 +440,8 @@ tui_source_window_base::rerender () if (!m_content.empty ()) { - struct symtab_and_line cursal - = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); if (m_start_line_or_addr.loa == LOA_LINE) cursal.line = m_start_line_or_addr.u.line_no; @@ -451,8 +451,8 @@ tui_source_window_base::rerender () } else if (deprecated_safe_get_selected_frame () != NULL) { - struct symtab_and_line cursal - = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); frame_info_ptr frame = deprecated_safe_get_selected_frame (); struct gdbarch *gdbarch = get_frame_arch (frame); @@ -492,7 +492,7 @@ tui_source_window_base::refill () if (this == tui_src_win ()) { - sal = get_current_source_symtab_and_line (); + sal = get_current_source_symtab_and_line (current_program_space); if (sal.symtab == NULL) { frame_info_ptr fi = deprecated_safe_get_selected_frame (); From patchwork Thu Jul 11 19:52:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93757 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 D92FC3875470 for ; Thu, 11 Jul 2024 19:55:49 +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 8A6ED387545A for ; Thu, 11 Jul 2024 19:55:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A6ED387545A 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 8A6ED387545A 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=1720727717; cv=none; b=RO6Gwudj9kbQF+NG2GhGOBkghFExTPS81zIylQe1VthHeJIPYAWbAV/mq/+y3DLbpPPyeQsrTM+krkkMBrCBoNM0cxB4ul0kXwcbZsMxD+MmWZ9e+Wy05fJMQ8+dhxvI/oP50UltKMDN5g31eEmNQhZXZBVtrRaYdOvz/HMcvtQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720727717; c=relaxed/simple; bh=3/XKlXbJ8/cTrqp/qWT2pWheSCJnriaC2A/HAX4qxy8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AMb5BYDc+6Rkp5uRuoXCkiLgn03sLGbuwn9s0Wi+eyMIUeFobAOuPLoIdGahaqW7hdkEJJKVJsUjolcTiWOx6uVgQ1r69THX7XkFqEf1/y+AhwLOKs7Qk/fwQNrioiscBukGBuT7a28rlG4zX1sPGzJQ3LHRTgdaa+PCFFt+6vc= 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 46BJtALU001822 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 15:55:15 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BJtALU001822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720727716; bh=lwJ3ZILFRlnjMgzBLryIakD5KBsdSxkPjqGFRbaBOtk=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=tmBMSLCIJHFusBvkWCKd1+sDkyYygRcB6fPTKxobZLnK4T9JSzd1t8JdH9HJXr2DH Yl2mJSa0jFUOfGXoS+n0gJ/Leq5tagJY1yqzmKbNrwMRjQ6SbYQx970sqlMYRG/ZPB DBUD78doe8qVkz9rwcBBpE3Qd+0ljAkMS1SPdwY0= 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 A4F1B1E0C3; Thu, 11 Jul 2024 15:55:10 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 10/14] gdb: pass program space to objfiles_changed Date: Thu, 11 Jul 2024 15:52:06 -0400 Message-ID: <20240711195307.1544451-11-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 19:55:10 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Make the current program space reference bubble up one level. Change-Id: I9b33c9e0d22c171eb1bb59ce480621b02c7b7bf7 --- gdb/objfiles.c | 8 +++----- gdb/objfiles.h | 5 ++++- gdb/symfile.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 600d205d0645..f1569c35c10d 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -1163,16 +1163,14 @@ pc_in_section (CORE_ADDR pc, const char *name) && s->the_bfd_section->name != nullptr && strcmp (s->the_bfd_section->name, name) == 0); } - -/* Set section_map_dirty so section map will be rebuilt next time it - is used. Called by reread_symbols. */ +/* See objfiles.h. */ void -objfiles_changed (void) +objfiles_changed (program_space *pspace) { /* Rebuild section map next time we need it. */ - get_objfile_pspace_data (current_program_space)->section_map_dirty = 1; + get_objfile_pspace_data (pspace)->section_map_dirty = 1; } /* See comments in objfiles.h. */ diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 2fb786592b64..1e04704c68fd 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -938,7 +938,10 @@ extern bool have_full_symbols (program_space *pspace); extern void objfile_set_sym_fns (struct objfile *objfile, const struct sym_fns *sf); -extern void objfiles_changed (void); +/* Set section_map_dirty for PSPACE so the section map will be rebuilt next time + it is used. */ + +extern void objfiles_changed (program_space *pspace); /* Return true if ADDR maps into one of the sections of OBJFILE and false otherwise. */ diff --git a/gdb/symfile.c b/gdb/symfile.c index b9a576f24c9c..50fb9983f3d5 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2613,7 +2613,7 @@ reread_symbols (int from_tty) making the dangling pointers point to correct data again. */ - objfiles_changed (); + objfiles_changed (current_program_space); /* Recompute section offsets and section indices. */ objfile->sf->sym_offsets (objfile, {}); From patchwork Thu Jul 11 19:52:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93758 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 4815D3875DEC for ; Thu, 11 Jul 2024 19:55:52 +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 B389F3875462 for ; Thu, 11 Jul 2024 19:55:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B389F3875462 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 B389F3875462 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=1720727718; cv=none; b=BaWW14jwKQVjRdNbTsOJgyDoYcpODh8Hc+O0kxX8no2sizsbDnT0DOCVvIeVKGkdpJupZt+OLRNt7L+ExGwz8j7qeL2F89ZEb/LCAv0NGDeGNSmV1lq4H5Xr88l144jVdvYbLRNDxsxU09qiS8ScIgyfP7qJOw+rVVsrQrn5sh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720727718; c=relaxed/simple; bh=+RZVy5YdUEa9RvZchyJ74Ph71Ffpz4PGD11wiYYtveY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=NuwzzKeAdlySa5nPpG2ypGOzWH3bukbsanF8mpkz5bTF+H/1sylOnNu4jhZwJgwLwqHOHEvq0i5xJLLCB87TCxMlywJqmjM87BEgQhzUzWoWv/5kdC6xAYbdHh8f28CpnN35Gsu45DQJPs8qYHNZqzCnXqHfTGpgnfyipAX9FSY= 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 46BJtBiv001831 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 15:55:15 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BJtBiv001831 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720727716; bh=ysfGlrQusHMFj4CifO9SDEkURzwuYP+7zgnwfGOYz3M=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=gCe8G6M2CDIQl9EvBw1ZiLYHgrkIX2c344KwdE1OexY7w7IoeVu8A2QuxRgPHL+sX uy68KM8BjURKaDjZjX7JNKB9k7kL5b10opDvSwvnowYWBZVZWPVBodwYLW5zoIlcZM eRcEPA2NEe8ryDeNu7r7N5PDlWfkHon+h05TmkRY= 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 D2D2F1E0D0; Thu, 11 Jul 2024 15:55:10 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 11/14] gdb: pass program space to entry_point_address_query Date: Thu, 11 Jul 2024 15:52:07 -0400 Message-ID: <20240711195307.1544451-12-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 19:55:11 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Make the current program space bubble up one level. Change-Id: Ic3ad0869ca1afe41854f605a6f7eb092fca29ff8 --- gdb/frame.c | 2 +- gdb/objfiles.c | 9 ++++----- gdb/objfiles.h | 6 +++++- gdb/solib-frv.c | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/gdb/frame.c b/gdb/frame.c index 43efac07d95a..e6ab54797a8e 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -2628,7 +2628,7 @@ inside_entry_func (const frame_info_ptr &this_frame) { CORE_ADDR entry_point; - if (!entry_point_address_query (&entry_point)) + if (!entry_point_address_query (current_program_space, &entry_point)) return false; return get_frame_func (this_frame) == entry_point; diff --git a/gdb/objfiles.c b/gdb/objfiles.c index f1569c35c10d..2a2fbd3ef01b 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -345,13 +345,12 @@ objfile::objfile (gdb_bfd_ref_ptr bfd_, const char *name, objfile_flags flags_) set_objfile_per_bfd (this); } -/* If there is a valid and known entry point, function fills *ENTRY_P with it - and returns non-zero; otherwise it returns zero. */ +/* See objfiles.h. */ int -entry_point_address_query (CORE_ADDR *entry_p) +entry_point_address_query (program_space *pspace, CORE_ADDR *entry_p) { - objfile *objf = current_program_space->symfile_object_file; + objfile *objf = pspace->symfile_object_file; if (objf == NULL || !objf->per_bfd->ei.entry_point_p) return 0; @@ -368,7 +367,7 @@ entry_point_address (void) { CORE_ADDR retval; - if (!entry_point_address_query (&retval)) + if (!entry_point_address_query (current_program_space, &retval)) error (_("Entry point address is not known.")); return retval; diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 1e04704c68fd..199dea0a9ba4 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -907,7 +907,11 @@ obj_section::set_offset (CORE_ADDR offset) /* Declarations for functions defined in objfiles.c */ -extern int entry_point_address_query (CORE_ADDR *entry_p); +/* If there is a valid and known entry point in PSPACE, fill *ENTRY_P with it + and return non-zero. */ + +extern int entry_point_address_query (program_space *pspace, + CORE_ADDR *entry_p); extern CORE_ADDR entry_point_address (void); diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index 39508fab4c83..79052db86f82 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -687,7 +687,7 @@ enable_break (void) return 0; } - if (!entry_point_address_query (&entry_point)) + if (!entry_point_address_query (current_program_space, &entry_point)) { solib_debug_printf ("Symbol file has no entry point."); return 0; From patchwork Thu Jul 11 19:52:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93768 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 E44D33875DE4 for ; Thu, 11 Jul 2024 20:12:46 +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 F09793875DC8 for ; Thu, 11 Jul 2024 20:12:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F09793875DC8 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 F09793875DC8 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=1720728731; cv=none; b=BA45DnfOXEJ4VYNDOaUolqVeIAR4l+8A3sXpySIoPD9cwagI2MzW1e6kjnKMhFAQhBYGeQl4DAk/R+G9tDF3OOzW2Fxz8TxxkBdydey/JJQXxVe/+fwYPXXEaHiJUs4r39v4+vdz7fMBQ/mmlXokXv9BDi3kYzyaRVD5+XMwZJw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720728731; c=relaxed/simple; bh=4sdJDPzUBzKc6E2FMvC9X70T+3hBayNwaIvhIPgO+Nc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=xz+xwzpkZe0lmaab1aGA+7wdrX3LTkIQ6EwixqWny2Y6I2wIyWMpr9i8C4IbyFyfWQ6JSTnVnhgPbVqjSAlmhUes6Vx3Q9YkZaxDxPVb7gj66zwyezHQ7fvSb2x/usLSlhKUFDZXu42yYZrtziUOEJyMzF5K3VUtblllpBhLVxA= 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 46BKC2x9006571 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 16:12:07 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BKC2x9006571 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720728727; bh=yh8YCKFsrhiiLwT8DQoSskG1fqE8kXIL2XkmZ7QKjT0=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=WizuU1m6/EDgLSxhb/9K8Khc8JwCEg2e6OgQM34g1lDBtIZ3kGoWR2gSA9X+k9Ymb kXHEcHwzp3vo5lBSa0qld20KNRuIHUtSheLWT9tYUF4YTfqUrIgsT1+ewt2766lw0q nsafqFXm+M847VA18JVeyj1GTCaLomtDcqsnYn6I= 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 F0CA01E101; Thu, 11 Jul 2024 15:55:10 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 12/14] gdb: pass program space to entry_point_address Date: Thu, 11 Jul 2024 15:52:08 -0400 Message-ID: <20240711195307.1544451-13-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 20:12:02 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Make the current program space reference bubble up one level. Change-Id: Ifc9b8186abaefb10caf99f79ae09e526fa65c882 --- gdb/arc-tdep.c | 2 +- gdb/arch-utils.c | 2 +- gdb/infcall.c | 2 +- gdb/objfiles.c | 6 +++--- gdb/objfiles.h | 4 +++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index 9491107ecffb..4fc1ea1dc464 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -861,7 +861,7 @@ arc_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct regcache *regcache) { *real_pc = funaddr; - *bp_addr = entry_point_address (); + *bp_addr = entry_point_address (current_program_space); return sp; } diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 83e29470bf78..fb5634d5fa07 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -56,7 +56,7 @@ displaced_step_at_entry_point (struct gdbarch *gdbarch) CORE_ADDR addr; int bp_len; - addr = entry_point_address (); + addr = entry_point_address (current_program_space); /* Inferior calls also use the entry point as a breakpoint location. We don't want displaced stepping to interfere with those diff --git a/gdb/infcall.c b/gdb/infcall.c index edac9a741791..559fcb7f9a6a 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -1271,7 +1271,7 @@ call_function_by_hand_dummy (struct value *function, CORE_ADDR dummy_addr; real_pc = funaddr; - dummy_addr = entry_point_address (); + dummy_addr = entry_point_address (current_program_space); /* A call dummy always consists of just a single breakpoint, so its address is the same as the address of the dummy. diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 2a2fbd3ef01b..ea6ba4c20b26 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -360,14 +360,14 @@ entry_point_address_query (program_space *pspace, CORE_ADDR *entry_p) return 1; } -/* Get current entry point address. Call error if it is not known. */ +/* See objfiles.h. */ CORE_ADDR -entry_point_address (void) +entry_point_address (program_space *pspace) { CORE_ADDR retval; - if (!entry_point_address_query (current_program_space, &retval)) + if (!entry_point_address_query (pspace, &retval)) error (_("Entry point address is not known.")); return retval; diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 199dea0a9ba4..0a28c6558ca5 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -913,7 +913,9 @@ obj_section::set_offset (CORE_ADDR offset) extern int entry_point_address_query (program_space *pspace, CORE_ADDR *entry_p); -extern CORE_ADDR entry_point_address (void); +/* Get the entry point address in PSPACE. Call error if it is not known. */ + +extern CORE_ADDR entry_point_address (program_space *pspace); extern void build_objfile_section_table (struct objfile *); From patchwork Thu Jul 11 19:52:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93764 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 7F4723875DD4 for ; Thu, 11 Jul 2024 20:03:03 +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 15739387546A for ; Thu, 11 Jul 2024 20:02:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 15739387546A 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 15739387546A 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=1720728130; cv=none; b=pfv6u+BMRHdRwk5LudRHaOPbhhCH2u2j9f8M/z8KnaY5NhRozmz9crJC/1spY6Hs5Uy7KxuYVoly9qxovpw6FVWg1XX/eLbnNWS08Oo0nazBhglmhLAgsPqvg81WBlZJEY9/p2Uoi5eN3cciyKptWZ7VZUVnF5VV7rN+6pfIHBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720728130; c=relaxed/simple; bh=NPA5Qfi76oCbrXrfYOLcSjP6bxuTBk9ZCZ60AZRqt28=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mF2oS0VmHHsu9K2K+1KDxdLBMylyzyClWLsra0VuNM9owlkTaIkkMMmsVESYRcTyyFdAZB4WoeF6U4BcPWLYMfeo8DJQ5adH79TTeAu2USfyOuaneL6P0vYXWKEQ65eIjj5hhya2BrK0ZvtXFtUkowJyVSpjX0rLMEJDIoA8JAE= 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 46BK22hF003802 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 16:02:07 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BK22hF003802 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720728127; bh=hD//RfDFF5+9S3IHg6tuqdXusbl14JhphaZ2nXBncbs=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=PhgVqIPi+Z1E2yKSyyX0hD/+4d6RB6FwKi3YhVQq4deBbbNGAIgAN48hXlRRwFgFo nXbdUBx61gWKfuCYQ2MY2yFk072pDGYDsf3W35JlADPZTaA7QwGPbLbYBgi0NDSq8K WCviMkyBNhOzHU2HIO5D/ap0DP08mdMkfe4x0Dpg= 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 18B1A1E102; Thu, 11 Jul 2024 15:55:11 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 13/14] gdb: pass program space to objfile::objfile Date: Thu, 11 Jul 2024 15:52:09 -0400 Message-ID: <20240711195307.1544451-14-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 20:02:02 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Make the current program space reference bubble up one level. Change-Id: I81e45e89e0cfd87c308f801d49ae811a941348b7 --- gdb/objfiles.c | 8 +++++--- gdb/objfiles.h | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index ea6ba4c20b26..0bc603ed3e93 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -306,9 +306,10 @@ build_objfile_section_table (struct objfile *objfile) requests for specific operations. Other bits like OBJF_SHARED are simply copied through to the new objfile flags member. */ -objfile::objfile (gdb_bfd_ref_ptr bfd_, const char *name, objfile_flags flags_) +objfile::objfile (gdb_bfd_ref_ptr bfd_, program_space *pspace, + const char *name, objfile_flags flags_) : flags (flags_), - pspace (current_program_space), + pspace (pspace), obfd (std::move (bfd_)) { const char *expanded_name; @@ -444,7 +445,8 @@ objfile * objfile::make (gdb_bfd_ref_ptr bfd_, const char *name_, objfile_flags flags_, objfile *parent) { - objfile *result = new objfile (std::move (bfd_), name_, flags_); + objfile *result + = new objfile (std::move (bfd_), current_program_space, name_, flags_); if (parent != nullptr) add_separate_debug_objfile (result, parent); diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 0a28c6558ca5..1a748939d80a 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -423,7 +423,8 @@ struct objfile private: /* The only way to create an objfile is to call objfile::make. */ - objfile (gdb_bfd_ref_ptr, const char *, objfile_flags); + objfile (gdb_bfd_ref_ptr, program_space *pspace, const char *, + objfile_flags); public: From patchwork Thu Jul 11 19:52:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 93762 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 D213538754BD for ; Thu, 11 Jul 2024 20:02:37 +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 4FCD7385DDE6 for ; Thu, 11 Jul 2024 20:02:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FCD7385DDE6 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 4FCD7385DDE6 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=1720728130; cv=none; b=xerG+cq6OV3eWNIrESZP3XkJSdEemZIP1OYp+QyPb7hbZm/byaouB5lJ/p9hYdg0fDd49Ro7WSDIpAYXdn32zrNcoiZWqpKMsWGK0NjQEPQ3TAg+fx8/4Gz6etTr4l1kOo1+325I7H7Av0rtoxebtfmLkqc5kSyVLhv1gkpYTcE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720728130; c=relaxed/simple; bh=V0KMk4elBEurXolqv7GJmUwympuf1O69w+3JbtIw5Ok=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=BF73hClXe/qU7Dd5EcF2x4+bNFV2iP8ayurwFNvVZeX1VxVvvAg8CWzFKHIklcQVKeRhsHWZ4OMaWIDKXOe2YuWDjl6eZilqa5StlDWlRHQWODZg6f2Qh38jD2YS3SN8kQ9A8m5e2kASQXYqN/aP5Y+R1YzowBnrhQhyuoTejOc= 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 46BK22qb003804 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2024 16:02:07 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 46BK22qb003804 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1720728127; bh=/d6vx+Zc7Lo9DnOPKtgeK27lhrIXQ6+kinUUW3EN3p8=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=Rjvn48oV1oOq7TJQzjH2wQFpu426/hbgTpIt0zvtVes6KtcYi1jvWQrGnmIm249c0 B+wL+F6CyNHDndmhC7og0EvB9R2ONEpnuEbRP2BDwwSd5myMTXVrgAh3E8hrSMKdwf xPa0i5onABTsMJvGL/fgCbU3Zit6UOwTn6R/pVR8= 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 35B5A1E107; Thu, 11 Jul 2024 15:55:11 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 14/14] gdb: pass program space to objfile::make Date: Thu, 11 Jul 2024 15:52:10 -0400 Message-ID: <20240711195307.1544451-15-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711195307.1544451-1-simon.marchi@polymtl.ca> References: <20240711195307.1544451-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 11 Jul 2024 20:02:02 +0000 X-Spam-Status: No, score=-3188.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 Make the current program space reference bubble up one level. Change-Id: Iee8b11c853c76e539c991c4785737c69e6a1925c --- gdb/jit.c | 4 ++-- gdb/objfiles.c | 4 ++-- gdb/objfiles.h | 5 +++-- gdb/symfile.c | 5 +++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gdb/jit.c b/gdb/jit.c index 797be95a8dac..2744d03f8f8d 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -660,8 +660,8 @@ jit_object_close_impl (struct gdb_symbol_callbacks *cb, paddress (priv_data->gdbarch, priv_data->entry.symfile_addr)); - objfile *objfile = objfile::make (nullptr, objfile_name.c_str (), - OBJF_NOT_FILENAME); + objfile *objfile = objfile::make (nullptr, current_program_space, + objfile_name.c_str (), OBJF_NOT_FILENAME); objfile->per_bfd->gdbarch = priv_data->gdbarch; for (gdb_symtab &symtab : obj->symtabs) diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 0bc603ed3e93..ffdf60fc8658 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -442,8 +442,8 @@ add_separate_debug_objfile (struct objfile *objfile, struct objfile *parent) /* See objfiles.h. */ objfile * -objfile::make (gdb_bfd_ref_ptr bfd_, const char *name_, objfile_flags flags_, - objfile *parent) +objfile::make (gdb_bfd_ref_ptr bfd_, program_space *pspace, const char *name_, + objfile_flags flags_, objfile *parent) { objfile *result = new objfile (std::move (bfd_), current_program_space, name_, flags_); diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 1a748939d80a..77af7a4cb5a2 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -437,8 +437,9 @@ struct objfile ~objfile (); /* Create an objfile. */ - static objfile *make (gdb_bfd_ref_ptr bfd_, const char *name_, - objfile_flags flags_, objfile *parent = nullptr); + static objfile *make (gdb_bfd_ref_ptr bfd_, program_space *pspace, + const char *name_, objfile_flags flags_, + objfile *parent = nullptr); /* Remove this objfile from its program space's objfile list, and frees it. */ diff --git a/gdb/symfile.c b/gdb/symfile.c index 50fb9983f3d5..a2ebd0068f84 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1026,7 +1026,6 @@ symbol_file_add_with_addrs (const gdb_bfd_ref_ptr &abfd, const char *name, section_addr_info *addrs, objfile_flags flags, struct objfile *parent) { - struct objfile *objfile; const int from_tty = add_flags & SYMFILE_VERBOSE; const int mainline = add_flags & SYMFILE_MAINLINE; const int always_confirm = add_flags & SYMFILE_ALWAYS_CONFIRM; @@ -1061,7 +1060,9 @@ symbol_file_add_with_addrs (const gdb_bfd_ref_ptr &abfd, const char *name, if (mainline) flags |= OBJF_MAINLINE; - objfile = objfile::make (abfd, name, flags, parent); + + objfile *objfile + = objfile::make (abfd, current_program_space, name, flags, parent); /* We either created a new mapped symbol table, mapped an existing symbol table file which has not had initial symbol reading