8 Commits

Author SHA1 Message Date
Ebuka Ezike
0b8a656ba1
[lldb-dap] Fix source references (#144364)
The
[protocol](https://microsoft.github.io/debug-adapter-protocol//specification.html#Types_Source)
expects that `sourceReference` be less than `(2^31)-1`, but we currently
represent memory address as source reference, this can be truncated
either when sending through json or by the client. Instead, generate new
source references based on the memory address.

Make the `ResolveSource` function return an optional source.
2025-06-26 18:22:47 +01:00
Ely Ronnen
22dfe9cb58
[lldb-dap] Reuse source object logics (#141426)
Refactor code revolving source objects such that most logics will be
reused.

The main change is to expose a single `CreateSource(addr, target)` that
can return either a normal or an assembly source object, and call
`ShouldDisplayAssemblySource()` only from this function instead of
multiple places across the code.

Other functions can use `source.IsAssemblySource()` in order to check
which type the source is.
2025-05-31 08:47:18 +02:00
Ely Ronnen
290ba281e8
[lldb-dap] Show assembly depending on stop-disassembly-display settings (#136494)
Show assembly code when the source code for a frame is not available in
the debugger machine

Edit: this functionality will work only when using
`stop-disassembly-display = no-source` in the settings

Fix #136492

After the fix:

[Screencast From 2025-04-20
18-00-30.webm](https://github.com/user-attachments/assets/1ce41715-cf4f-42a1-8f5c-6196b9d685dc)
2025-04-25 14:35:20 -07:00
Jonas Devlieghere
262158b8aa
[lldb-dap] Support StackFrameFormat (#137113)
The debug adapter protocol supports an option to provide formatting
information for a stack frames as part of the StackTrace request.
lldb-dap incorrectly advertises it supports this, but until this PR that
support wasn't actually implemented.

Fixes #137057
2025-04-24 16:25:31 -07:00
John Harrison
bc6cd825ec
[lldb-dap] Creating a common configuration structure for launch and attach requests. (#133960)
This moves all the common settings of the launch and attach operations
into the `lldb_dap::protocol::Configuration`. These common settings
can be in both `launch` and `attach` requests and allows us to isolate
the DAP configuration operations into a single common location.

This is split out from #133624.
2025-04-03 09:45:00 -07:00
Jonas Devlieghere
b53e75711c
[lldb-dap] Replace Get{Signed,Unsigned} with GetInteger<T> (NFC) (#129823)
Replace Get{Signed,Unsigned} with GetInteger<T> and return std::optional
so you can distinguish between the value not being present and it being
explicitly set to the previous fail_value. All existing uses are
replaced by calling value_or(fail_value).

Continuation of #129818
2025-03-05 09:06:14 -08:00
Jonas Devlieghere
911e94c651
[lldb-dap] Finish refactoring the request handlers (NFC) (#128553)
Completes the work started in #128262. This PR removes the
old way of register request handlers with callbacks and makes
the operator const.
2025-02-24 16:46:12 -06:00
Jonas Devlieghere
38d7cf1a81
[lldb-dap] Refactor remaining request handlers (NFC)Remaining request handlers (#128551)
Continuation of the work started in #128262. Builds on top of #128550.
2025-02-24 15:56:13 -06:00