0

With gdb I would write a .gdbinit file with the following contents:

break file1.c:32
catch syscall write
# more setup commands
run

This would make gdb run the program and stop at those breakpoints.

How can I do the same with gdbserver? Eg: Stop for accepting connections only when the breakpoint is hit?

Thiago Padilha
  • 4,590
  • 5
  • 44
  • 69
  • Don't you have to connect to gdbserver to install the breakpoint in the first place? – pat Mar 27 '14 at 21:28
  • It seems so. I'm looking for an alternative that lets me set the breakpoints non-interactively in gdbserver. Something close to a `.gdbserverinit` – Thiago Padilha Mar 27 '14 at 22:37
  • 1
    That's not possible. The gdbserver is pretty dumb. It does not have access to the debug info, so it won't know the address of `file1.c:32`. You need gdb-proper to read the debug info, and send the low-level commands to the server. – pat Mar 27 '14 at 23:36
  • I wonder if there's an alternate implementation that's smart enough to do what I want – Thiago Padilha Mar 28 '14 at 13:17

0 Answers0