如何调试远程Linux二进制文件? [英] How to debug a remote linux binary?
问题描述
这是情况:
我有一个正在崩溃的linux二进制文件。没有日志文件,跟踪文件等。我需要能够附加一个调试器(我本地有源代码)并追踪错误。
什么是最简单,最好的方法来解决这个问题?
远程调试相当简单:在目标平台上,使用GDBserver ,同时指定主机和端口以侦听传入的TCP连接:
gdbserver HOST:PORT PROG [ARGS ...]
在开发工作站上,启动跨目标GDB:
powerpc-7450-linux-gnu-gdb PROG
务必指定不可剥离的可执行文件。在GDB控制台上键入:
目标远程主机:PORT
break主要
继续
Here is the situation:
I've got a linux binary that is crashing. No log files, trace files, etc. I need to be able to attach a debugger to it (I have the source locally) and track down the error.
Whats the easiest, best way to approach this problem?
Remote debugging is rather straightforward: on the target platform, launch the application with GDBserver, while specifying the host and port for listening to an incoming TCP connection:
gdbserver HOST:PORT PROG [ARGS ...]
On the development workstation, launch the cross-target GDB:
powerpc-7450-linux-gnu-gdb PROG
Be sure to specify the non-stripped executable. At the GDB console, type:
target remote HOST:PORT
break main
continue
Remote cross-target debugging with GDB and GDBserver
这篇关于如何调试远程Linux二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!