2
當試圖在Linux上運行(Ubuntu的16.04)的可執行文件,我可以gdb
下運行可執行文件:但是爲什麼我從gdbserver得到「不可執行格式:成功」,但在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
我正在使用bazel
(0.4.5)和clang-3.9
。如果我使用,我會得到相同的結果:
bazel run --run_under=gdb //drake/systems/sensors:rgbd_camera_test`
和--run_under 'gdbserver localhost:9999'
。