]> git.wh0rd.org - patches.git/blob - gdbserver-check-initial-startup.patch
initial import
[patches.git] / gdbserver-check-initial-startup.patch
1 2007-09-21 Mike Frysinger <vapier@gentoo.org>
2
3 * server.c (main): Check status after start_inferior.
4
5 Index: server.c
6 ===================================================================
7 RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
8 retrieving revision 1.56
9 diff -u -p -r1.56 server.c
10 --- server.c 23 Aug 2007 18:08:48 -0000 1.56
11 +++ server.c 22 Sep 2007 02:30:10 -0000
12 @@ -900,9 +900,14 @@ main (int argc, char *argv[])
13 /* Wait till we are at first instruction in program. */
14 signal = start_inferior (&argv[2], &status);
15
16 + if (status == 'W' || status == 'X')
17 + {
18 + fprintf (stderr, "Aborting server; child exited with %i\n", signal);
19 + exit (signal);
20 + }
21 +
22 /* We are now (hopefully) stopped at the first instruction of
23 - the target process. This assumes that the target process was
24 - successfully created. */
25 + the target process. */
26
27 /* Don't report shared library events on the initial connection,
28 even if some libraries are preloaded. */