vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.49k stars 237 forks source link

【debugger startup problems】codelldb: Syntax error: word unexpected (expecting ")") #314

Closed ctaoist closed 4 years ago

ctaoist commented 4 years ago

OS: Linux 4.15.0 VSCode version: 1.45.1 code server version: 3.3.1 Extension version: 1.5.0

Problem: When start a debugger for rust bin, the vsocde outputs:

Running `cargo build --bin=hello --package=hello --message-format=json`...
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
Raw artifacts:
{
  fileName: '~/projects/rust/target/debug/hello',
  name: 'hello',
  kind: 'bin'
}
Filtered artifacts: 
{
  fileName: '~/projects/rust/target/debug/hello',
  name: 'hello',
  kind: 'bin'
}
configuration: {
  type: 'lldb',
  request: 'launch',
  name: "Debug executable 'hello'",
  args: [],
  cwd: '${workspaceFolder}',
  relativePathBase: '~/projects/rust',
  program: '~/projects/rust/target/debug/hello',
  sourceLanguages: [ 'rust' ]
}
~/.local/share/code-server/extensions/vadimcn.vscode-lldb-1.5.0/adapter2/codelldb: 2: ~/.local/share/code-server/extensions/vadimcn.vscode-lldb-1.5.0/adapter2/codelldb: Syntax error: word unexpected (expecting ")")
Error: The debugger exited without completing startup handshake.
vadimcn commented 4 years ago

This looks as if a shell was invoked to execute the codelldb binary.
Since you mentioned code server, I assume you are using VSCode remoting? What OS and CPU architecture is the remote machine?

ctaoist commented 4 years ago

@vadimcn code server: https://github.com/cdr/code-server My code-server is installed by cdr's docker image.

uname -a, OS:

Linux e0aa9451c2ef 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64 GNU/Linux

lscpu, cpu:

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
Address sizes:       40 bits physical, 48 bits virtual
CPU(s):              16
On-line CPU(s) list: 0-15
Thread(s) per core:  2
Core(s) per socket:  4
Socket(s):           2
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               44
Model name:          Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
Stepping:            2
CPU MHz:             1595.462
BogoMIPS:            4788.16
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            12288K
NUMA node0 CPU(s):   0,2,4,6,8,10,12,14
NUMA node1 CPU(s):   1,3,5,7,9,11,13,15
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 popcnt aes lahf_lm pti tpr_shadow vnmi flexpriority ept vpid dtherm ida arat

And I cd to ~/.local/share/code-server/extensions/vadimcn.vscode-lldb-1.5.0/adapter and execute the codelldb binary manually, then bash shell outputs:

bash: ./codelldb: cannot execute binary file: Exec format error
ocornoc commented 4 years ago

I'm seeing this issue too (as well as the cannot execute binary etc.), both on 1.5.0 and 1.5.2. Also on code-server.

vadimcn commented 4 years ago

I've reproduced this with the docker image. Looks like they cached the wrong version of the extension package - the arm64 one.
I recommend that you download the package from MS Marketplace and "Install from VSIX".

ocornoc commented 4 years ago

That worked for me! Thanks!

ctaoist commented 4 years ago

That works well! Thanks extremely!