GDB (xrefs)
waitstatus.c
Go to the documentation of this file.
1 /* Target waitstatus implementations.
2 
3  Copyright (C) 1990-2015 Free Software Foundation, Inc.
4 
5  This file is part of GDB.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 #include "common-defs.h"
21 #include "waitstatus.h"
22 
23 /* Return a pretty printed form of target_waitstatus.
24  Space for the result is malloc'd, caller must free. */
25 
26 char *
28 {
29  const char *kind_str = "status->kind = ";
30 
31  switch (ws->kind)
32  {
34  return xstrprintf ("%sexited, status = %d",
35  kind_str, ws->value.integer);
37  return xstrprintf ("%sstopped, signal = %s",
38  kind_str,
41  return xstrprintf ("%ssignalled, signal = %s",
42  kind_str,
45  return xstrprintf ("%sloaded", kind_str);
47  return xstrprintf ("%sforked", kind_str);
49  return xstrprintf ("%svforked", kind_str);
51  return xstrprintf ("%sexecd", kind_str);
53  return xstrprintf ("%svfork-done", kind_str);
55  return xstrprintf ("%sentered syscall", kind_str);
57  return xstrprintf ("%sexited syscall", kind_str);
59  return xstrprintf ("%sspurious", kind_str);
61  return xstrprintf ("%signore", kind_str);
63  return xstrprintf ("%sno-history", kind_str);
65  return xstrprintf ("%sno-resumed", kind_str);
66  default:
67  return xstrprintf ("%sunknown???", kind_str);
68  }
69 }
char * target_waitstatus_to_string(const struct target_waitstatus *ws)
Definition: waitstatus.c:27
enum gdb_signal sig
Definition: waitstatus.h:108
union target_waitstatus::@161 value
char * xstrprintf(const char *format,...)
Definition: common-utils.c:107
enum target_waitkind kind
Definition: waitstatus.h:100
const char * gdb_signal_to_symbol_string(enum gdb_signal sig)
Definition: signals.c:59