public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Gregory Anders <greg@gpanders.com>
To: gdb-patches@sourceware.org
Cc: Gregory Anders <greg@gpanders.com>
Subject: [PATCH v2 3/4] gdb/dap: use breakpoint fullname to resolve source
Date: Fri,  1 Sep 2023 16:02:19 -0500	[thread overview]
Message-ID: <20230901210422.58003-4-greg@gpanders.com> (raw)
In-Reply-To: <20230901210422.58003-1-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


  parent reply	other threads:[~2023-09-01 21:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01 21:02 [PATCH v2 0/4] DAP fixups Gregory Anders
2023-09-01 21:02 ` [PATCH v2 1/4] gdb/dap: check for breakpoint source before unpacking Gregory Anders
2023-09-01 21:02 ` [PATCH v2 2/4] gdb/dap: ignore unused keyword args in step_out Gregory Anders
2023-09-01 21:02 ` Gregory Anders [this message]
2023-09-01 21:02 ` [PATCH v2 4/4] gdb/dap: only include sourceReference if file path does not exist Gregory Anders
2023-09-20 17:40 ` [PATCH v2 0/4] DAP fixups Tom Tromey

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=20230901210422.58003-4-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).