10 Commits

Author SHA1 Message Date
Ely Ronnen
8630c22083
[lldb-dap] migrate set breakpoint requests (#137448)
- Migrate set breakpoint requests to use typed RequestHandler
  - `SetBreakpointsRequestHandler`
  - `SetDataBreakpointsRequestHandler`
  - `SetFunctionBreakpointsRequestHandler`
  - `SetInstructionBreakpointsRequestHandler`
  - `DataBreakpointInfoRequestHandler`
- Decouple JSON from lldb-dap `Breakpoint` classes
2025-05-10 00:05:59 +02:00
Jonas Devlieghere
46457ed1df
[lldb] Convert Breakpoint & Watchpoints structs to classes (NFC) (#133780)
Convert Breakpoint & Watchpoints structs to classes to provide proper
access control. This is in preparation for adopting SBMutex to protect
the underlying SBBreakpoint and SBWatchpoint.
2025-03-31 16:04:31 -07:00
Jonas Devlieghere
0bdc9e6d08
[lldb-dap] Replace GetBreakpointLabel with kDAPBreakpointLabel constant (NFC) (#133746)
Replace GetBreakpointLabel with kDAPBreakpointLabel constant to avoid an
unnecessary function call.
2025-03-31 11:46:23 -07:00
Ebuka Ezike
217fc6579b
[lldb][lldb-dap] Return optional from json utils (#129919)
Completion of #129818 

Did not want to put `llvm::StringRef()` as the default value instead it
was `""`
2025-03-14 10:17:18 -07:00
John Harrison
b99d411258
[lldb-dap] Refactoring breakpoints to not use the g_dap reference. (#115208)
Refactoring breakpoints to not use the `g_dap` reference.

Instead, when a breakpoint is constructed it will be passed a DAP
reference that it should use for its lifetime.

This is part of a larger refactor to remove the global `g_dap` variable
to allow us to create multiple DAP instances.

---------

Co-authored-by: Pavel Labath <pavel@labath.sk>
2024-11-08 13:36:25 -08:00
Adrian Vogelsgesang
09c258ef6a
[NFC][lldb-dap] Clean-up includes (#113839)
This commit cleans up the includes in the `lldb-dap` subfolder. The main
motivation was that I got annoyed by `clangd` always complaining about
unused includes while working on lldb-dap.
2024-10-28 11:01:57 +01:00
Zequan Wu
d58c128bc4
[lldb-dap][NFC] Add Breakpoint struct to share common logic. (#80753)
This adds a layer between `SounceBreakpoint`/`FunctionBreakpoint` and
`BreakpointBase` to have better separation and encapsulation so we are
not directly operating on `SBBreakpoint`.

I basically moved the `SBBreakpoint` and the methods that requires it
from `BreakpointBase` to `Breakpoint`. This allows adding support for
data watchpoint easier by sharing the logic inside `BreakpointBase`.
2024-02-13 11:38:02 -05:00
Walter Erquinigo
ffd173ba0b
[lldb-dap] Emit more structured info along with variables (#75244)
In order to allow smarter vscode extensions, it's useful to send
additional structured information of SBValues to the client.
Specifically, I'm now sending error, summary, autoSummary and
inMemoryValue in addition to the existing properties being sent. This is
cheap because these properties have to be calculated anyway to generate
the display value of the variable, but they are now available for
extensions to better analyze variables. For example, if the error field
is not present, the extension might be able to provide cool features,
and the current way to do that is to look for the `"<error: "` prefix,
which is error-prone.

This also incorporates a tiny feedback from
https://github.com/llvm/llvm-project/pull/74865#issuecomment-1850695477
2024-01-02 13:06:13 -05:00
jeffreytan81
f175b9647c
Improve VSCode DAP logpoint value summary (#71723)
Currently VSCode logpoint uses `SBValue::GetValue` to get the value for
printing. This is not providing an intuitive result for std::string or
char * -- it shows the pointer value instead of the string content.

This patch improves by prefers `SBValue::GetSummary()` before using
`SBValue::GetValue()`.

---------

Co-authored-by: jeffreytan81 <jeffreytan@fb.com>
2023-11-08 16:48:55 -08:00
Jonas Devlieghere
01263c6c6f
[lldb] Rename lldb-vscode to lldb-dap (#69264)
Rename lldb-vscode to lldb-dap. This change is largely mechanical. The
following substitutions cover the majority of the changes in this
commit:

  s/VSCODE/DAP/
  s/VSCode/DAP/
  s/vscode/dap/
  s/g_vsc/g_dap/

Discourse RFC:
https://discourse.llvm.org/t/rfc-rename-lldb-vscode-to-lldb-dap/74075/
2023-10-19 09:48:54 -07:00