From: Gregory Anders <greg@gpanders.com>
To: gdb-patches@sourceware.org
Cc: Gregory Anders <greg@gpanders.com>
Subject: [PATCH 3/4] gdb/dap: use breakpoint fullname to resolve source
Date: Fri, 1 Sep 2023 12:55:39 -0500 [thread overview]
Message-ID: <20230901180323.22328-9-greg@gpanders.com> (raw)
In-Reply-To: <20230901180323.22328-3-greg@gpanders.com>
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
next prev parent reply other threads:[~2023-09-01 18:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 17:55 [PATCH 0/4] DAP fixups Gregory Anders
2023-09-01 17:55 ` [PATCH 1/4] gdb/dap: check for breakpoint source before unpacking Gregory Anders
2023-09-01 19:05 ` Tom Tromey
2023-09-01 19:18 ` Gregory Anders
2023-09-01 17:55 ` [PATCH 2/4] gdb/dap: ignore unused keyword args in step_out Gregory Anders
2023-09-01 19:07 ` Tom Tromey
2023-09-05 14:12 ` Gregory Anders
2023-09-01 17:55 ` Gregory Anders [this message]
2023-09-01 19:08 ` [PATCH 3/4] gdb/dap: use breakpoint fullname to resolve source Tom Tromey
2023-09-05 14:08 ` Gregory Anders
2023-09-01 17:55 ` [PATCH 4/4] gdb/dap: only include sourceReference if file path does not exist Gregory Anders
2023-09-01 19:42 ` Tom Tromey
2023-09-01 21:42 ` Gregory Anders
2023-09-01 21:56 ` Gregory Anders
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230901180323.22328-9-greg@gpanders.com \
--to=greg@gpanders.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).