From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out-232.mta0.migadu.com (out-232.mta0.migadu.com [IPv6:2001:41d0:1004:224b::e8]) by sourceware.org (Postfix) with ESMTPS id 1516B3858C2B for ; Fri, 1 Sep 2023 21:04:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1516B3858C2B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=gpanders.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gpanders.com X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpanders.com; s=key1; t=1693602273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VmFJEdAeDt4aq4V/2yhTJEYAgrpFwmlPkIC8mAHbiYE=; b=lSAd9khYRbYAIjG5jHsQIS6yWPlKzLZGOKHBNsXOou+5vsHKMaryU9lZGQOqxfdQMw7ByS Shewa4nN3lUvOczdGAQrPIWQQXsDiLfoSpznU9OjC6V9lfaTSBO1qYB0FCncU6tcJS5AYa Cf0Pwj7EaOfcKpcSl3kUXG7vwH0AWyBr5OcOK1A2sToM7S5/W+4ziNo+kO+u5umVcY/gED TjQrQO2wkJkmcQhj2Om5Y4qjJIdLvLUFcPWhuaVpE6mfcBeM+O42x9Bslyx0IkjN6mFDw3 ufYgDhuSD758OMV8PcHF1cKx24gBFPirvcl2/Uwi1jJwIRr6LRVxJWX196Milw== From: Gregory Anders To: gdb-patches@sourceware.org Cc: Gregory Anders Subject: [PATCH v2 3/4] gdb/dap: use breakpoint fullname to resolve source Date: Fri, 1 Sep 2023 16:02:19 -0500 Message-ID: <20230901210422.58003-4-greg@gpanders.com> In-Reply-To: <20230901210422.58003-1-greg@gpanders.com> References: <20230901210422.58003-1-greg@gpanders.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,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 List-Id: If the breakpoint has a fullname, use that as the source path when resolving the breakpoint source information. This is consistent with other callers of make_source which also use "fullname" if it exists (see e.g. DAPFrameDecorator which returns the symtab's fullname). --- gdb/python/lib/gdb/dap/breakpoint.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdb/python/lib/gdb/dap/breakpoint.py b/gdb/python/lib/gdb/dap/breakpoint.py index 0ebb9597..49efff10 100644 --- a/gdb/python/lib/gdb/dap/breakpoint.py +++ b/gdb/python/lib/gdb/dap/breakpoint.py @@ -108,6 +108,9 @@ def _breakpoint_descriptor(bp): loc = bp.locations[0] if loc.source: (filename, line) = loc.source + if loc.fullname is not None: + filename = loc.fullname + result.update( { "source": make_source(filename, os.path.basename(filename)), @@ -118,9 +121,6 @@ def _breakpoint_descriptor(bp): if loc.address: result["instructionReference"] = hex(loc.address), - path = loc.fullname - if path is not None: - result["source"]["path"] = path return result -- 2.42.0