VSCODE GDB调试C++程序需要根本许可

发布于 2025-01-22 10:29:30 字数 952 浏览 0 评论 0原文

我需要在Linux上使用VSCODE和GDB调试C ++程序,并且该程序需要root权限才能正确运行。这与硬件访问有关,因此几乎不相信存在任何工作。

在这种情况下,我如何在VSCODE和GDB中调试该程序,该程序是由CMake构建的,因此CMAKE工具调试是可取的,但不是必需的。

我已经在下面指定了疲倦的解决方案;
Vscode/ CMAKE工具 - 如何将调试器附加到需要root Privillege的程序?

以下输出(问题)。

==== 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.

它不会等待身份选择,而是立即退出。

要调试C ++程序应采取什么措施,需要在VSCODE中正常工作的Sudo许可?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文