'VSCode GDB debugging a c++ program requires root permission
I need to debug a c++ program with VSCode and GDB on Linux and the program requires root permission in order to run properly. This is related with hardware access and therefore hardly believe any work around exist.
In this circumstances, how could I debug the program in VSCode and GDB, the program is built by CMake, and therefore CMake Tools debug is preferable but not required.
I have already tired solution specified below;
Vscode/Cmake tools - how can I attach debugger to a program that requires root privillege?
with following output (issue).
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/bin/gdb’ as the super user
Multiple identities can be used for authentication:
1. Ubuntu (ubuntu)
2. myuser,,, (myuser)
Choose identity to authenticate as (1-2): [1] + Stopped (tty input) “/home/myuser/gdb” --interpreter=mi --tty=${DbgTerm} 0<“/tmp/Microsoft-MIEngine-In-or3v3iwk.blv” 1>“/tmp/Microsoft-MIEngine-Out-o2vrpakv.czu”
You have stopped jobs.
It does not wait for identity selection but quit immediately.
What should be done to debug C++ program requires sudo permission to work properly in VSCode?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
