Allow integer immediate for VFP vmov instructions.
[deliverable/binutils-gdb.git] / gdb / thread-fsm.c
CommitLineData
243a9253 1/* Thread command's finish-state machine, for GDB, the GNU debugger.
e2882c85 2 Copyright (C) 2015-2018 Free Software Foundation, Inc.
243a9253
PA
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19#include "defs.h"
20#include "thread-fsm.h"
21
22/* See thread-fsm.h. */
23
24void
8980e177
PA
25thread_fsm_ctor (struct thread_fsm *self, struct thread_fsm_ops *ops,
26 struct interp *cmd_interp)
243a9253 27{
8980e177 28 self->command_interp = cmd_interp;
243a9253
PA
29 self->finished = 0;
30 self->ops = ops;
31}
32
33/* See thread-fsm.h. */
34
35void
36thread_fsm_delete (struct thread_fsm *self)
37{
38 if (self != NULL)
39 {
40 if (self->ops->dtor != NULL)
41 self->ops->dtor (self);
42 xfree (self);
43 }
44}
45
46/* See thread-fsm.h. */
47
48void
8980e177 49thread_fsm_clean_up (struct thread_fsm *self, struct thread_info *thread)
243a9253
PA
50{
51 if (self->ops->clean_up != NULL)
8980e177 52 self->ops->clean_up (self, thread);
243a9253
PA
53}
54
55/* See thread-fsm.h. */
56
57int
8980e177 58thread_fsm_should_stop (struct thread_fsm *self, struct thread_info *thread)
243a9253 59{
8980e177 60 return self->ops->should_stop (self, thread);
243a9253
PA
61}
62
63/* See thread-fsm.h. */
64
65struct return_value_info *
66thread_fsm_return_value (struct thread_fsm *self)
67{
68 if (self->ops->return_value != NULL)
69 return self->ops->return_value (self);
70 return NULL;
71}
72
73/* See thread-fsm.h. */
74
75void
76thread_fsm_set_finished (struct thread_fsm *self)
77{
78 self->finished = 1;
79}
80
81/* See thread-fsm.h. */
82
83int
84thread_fsm_finished_p (struct thread_fsm *self)
85{
86 return self->finished;
87}
88
89/* See thread-fsm.h. */
90
91enum async_reply_reason
92thread_fsm_async_reply_reason (struct thread_fsm *self)
93{
94 /* If we didn't finish, then the stop reason must come from
95 elsewhere. E.g., a breakpoint hit or a signal intercepted. */
96 gdb_assert (thread_fsm_finished_p (self));
97
98 return self->ops->async_reply_reason (self);
99}
388a7084
PA
100
101/* See thread-fsm.h. */
102
103int
104thread_fsm_should_notify_stop (struct thread_fsm *self)
105{
106 if (self->ops->should_notify_stop != NULL)
107 return self->ops->should_notify_stop (self);
108 return 1;
109}
This page took 0.312732 seconds and 4 git commands to generate.