gdb/dap: use breakpoint fullname to resolve source
authorGregory Anders <greg@gpanders.com>
Fri, 1 Sep 2023 21:02:19 +0000 (16:02 -0500)
committerTom Tromey <tromey@adacore.com>
Wed, 20 Sep 2023 16:59:43 +0000 (10:59 -0600)
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).

Approved-By: Tom Tromey <tom@tromey.com>
gdb/python/lib/gdb/dap/breakpoint.py

index bf062985671299b563058b8487cf9da6214f8a39..8518814a8d2282ab0c12e335bd4ff26320e82c5d 100644 (file)
@@ -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