title: VSCode GDB debugging a c++ program requires root permission
body: <p>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.</p>
  <p>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.</p>
  <p>I have already tired solution specified below;<br />
  <a href="https://stackoverflow.com/questions/68701367/vscode-cmake-tools-how-can-i-attach-debugger-to-a-program-that-requires-root-p">Vscode/Cmake tools - how can I attach debugger to a program that requires root privillege?</a></p>
  <p>with following output (issue).</p>
  <pre><code>==== 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&lt;“/tmp/Microsoft-MIEngine-In-or3v3iwk.blv” 1&gt;“/tmp/Microsoft-MIEngine-Out-o2vrpakv.czu”
  You have stopped jobs.
  </code></pre>
  <p>It does not wait for identity selection but quit immediately.</p>
  <p>What should be done to debug C++ program requires sudo permission to work properly in VSCode?</p>