gdb/dap: use breakpoint fullname to resolve source

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>
This commit is contained in:
Gregory Anders
2023-09-01 16:02:19 -05:00
committed by Tom Tromey
parent d2266b2305
commit 61830fcb31

View File

@ -108,6 +108,9 @@ def _breakpoint_descriptor(bp):
loc = bp.locations[0] loc = bp.locations[0]
if loc.source: if loc.source:
(filename, line) = loc.source (filename, line) = loc.source
if loc.fullname is not None:
filename = loc.fullname
result.update( result.update(
{ {
"source": make_source(filename, os.path.basename(filename)), "source": make_source(filename, os.path.basename(filename)),
@ -118,9 +121,6 @@ def _breakpoint_descriptor(bp):
if loc.address: if loc.address:
result["instructionReference"] = hex(loc.address), result["instructionReference"] = hex(loc.address),
path = loc.fullname
if path is not None:
result["source"]["path"] = path
return result return result