- You can successfully build this project from source.
- Install LLDB and the LLDB Extension.
- Open the root folder in VSCode. Press CtrlShiftD and here you can access the preconfigured debug setups.
- All debug configurations open a new
[Extension Development Host]
VSCode instance where only the Zeek extension being debugged is enabled. - To activate the extension you need to open any Zeek script file
(
.zeek/.bro
) in[Extension Development Host]
.
Run Extension (Debug Build)
- runs extension with the locally built LSP server (target/debug/zeek-language-server
).
TypeScript debugging is configured to watch your source edits and recompile. To
apply changes to an already running debug process, press
CtrlShiftP and run the following command in
your [Extension Development Host]
> Developer: Reload Window
-
When attaching a debugger to an already running
zeek-language-server
server on Linux you might need to enableptrace
for unrelated processes by running:echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
-
By default, the LSP server is built without debug information. To enable it, you'll need to change
Cargo.toml
:[profile.dev] debug = 2
-
Select
Run Extension (Debug Build)
to run your locally builttarget/debug/zeek-language-server
. -
In the original VSCode window once again select the
Attach To Server
debug configuration. -
A list of running processes should appear. Select the
zeek-language-server
from this repo. -
Navigate to
src/lsp.rs
and add a breakpoint to thehover
function. -
Go back to the
[Extension Development Host]
instance and hover over a Zeek variable and your breakpoint should hit.
It could be a case of just jumping the gun.
The zeek-language-server
is only started once the onLanguage:zeek
activation.
Make sure you open a Zeek script file in the [Extension Development Host]
and
try again.
Make sure you have run echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
.
By default this should reset back to 1 every time you log in.
Check your version of lldb
. If it's version 6 and lower, use the classic
adapter type. It's lldb.adapterType
in settings file.
If you're running lldb
version 7, change the lldb adapter type to bundled
or native
.