Still asking for debugger after years

Hi, guy

Sorry, since my first installing of rust, I have been always struggling with the debugger, neither gdb or lldb, works even in one of my Windows7, Fedora or openSUSE VS code.

I followed some instructions, step by step, nothing seems missing, but it just doesn't work, now I get the error after I start debugging after I installed the LLVM-5.0.0-r306282-win32.exe & python-3.5.3.exe, and VS code plugin LLDB debugger, then the VS code tells the LLDB self-test failed, and detailed message shows as below:

"(lldb) script import sys, io, lldb; print(lldb.SBDebugger.Create().GetVersionString()); print("OK")
error: your copy of LLDB does not support scripting.
An exception was raised while launching debugger: { Error: The debugger exited without completing startup handshake.
** at ChildProcess.lldb.on (C:\Users\abc.vscode\extensions\vadimcn.vscode-lldb-0.5.4\out\startup.js:166:27)**
** at emitTwo (events.js:106:13)**
** at ChildProcess.emit (events.js:191:7)**
** at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)**
** code: 'Handshake',**
** stdout: '(lldb) script import sys, io, lldb; print(lldb.SBDebugger.Create().GetVersionString()); print("OK")\r\n' }**

Here's Windows lldb compiled with Python support:

It's strange that it didn't work on Linux. Maybe the version is too old? I didn't test with anything older than lldb 4.0.

1 Like

Hi vadimcn

It's an honor to have you reply to this post.

I am downloading the exe provided by you, but the download speed seems very slow, and was always interrupted, I am still trying to get this exe, when it was done, I will let you know.

Thank you!
Very appreciated!

Now I have switched to Fedora OS, I hit F5 after cargo build succeeded, and it showed below error in the DEBUG CONSOLE:

process launch failed: 'A' packet returned an error: -1Error: Process launch failed.

And some message from the OUTPUT:

(lldb) command script import '/home/gene/.vscode/extensions/vadimcn.vscode-lldb-0.5.4/adapter'
(lldb) script adapter.main.run_tcp_session(0, )
Listening on port 39623

My LLDB version is 4.0.0, I also have python-lldb.x86_64 and rust-lldb.x86_64 installed.

The Python version is 2.7.13.

VS Code version is 1.14.2.

Rust toolchain is nightly.

gcc (GCC) 7.1.1 20170622 (Red Hat 7.1.1-3)

1 Like

Does command line LLDB work?

I tried the command line, the command "list", "breakpoint set --line 4" seems nothing wrong, but when I "run", it reported the same message: "error: process launch failed: 'A' packet returned an error: -1"

Cargo build & Cargo run is all OK.

Hmm, strange...

What does cat /proc/sys/kernel/yama/ptrace_scope output?

1 Like

Don't know about lldb or gdb, but on Windows at least the Visual Studio debugger, which now is available with VSCode, works just fine. You just have to set up the right task/launch config.

1 Like

cat /proc/sys/kernel/yama/ptrace_scope outputs 0.

I don't know much of linux, is this value OK or not?

I tried a little debugging with a single function in a single file in the Visual Studio, with the VisualRust plugin installed, it seems the debugging is close to OK, though may have some unexpected and unwanted loop by the debugger, at least it's OK to add a variable to watch. But the intelligence prompt and more other editing feature of VisualRust is not that satisfying, I will not like to use it.

"0" is good, but in that case I'm out of ideas for why LLDB is broken on your machine :confused:

It's OK, I may try some other ways out.

Thank you so much for your help!

I wasn't talking about debugging in Visual Studio, but rather debugging in VS Code. VS Code behind the scenes uses the C++ debugger available in Visual Studio. VS Code people call it the "Windows debugger" (I think). You won't need Visual Rust for this and the experience is quite good.

1 Like

same problems here, any news?

I don't know about Windows, but on Linux the IDE and visual Rust-debugger of CLion-2017.2 with Rust-Plugin works really well, just I had to purchase a license for CLion. One has got the chance to test using a 30 day license