为什么我从 gdbserver 获得"not in executable format: Success",但在 gdb 中一切正常?
Why do I get "not in executable format: Success" from gdbserver, but everything works fine in gdb?
尝试在linux上运行可执行文件(ubuntu 16.04(时,我可以在 gdb
下运行可执行文件:
gdb ./bazel-bin/drake/systems/sensors/rgbd_camera_test
但是,如果我尝试在gdbserver
下运行可执行文件并连接,这是一个不同的故事:
tty1$ gdbserver localhost:9999 ./bazel-bin/drake/systems/sensors/rgbd_camera_test
tty2$ gdb
(gdb) target remote localhost:9999
Remote debugging using localhost:9999
Reading ${BAZEL_ROOT}/bazel-out/clang-3.9-linux-dbg/bin/drake/systems/sensors/rgbd_camera_test from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
"target:${BAZEL_ROOT}/bazel-out/clang-3.9-linux-dbg/bin/drake/systems/sensors/rgbd_camera_test": not in executable format: Success
我使用clang-3.9
使用bazel
(0.4.5(。如果使用:
bazel run --run_under=gdb //drake/systems/sensors:rgbd_camera_test`
和 --run_under 'gdbserver localhost:9999'
。
问题是我的二进制规模太大,无法进行远程传输。我通过阅读gdb
的上述提示来意识到这一点,以在gdb
中调用set sysroot
。使用此功能,我可以使用gdbserver
进行调试。
请注意,如果您只进行本地调试,则可以将其添加到您的~/.gdbinit
中。在我的情况下,我使用gdbserver
在与Clion进行调试时(有时直接调试似乎不起作用...(
相关文章:
- 代码在main()中运行,但在函数中出现错误
- 链接阶段在Ubuntu上失败,但在MacOS上失败
- 对C宏的未定义引用,但在定义它时会出现重新定义错误
- c++17文件系统::recursive_directory迭代器()在mac上没有给出这样的目录,但在windows上
- 断言中的Fold表达式在某些计算机上编译,但在其他计算机上不编译
- 换位表导致测试失败(但在游戏中运行良好)
- 库标题在标题中不可见,但在 cmake build 下.cpp文件中完全可见.为什么?
- 树莓上的 Libtorch 无法加载 pt 文件,但在 ubuntu 上工作
- 在成员dynamic_bitset上使用 boost::from_block_range 时出错,但在本地dynamic
- 编译在我的 Mac 上工作,但在集群 (Linux) 上不起作用
- 我编写了代码将十进制分数转换为其二进制等效数.它编译得很好,但在执行时挂起
- 我的代码运行良好,但在游戏循环中中断
- C++ assigment std::list:<typename>:itrator 在 main 中工作,但在方法中它不起作用
- C++代码在台式机上工作正常,但在笔记本电脑上则不行
- 实现 DFS 在较短的输入下工作正常,但在较大的输入下会抛出分段错误
- 点云库在VS 2019中不起作用,但在VS 2017中确实有效
- GDB 断点在 Mac 上是不准确的
- 为什么我从 gdbserver 获得"not in executable format: Success",但在 gdb 中一切正常?
- C 代码在GDB Online中起作用,但在代码:块中不起作用
- 在没有优化的程序上使用gdb进行调试,但在当前上下文中仍然没有局部变量的符号