OSDN Git Service

Enable to track git://github.com/monaka/binutils.git
[pf3gnuchains/pf3gnuchains3x.git] / rda / lib / gdbserv-state.h
1 /* gdbserv-state.h
2
3    Copyright 1998, 2000, 2001, 2002 Red Hat, Inc.
4
5    This file is part of RDA, the Red Hat Debug Agent (and library).
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 2 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, write to the Free Software
19    Foundation, Inc., 59 Temple Place - Suite 330,
20    Boston, MA 02111-1307, USA.
21    
22    Alternative licenses for RDA may be arranged by contacting Red Hat,
23    Inc.  */
24
25 /* GDBSERV internal data structures.  */
26
27 /* Clients/targets SHOULD NOT include this file!!!! */
28
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #include "gdbserv-input.h"
35 #include "gdbserv-output.h"
36 #include "gdbserv-client.h"
37 #include "gdbserv-target.h"
38
39 /* The server's current state. */
40
41 enum gdbserv_state {
42   GDBSERV_STATE_UNINITIALIZED = 0,
43   GDBSERV_STATE_RESETTING,
44   GDBSERV_STATE_RUNNING,
45   GDBSERV_STATE_BROKEN,
46   GDBSERV_STATE_EXITING,
47   GDBSERV_STATE_EXITED,
48 };
49
50 struct gdbserv {
51
52   struct gdbserv_input input;
53   struct gdbserv_output output;
54   struct gdbserv_target *target;
55   struct gdbserv_client *client;
56
57   /* Several GDBSERV objects for a stack of targets (well,
58      technically, they right now form a cycle).  These links take you
59      closer TO and further FROM the target. */
60   struct gdbserv *to;
61   struct gdbserv *from;
62
63   enum gdbserv_state state;
64
65   /* The thread (and signal) that were supplied by the target for the
66      event that triggered the stop. */
67   struct gdbserv_thread *event_thread;
68   int event_sigval;
69
70   /* The thread for examining current state. */
71   struct gdbserv_thread *general_thread;
72
73   /* The thread to resume.  If NULL, the entire system is resumed. */
74   struct gdbserv_thread *continue_thread;
75
76   /* Selected thread for thread query. */
77   struct gdbserv_thread *query_thread;
78
79   /* argv */
80   char **program_argv;
81   unsigned long program_argc;
82   unsigned long last_arg_len;
83   unsigned long last_arg_num;
84   
85 };
86
87
88 /* Present an unpacked packet to the gdbserv state machine */
89 void gdbserv_data_packet (struct gdbserv *gdbserv);
90
91 #ifdef __cplusplus
92 }
93 #endif