Still asking for debugger after years


#1

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’ }**
"


#2

Here’s Windows lldb compiled with Python support: https://github.com/vadimcn/llvm/releases/tag/r308926

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.


#3

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!


#4

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)


#5

Does command line LLDB work?


#6

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.


#7

Hmm, strange…

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


#8

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.


#9

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

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


#10

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.


#11

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


#12

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

Thank you so much for your help!


#13

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.


#14

same problems here, any news?


#15

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