gdbserver: Fix crash when QTinit is handled with no inferior process attached
authorAntoine Tremblay <antoine.tremblay@ericsson.com>
Mon, 26 Jan 2015 18:08:53 +0000 (13:08 -0500)
committerAntoine Tremblay <antoine.tremblay@ericsson.com>
Tue, 10 Feb 2015 18:49:41 +0000 (13:49 -0500)
commitb05ec7a53f8a3b0cbcb2b42772ca0e70a319d2ab
tree59d02c32bbdaa17f002443a254268ac7e987a580
parent3ac240d438dceeaa5bd8ec65dafc4619b9295b09
gdbserver: Fix crash when QTinit is handled with no inferior process attached

When gdbserver is called with --multi and attach has not been called yet
and tstart is called on the gdb client, gdbserver would crash.
This patch fixes gdbserver so that it returns E01 to the gdb client.

Also this patch adds a testcase to verify this bug named no-attach-trace.exp

gdb/gdbserver/ChangeLog:
PR breakpoints/15956
* tracepoint.c (cmd_qtinit): Add check for current_thread.

gdb/testsuite/ChangeLog:
* gdb.trace/no-attach-trace.c: New file.
* gdb.trace/no-attach-trace.exp: New file.
gdb/gdbserver/ChangeLog
gdb/gdbserver/tracepoint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.trace/Makefile.in
gdb/testsuite/gdb.trace/no-attach-trace.c [new file with mode: 0644]
gdb/testsuite/gdb.trace/no-attach-trace.exp [new file with mode: 0644]