Hey All - I'd spent a bunch of time trying to get VS Code to run my C++ program remotely as root (to keep pigpio happy). So thought I'd share.
There's a bunch of different methods proposed across forums, but for C++ I highlight a solution presented by bugraaydogar back in 2017.
"Make a copy of the gdb binary and use a bash script to decorate it."
Then create a new file for gdb containing the following bash script..To create and edit the file I used nano, you're needing sudo to mess with files here.This causes anything using your gdb debugger to run as sudo - remember you've done this, be careful.
There's a bunch of different methods proposed across forums, but for C++ I highlight a solution presented by bugraaydogar back in 2017.
"Make a copy of the gdb binary and use a bash script to decorate it."
Code:
cd /usr/binsudo mv gdb gdborig
Code:
#!/bin/shsudo gdborig $@
Code:
sudo touch gdbsudo nano gdb
Statistics: Posted by kevtrousers — Sat May 04, 2024 4:22 am