使用 netbeans 调试由脚本加载的 C++ 动态库
Debug a C++ dynamic library loaded by a script with netbeans
我想在 netbeans 中使用 gdb 调试动态库。该库由脚本执行的程序加载。我可以使用 netbeans 中的附加功能进行调试。但我无法在开始时停止程序。有没有直接用gdb启动脚本的方法?
谢谢
在您的计算机上安装 gdbserver。
编辑您的脚本,使其运行 gdbserver localhost:port yourprogram
而不是启动您的程序
(例如 gdbserver localhost:2000 dist/Debug/GNU-Linux-x86/cppapplication_2 )
安装 gdbserver Netbeans 插件。
- 菜单工具 -> 插件
- Select 可用插件选项卡
- 搜索 gdbserver
- 运行 用于在 gdb 服务器中启动应用程序的脚本。
- 在方便的起始位置设置断点线。
- 菜单调试 -> 附加调试器
- Select gdbserver 在下拉列表中。
- 将目标设置为 "remote localhost:2000"
- 将项目设置为正确的项目。
- 点击确定。它应该连接并在您设置的断点处结束。
我想在 netbeans 中使用 gdb 调试动态库。该库由脚本执行的程序加载。我可以使用 netbeans 中的附加功能进行调试。但我无法在开始时停止程序。有没有直接用gdb启动脚本的方法?
谢谢
在您的计算机上安装 gdbserver。
编辑您的脚本,使其运行 gdbserver localhost:port yourprogram
而不是启动您的程序 (例如 gdbserver localhost:2000 dist/Debug/GNU-Linux-x86/cppapplication_2 )安装 gdbserver Netbeans 插件。
- 菜单工具 -> 插件
- Select 可用插件选项卡
- 搜索 gdbserver- 运行 用于在 gdb 服务器中启动应用程序的脚本。
- 在方便的起始位置设置断点线。
- 菜单调试 -> 附加调试器
- Select gdbserver 在下拉列表中。
- 将目标设置为 "remote localhost:2000"
- 将项目设置为正确的项目。
- 点击确定。它应该连接并在您设置的断点处结束。