Attaching debugger to a process

414 views
Skip to first unread message

Rahul Bansal

unread,
Apr 8, 2021, 4:43:53 AM4/8/21
to CodeLLDB Users
Hi,

I am using visual studio code to develop a rust project. 

The source code is present on an Ubuntu Machine.
I am using Visual Studio Code Remote Development to build and debug the project from my Windows Machine.

When I try to debug the code I get the following error.

sccache_not_root_error.jpg

I tried putting the sudo:"true" in the conf file but the error is still occurring.

sudo_true.jpg

I tried an alternative approach by running the executable in the terminal and attaching the debugger to the process.

I used the below command in the terminal to run the process.

SCCACHE_NO_DAEMON=1 SCCACHE_START_SERVER=1 SCCACHE_LOG=trace sudo ./target/debug/sccache-dist server --config ~/server.config  --syslog trace

running_as_sudo.jpg

The output of ps aux is

grep_sccache.jpg

When I try to attach the debugger the running process. Here is the screenshot of the configuration to attach the debugger to a running process.

attach_debugger_to_pid.jpg

I get the following error. I have tried both the PIDs mentioned in the ps aux output but the error remains the same.

operation_not_permitted.jpg

Do you have any idea about attaching the debugger to a remote process 
or running the debugger as sudo on a remote machine via VS code?

Thanks for your time

Rahul

Vadim

unread,
Apr 12, 2021, 8:10:50 PM4/12/21
to CodeLLDB Users
You can try remote debugging (as LLDB defines it).  Launch lldb-server as root, it will be able to debug root processes.
Reply all
Reply to author
Forward
0 new messages