From patchwork Tue Sep 10 16:56:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 97396 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 EA574385DDDD for ; Tue, 10 Sep 2024 16:57:05 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id BBD6C3858403 for ; Tue, 10 Sep 2024 16:56:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BBD6C3858403 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BBD6C3858403 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725987392; cv=none; b=ECT7TVi7KJGq+gwpL3OnTfVu0Pl3CsiDmQ/OQn/xSD0u1lL4o7KvFvcXMDgBhFdTTZu6SMMfaZ/UCPhlppgeVfEyAJlBbaRCoFGt8O4nJO120Igc+jEvSIqOQ0nlOYzrzAWEyyF9nT/e3RGua4X4DEFXpfuJn4mvyZFEyWvGKTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725987392; c=relaxed/simple; bh=ymJtpNaKgX4LpC+0zwiQXbc81nwnQlFzDu6v0GqM+AQ=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=UEdSiLm/PfeGxACN0GdjUXtP252to487IYeElzCHAF0ufM8QElKLVWde4ZLj+HYDI5+M7e3w6J51GqMMh4CBJSUWoVWeyIPnA++XEl4WlF1GoSAcxw4MskzvBXCILfXbSst0Qe3KvCBXxr4z0y200rcMv7CYCZcQxeBGy5sMUy4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725987389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iN7EVVRaSAxcPcaHqFcNT6AM4ElB2e7hAo1YIdWrBEo=; b=HMrIWDF1JsO7VGP8jjgX9gaMa1V9bixqfMqr0CbLpxCuEswzfm6pEVGUpqETmvvEKFDaE5 +Q7odJQI0D7AqROotlIvUDM+J/71FgIjRdYGKsulifS9pCxmmj7nVgl3fMD3kF/cpOFnKe 0Xl7dpKriSXA8NlY8JYEtyqFuRQyaKA= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-507-Be2t2HBQP7CK_BFc6IDzCQ-1; Tue, 10 Sep 2024 12:56:28 -0400 X-MC-Unique: Be2t2HBQP7CK_BFc6IDzCQ-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-42cbfc2aac6so6712825e9.1 for ; Tue, 10 Sep 2024 09:56:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725987386; x=1726592186; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iN7EVVRaSAxcPcaHqFcNT6AM4ElB2e7hAo1YIdWrBEo=; b=DiE4Gr9ZhaUy0uPZFJG2N2IyxwX7kGviUdemUvcNhbpAMRtvixjPQtwo4bdfqxGlF7 grX/WkiedHbodRSW1DQ2xyXDoyfvztPuIWSfetQBXs26AN3lhDQ8WHwCa/y0QU/lfEcn /9uMncZ/iNw4Q7kvZJZ2C3vdWYAxK580GOD9yXK/Wlb003z7MJh3nJb9Q6ecUe5nGXvc l7Z3ogZV+MKVg7eumENsTpBSiKhy+AiKEER5dbaxaZUCWQ2FBRPI+6pm0nIioeXD4TPk 4kozzoNKKfQLLuBWq803dkzZcoyHXWCH0fxMboThhIM4IRtwi6pbLuBj8WJveQwDBP+S pWtQ== X-Gm-Message-State: AOJu0YzML0C0b5dvubVRuc3xmQPBRBBMyNV/cupe4078yjZtqcx9F8qe qkENXRoFus7uDOZg8945aKx8erzLSxjiIYx3eKu0QQ9iq7vn/zXqNadu3k1ksruJvHoARti9rlh sy4iYgW06am4/a1RmtslZX9JXyc2b7p1ujeDdXY/ZyRwy0ecINdLLizBfjh4EhkU1PyaYS9TUs/ XDSi5Gpn8SZu1BRZOiB/1I3W7U9dgZ3Wqc3+UnmdP2smw= X-Received: by 2002:a05:600c:5246:b0:42c:b843:792b with SMTP id 5b1f17b1804b1-42cb8437b03mr53563505e9.2.1725987386458; Tue, 10 Sep 2024 09:56:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKhnLf0kKqeGi1a4OSRI2w+kzuPTMiFrxOt0DpGWfH999GgE0bgavViJXByuTgIwEHHs1MBA== X-Received: by 2002:a05:600c:5246:b0:42c:b843:792b with SMTP id 5b1f17b1804b1-42cb8437b03mr53562915e9.2.1725987385345; Tue, 10 Sep 2024 09:56:25 -0700 (PDT) Received: from localhost (178.126.90.146.dyn.plus.net. [146.90.126.178]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ca3a3cc31sm143686895e9.24.2024.09.10.09.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 09:56:23 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 2/4] gdb: rename ext_lang_missing_debuginfo_result Date: Tue, 10 Sep 2024 17:56:18 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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 In preparation for later commits in this series, rename ext_lang_missing_debuginfo_result to ext_lang_missing_file_result. A later commit will add additional Python APIs to handle different types of missing files beyond just debuginfo. This is just a rename commit, there should be no functional changes after this commit. --- gdb/extension-priv.h | 2 +- gdb/extension.c | 4 ++-- gdb/extension.h | 10 +++++----- gdb/python/python.c | 12 ++++++------ gdb/symfile-debug.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gdb/extension-priv.h b/gdb/extension-priv.h index 653fd51e2f1..90810e4bbc8 100644 --- a/gdb/extension-priv.h +++ b/gdb/extension-priv.h @@ -292,7 +292,7 @@ struct extension_language_ops /* Give extension languages a chance to deal with missing debug information. OBJFILE is the file for which GDB was unable to find any debug information. */ - ext_lang_missing_debuginfo_result + ext_lang_missing_file_result (*handle_missing_debuginfo) (const struct extension_language_defn *, struct objfile *objfile); }; diff --git a/gdb/extension.c b/gdb/extension.c index c488fc77494..f7b99d681eb 100644 --- a/gdb/extension.c +++ b/gdb/extension.c @@ -1053,7 +1053,7 @@ ext_lang_print_insn (struct gdbarch *gdbarch, CORE_ADDR address, /* See extension.h. */ -ext_lang_missing_debuginfo_result +ext_lang_missing_file_result ext_lang_handle_missing_debuginfo (struct objfile *objfile) { for (const struct extension_language_defn *extlang : extension_languages) @@ -1061,7 +1061,7 @@ ext_lang_handle_missing_debuginfo (struct objfile *objfile) if (extlang->ops == nullptr || extlang->ops->handle_missing_debuginfo == nullptr) continue; - ext_lang_missing_debuginfo_result result + ext_lang_missing_file_result result = extlang->ops->handle_missing_debuginfo (extlang, objfile); if (!result.filename ().empty () || result.try_again ()) return result; diff --git a/gdb/extension.h b/gdb/extension.h index 5b0830b6675..2a749161508 100644 --- a/gdb/extension.h +++ b/gdb/extension.h @@ -361,23 +361,23 @@ extern std::optional ext_lang_print_insn it. And the third option is for the extension to just return a null result, indication there is nothing the extension can do to provide the missing debug information. */ -struct ext_lang_missing_debuginfo_result +struct ext_lang_missing_file_result { /* Default result. The extension was unable to provide the missing debug info. */ - ext_lang_missing_debuginfo_result () + ext_lang_missing_file_result () { /* Nothing. */ } /* When TRY_AGAIN is true GDB should try searching again, the extension may have installed the missing debug info into a suitable location. When TRY_AGAIN is false this is equivalent to the default, no argument, constructor. */ - ext_lang_missing_debuginfo_result (bool try_again) + ext_lang_missing_file_result (bool try_again) : m_try_again (try_again) { /* Nothing. */ } /* Look in FILENAME for the missing debug info. */ - ext_lang_missing_debuginfo_result (std::string &&filename) + ext_lang_missing_file_result (std::string &&filename) : m_filename (std::move (filename)) { /* Nothing. */ } @@ -407,7 +407,7 @@ struct ext_lang_missing_debuginfo_result /* Called when GDB failed to find any debug information for OBJFILE. */ -extern ext_lang_missing_debuginfo_result ext_lang_handle_missing_debuginfo +extern ext_lang_missing_file_result ext_lang_handle_missing_debuginfo (struct objfile *objfile); #if GDB_SELF_TEST diff --git a/gdb/python/python.c b/gdb/python/python.c index a2ce1f6545a..978fc0c4cac 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -128,7 +128,7 @@ static std::optional gdbpy_colorize (const std::string &filename, const std::string &contents); static std::optional gdbpy_colorize_disasm (const std::string &content, gdbarch *gdbarch); -static ext_lang_missing_debuginfo_result gdbpy_handle_missing_debuginfo +static ext_lang_missing_file_result gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang, struct objfile *objfile); /* The interface between gdb proper and loading of python scripts. */ @@ -1755,10 +1755,10 @@ gdbpy_get_current_objfile (PyObject *unused1, PyObject *unused2) /* Implement the 'handle_missing_debuginfo' hook for Python. GDB has failed to find any debug information for OBJFILE. The extension has a chance to record this, or even install the required debug information. - See the description of ext_lang_missing_debuginfo_result in - extension-priv.h for details of the return value. */ + See the description of ext_lang_missing_file_result in extension-priv.h + for details of the return value. */ -static ext_lang_missing_debuginfo_result +static ext_lang_missing_file_result gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang, struct objfile *objfile) { @@ -1806,7 +1806,7 @@ gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang, if (PyBool_Check (pyo_execute_ret.get ())) { bool try_again = PyObject_IsTrue (pyo_execute_ret.get ()); - return ext_lang_missing_debuginfo_result (try_again); + return ext_lang_missing_file_result (try_again); } if (!gdbpy_is_string (pyo_execute_ret.get ())) @@ -1826,7 +1826,7 @@ gdbpy_handle_missing_debuginfo (const struct extension_language_defn *extlang, return {}; } - return ext_lang_missing_debuginfo_result (std::string (filename.get ())); + return ext_lang_missing_file_result (std::string (filename.get ())); } /* Compute the list of active python type printers and store them in diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index 0eccda21f39..473528fc9a2 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -628,7 +628,7 @@ objfile::find_and_add_separate_symbol_file (symfile_add_flags symfile_flags) the user a system specific message that guides them to finding the missing debug info. */ - ext_lang_missing_debuginfo_result ext_result + ext_lang_missing_file_result ext_result = ext_lang_handle_missing_debuginfo (this); if (!ext_result.filename ().empty ()) {