How to debug a remote Linux binary?

Here is the situation:

I have a linux binary file that breaks. No log files, trace files, etc. I need to be able to connect a debugger to it (I have a source locally) and track the error.

What is the easiest and most effective way to solve this problem?

+3
source share
2 answers

Remote debugging is quite simple: on the target platform, launch the application using GDBserver, specifying the host and port to listen for the incoming TCP connection:

  gdbserver HOST:PORT PROG [ARGS ...]

On the development workstation, start the GDB gateway:

  powerpc-7450-linux-gnu-gdb PROG

Be sure to specify an unused executable. In the GDB console, type:

  target remote HOST:PORT
  break main
  continue

- GDB GDBserver

+6

, gdb .

, http://davis.lbl.gov/Manuals/GDB/gdb_17.html .

gdbserver , gdb ( TCP ) gdbserver.

0

Source: https://habr.com/ru/post/1704720/


All Articles