GDB (xrefs)
Loading...
Searching...
No Matches
waitstatus.c
Go to the documentation of this file.
1/* Target waitstatus implementations.
2
3 Copyright (C) 1990-2023 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 "gdbsupport/common-defs.h"
21#include "waitstatus.h"
22
23/* See waitstatus.h. */
24
25std::string
27{
28 std::string str = string_printf
29 ("status->kind = %s", target_waitkind_str (this->kind ()));
30
31/* Make sure the compiler warns if a new TARGET_WAITKIND enumerator is added
32 but not handled here. */
33DIAGNOSTIC_PUSH
34DIAGNOSTIC_ERROR_SWITCH
35 switch (this->kind ())
36 {
39 return string_appendf (str, ", exit_status = %d", this->exit_status ());
40
43 return string_appendf (str, ", sig = %s",
44 gdb_signal_to_symbol_string (this->sig ()));
45
48 return string_appendf (str, ", child_ptid = %s",
49 this->child_ptid ().to_string ().c_str ());
50
52 return string_appendf (str, ", execd_pathname = %s",
53 this->execd_pathname ());
54
64 return str;
65 }
66DIAGNOSTIC_POP
67
68 gdb_assert_not_reached ("invalid target_waitkind value: %d",
69 (int) this->kind ());
70}
enum gdb_signal sig
Definition waitstatus.h:414
target_waitkind kind() const
Definition waitstatus.h:345
std::string to_string() const
Definition waitstatus.c:26
static const char * target_waitkind_str(target_waitkind kind)
Definition waitstatus.h:108
@ TARGET_WAITKIND_NO_RESUMED
Definition waitstatus.h:96
@ TARGET_WAITKIND_THREAD_EXITED
Definition waitstatus.h:102
@ TARGET_WAITKIND_SPURIOUS
Definition waitstatus.h:78
@ TARGET_WAITKIND_VFORK_DONE
Definition waitstatus.h:66
@ TARGET_WAITKIND_THREAD_CREATED
Definition waitstatus.h:99
@ TARGET_WAITKIND_LOADED
Definition waitstatus.h:44
@ TARGET_WAITKIND_SIGNALLED
Definition waitstatus.h:40
@ TARGET_WAITKIND_STOPPED
Definition waitstatus.h:36
@ TARGET_WAITKIND_EXITED
Definition waitstatus.h:32
@ TARGET_WAITKIND_SYSCALL_RETURN
Definition waitstatus.h:73
@ TARGET_WAITKIND_SYSCALL_ENTRY
Definition waitstatus.h:72
@ TARGET_WAITKIND_NO_HISTORY
Definition waitstatus.h:93
@ TARGET_WAITKIND_FORKED
Definition waitstatus.h:49
@ TARGET_WAITKIND_VFORKED
Definition waitstatus.h:53
@ TARGET_WAITKIND_EXECD
Definition waitstatus.h:57
@ TARGET_WAITKIND_IGNORE
Definition waitstatus.h:89