Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
target_rpc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, 2013, 2014 The University of Utah
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef __TARGET_RPC_H__
20 #define __TARGET_RPC_H__
21 
22 #include "target_rpc_moduleStub.h"
23 #include "debuginfo_rpc_moduleStub.h"
24 #include "debuginfo_xml.h"
25 
26 #include "dwdebug.h"
27 #include "target_api.h"
28 #include "target_event.h"
29 #include <glib.h>
30 #include <pthread.h>
31 
32 /*
33  * Targets as XML SOAP server-monitored objects.
34  */
35 #define MONITOR_OBJTYPE_TARGET 0x08
37 
38 #define MONITORED_TARGET_LAUNCHER "/home/johnsond/git/a3/vmi.obj/xml/service/monitored_target"
39 
40 /*
41  * Module init stuff.
42  */
43 void target_rpc_init(void);
44 void target_rpc_fini(void);
45 
46 /*
47  * Handle a new request. Frees/queues the soap struct as necessary; the
48  * caller must not free it!
49  */
50 int target_rpc_handle_request(struct soap *soap);
51 
52 void target_rpc_insert(int target_id,struct target *target);
53 
54 /*
55  * Get a target by ID. Locks/unlocks the target_rpc master mutex.
56  */
57 struct target *target_lookup(int id);
58 
59 int vmi1__ListTargetTypes(struct soap *soap,
60  void *_,
61  struct vmi1__TargetTypesResponse *r);
62 
63 //gsoap vmi1 service method-documentation:
64 int vmi1__ListTargets(struct soap *soap,
65  void *_,
66  struct vmi1__TargetsResponse *r);
67 
68 int vmi1__GetTarget(struct soap *soap,
69  vmi1__TargetIdT tid,
70  struct vmi1__TargetResponse *r);
71 
72 int vmi1__GetTargetLogs(struct soap *soap,
73  vmi1__TargetIdT tid,int maxSize,
74  struct vmi1__TargetLogsResponse *r);
75 
76 int vmi1__InstantiateTarget(struct soap *soap,
77  struct vmi1__TargetSpecT *spec,
78  vmi1__ListenerT *ownerListener,
79  struct vmi1__TargetResponse *r);
80 
81 int vmi1__InstantiateOverlayTarget(struct soap *soap,
82  vmi1__TargetIdT tid,
83  vmi1__ThreadIdT thid,
84  struct vmi1__TargetSpecT *spec,
85  vmi1__ListenerT *ownerListener,
86  struct vmi1__TargetResponse *r);
87 
88 int vmi1__PauseTarget(struct soap *soap,
89  vmi1__TargetIdT tid,
90  struct vmi1__NoneResponse *r);
91 int vmi1__ResumeTarget(struct soap *soap,
92  vmi1__TargetIdT tid,
93  struct vmi1__NoneResponse *r);
94 int vmi1__CloseTarget(struct soap *soap,
95  vmi1__TargetIdT tid,
96  struct vmi1__NoneResponse *r);
97 int vmi1__KillTarget(struct soap *soap,
98  vmi1__TargetIdT tid,int kill_sig,
99  struct vmi1__NoneResponse *r);
100 int vmi1__FinalizeTarget(struct soap *soap,
101  vmi1__TargetIdT tid,
102  struct vmi1__NoneResponse *r);
103 
104 int vmi1__PauseThread(struct soap *soap,
105  vmi1__TargetIdT tid,vmi1__ThreadIdT thid,
106  struct vmi1__NoneResponse *r);
107 /*
108  * Resuming a single thread is not yet supported.
109  */
110 /*
111 int vmi1__ResumeThread(struct soap *soap,
112  vmi1__TargetIdT tid,vmi1__ThreadIdT thid,
113  struct vmi1__NoneResponse *r);
114 */
115 
116 /*
117  * Single stepping a single thread (without having hit a probepoint) is
118  * not supported by the target library. Not sure if it ever will be.
119  */
120 /*
121 int vmi1__SinglestepThread(struct soap *soap,
122  vmi1__TargetIdT tid,vmi1__ThreadIdT thid,int steps,
123  struct vmi1__NoneResponse *r);
124 */
125 
126 int vmi1__LookupTargetSymbol(struct soap *soap,
127  vmi1__TargetIdT tid,char *name,
128  struct vmi1__DebugFileOptsT *opts,
129  struct vmi1__NestedSymbolResponse *r);
130 int vmi1__LookupTargetAddrSimple(struct soap *soap,
131  vmi1__TargetIdT tid,vmi1__ADDR addr,
132  struct vmi1__DebugFileOptsT *opts,
133  struct vmi1__SymbolResponse *r);
134 int vmi1__LookupTargetAddr(struct soap *soap,
135  vmi1__TargetIdT tid,vmi1__ADDR addr,
136  struct vmi1__DebugFileOptsT *opts,
137  struct vmi1__NestedSymbolResponse *r);
138 int vmi1__LookupTargetAllSymbols(struct soap *soap,
139  vmi1__TargetIdT tid,char *name,
140  struct vmi1__DebugFileOptsT *opts,
141  struct vmi1__NestedSymbolResponse *r);
142 
143 int vmi1__ProbeSymbolSimple(struct soap *soap,
144  vmi1__TargetIdT tid,vmi1__ThreadIdT thid,
145  char *probeName,char *symbol,
146  struct vmi1__ProbeResponse *r);
147 int vmi1__ProbeSymbol(struct soap *soap,
148  vmi1__TargetIdT tid,vmi1__ThreadIdT thid,
149  char *probeName,char *symbol,
150  vmi1__ProbepointStyleT *probepointStyle,
151  vmi1__ProbepointWhenceT *probepointWhence,
152  vmi1__ProbepointSizeT *probepointSize,
153  struct vmi1__ProbeResponse *r);
154 int vmi1__ProbeAddr(struct soap *soap,
155  vmi1__TargetIdT tid,vmi1__ThreadIdT thid,
156  char *probeName,vmi1__ADDR addr,
157  vmi1__ProbepointTypeT *probepointType,
158  vmi1__ProbepointStyleT *probepointStyle,
159  vmi1__ProbepointWhenceT *probepointWhence,
160  vmi1__ProbepointSizeT *probepointSize,
161  struct vmi1__ProbeResponse *r);
162 int vmi1__ProbeLine(struct soap *soap,
163  vmi1__TargetIdT tid,vmi1__ThreadIdT thid,
164  char *probeName,char *filename,int line,
165  vmi1__ProbepointStyleT *probepointStyle,
166  vmi1__ProbepointWhenceT *probepointWhence,
167  vmi1__ProbepointSizeT *probepointSize,
168  struct vmi1__ProbeResponse *r);
169 int vmi1__EnableProbe(struct soap *soap,
170  vmi1__TargetIdT tid,vmi1__ProbeIdT pid,
171  struct vmi1__NoneResponse *r);
172 int vmi1__DisableProbe(struct soap *soap,
173  vmi1__TargetIdT tid,vmi1__ProbeIdT pid,
174  struct vmi1__NoneResponse *r);
175 int vmi1__RemoveProbe(struct soap *soap,
176  vmi1__TargetIdT tid,vmi1__ProbeIdT pid,
177  struct vmi1__NoneResponse *r);
178 /*
179 // gsoap vmi1 service method-documentation: Add a "client" service
180 // endpoint <hostname,port> tuple for the target server to call back
181 // to; this gets transformed into a default service URL. Returns a
182 // listenerId that can be passed to the server when instantiating
183 // targets, creating probes, and returning actions from probe
184 // notification responses.
185 int vmi1__RegisterTargetListener(struct soap *soap,
186  char *host,int port,enum xsd__boolean ssl,
187  struct vmi1__ListenerIdResponse *r);
188 // gsoap vmi1 service method-documentation: Add a "client" service
189 // endpoint URL for the target server to call back to. Returns a
190 // listenerId that can be passed to the server when instantiating
191 // targets, creating probes, and returning actions from probe
192 // notification responses.
193 int vmi1__RegisterTargetListenerURL(struct soap *soap,
194  char *url,enum xsd__boolean ssl,
195  struct vmi1__ListenerIdResponse *r);
196 // gsoap vmi1 service method-documentation: Remove a listener, and any
197 // associations it has with Target/Probe/Action objects.
198 int vmi1__UnregisterTargetListener(struct soap *soap,
199  vmi1__ListenerIdT listenerId,
200  struct vmi1__NoneResponse *r);
201 */
202 // gsoap vmi1 service method-documentation: Add a non-authoritative
203 // listener to @tid.
204 int vmi1__TargetBindListener(struct soap *soap,
205  vmi1__TargetIdT tid,vmi1__ListenerT *listener,
206  struct vmi1__NoneResponse *r);
207 // gsoap vmi1 service method-documentation: Remove a non-authoritative
208 // listener from @tid.
209 int vmi1__TargetUnbindListener(struct soap *soap,
210  vmi1__TargetIdT tid,vmi1__ListenerT *listener,
211  struct vmi1__NoneResponse *r);
212 
213 #endif /* __TARGET_RPC_H__ */
int vmi1__InstantiateOverlayTarget(struct soap *soap, vmi1__TargetIdT tid, vmi1__ThreadIdT thid, struct vmi1__TargetSpecT *spec, vmi1__ListenerT *ownerListener, struct vmi1__TargetResponse *r)
Definition: target_rpc.c:1028
int vmi1__InstantiateTarget(struct soap *soap, struct vmi1__TargetSpecT *spec, vmi1__ListenerT *ownerListener, struct vmi1__TargetResponse *r)
Definition: target_rpc.c:733
int vmi1__ProbeAddr(struct soap *soap, vmi1__TargetIdT tid, vmi1__ThreadIdT thid, char *probeName, vmi1__ADDR addr, vmi1__ProbepointTypeT *probepointType, vmi1__ProbepointStyleT *probepointStyle, vmi1__ProbepointWhenceT *probepointWhence, vmi1__ProbepointSizeT *probepointSize, struct vmi1__ProbeResponse *r)
Definition: target_rpc.c:2100
struct target * target_lookup(int id)
int vmi1__ListTargetTypes(struct soap *soap, void *_, struct vmi1__TargetTypesResponse *r)
Definition: target_rpc.c:469
void target_rpc_init(void)
Definition: target_rpc.c:393
int vmi1__TargetUnbindListener(struct soap *soap, vmi1__TargetIdT tid, vmi1__ListenerT *listener, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:2467
int vmi1__ProbeLine(struct soap *soap, vmi1__TargetIdT tid, vmi1__ThreadIdT thid, char *probeName, char *filename, int line, vmi1__ProbepointStyleT *probepointStyle, vmi1__ProbepointWhenceT *probepointWhence, vmi1__ProbepointSizeT *probepointSize, struct vmi1__ProbeResponse *r)
Definition: target_rpc.c:2178
void target_rpc_fini(void)
Definition: target_rpc.c:416
int vmi1__GetTargetLogs(struct soap *soap, vmi1__TargetIdT tid, int maxSize, struct vmi1__TargetLogsResponse *r)
Definition: target_rpc.c:543
int vmi1__ProbeSymbol(struct soap *soap, vmi1__TargetIdT tid, vmi1__ThreadIdT thid, char *probeName, char *symbol, vmi1__ProbepointStyleT *probepointStyle, vmi1__ProbepointWhenceT *probepointWhence, vmi1__ProbepointSizeT *probepointSize, struct vmi1__ProbeResponse *r)
Definition: target_rpc.c:2014
int vmi1__LookupTargetSymbol(struct soap *soap, vmi1__TargetIdT tid, char *name, struct vmi1__DebugFileOptsT *opts, struct vmi1__NestedSymbolResponse *r)
Definition: target_rpc.c:1377
int vmi1__ListTargets(struct soap *soap, void *_, struct vmi1__TargetsResponse *r)
Definition: target_rpc.c:489
int vmi1__ResumeTarget(struct soap *soap, vmi1__TargetIdT tid, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:1207
int vmi1__ProbeSymbolSimple(struct soap *soap, vmi1__TargetIdT tid, vmi1__ThreadIdT thid, char *probeName, char *symbol, struct vmi1__ProbeResponse *r)
Definition: target_rpc.c:1951
int vmi1__KillTarget(struct soap *soap, vmi1__TargetIdT tid, int kill_sig, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:1255
int vmi1__PauseTarget(struct soap *soap, vmi1__TargetIdT tid, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:1183
int vmi1__CloseTarget(struct soap *soap, vmi1__TargetIdT tid, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:1231
struct dt_argp_state opts
Definition: dumptarget.c:111
int vmi1__DisableProbe(struct soap *soap, vmi1__TargetIdT tid, vmi1__ProbeIdT pid, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:2309
int vmi1__LookupTargetAllSymbols(struct soap *soap, vmi1__TargetIdT tid, char *name, struct vmi1__DebugFileOptsT *opts, struct vmi1__NestedSymbolResponse *r)
int vmi1__RemoveProbe(struct soap *soap, vmi1__TargetIdT tid, vmi1__ProbeIdT pid, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:2366
int vmi1__FinalizeTarget(struct soap *soap, vmi1__TargetIdT tid, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:1285
int vmi1__LookupTargetAddr(struct soap *soap, vmi1__TargetIdT tid, vmi1__ADDR addr, struct vmi1__DebugFileOptsT *opts, struct vmi1__NestedSymbolResponse *r)
Definition: target_rpc.c:1477
int vmi1__LookupTargetAddrSimple(struct soap *soap, vmi1__TargetIdT tid, vmi1__ADDR addr, struct vmi1__DebugFileOptsT *opts, struct vmi1__SymbolResponse *r)
Definition: target_rpc.c:1430
int vmi1__GetTarget(struct soap *soap, vmi1__TargetIdT tid, struct vmi1__TargetResponse *r)
Definition: target_rpc.c:520
int vmi1__EnableProbe(struct soap *soap, vmi1__TargetIdT tid, vmi1__ProbeIdT pid, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:2252
struct monitor_objtype_ops target_rpc_monitor_objtype_ops
Definition: target_rpc.c:377
char * name
Definition: target_api.h:2521
int vmi1__TargetBindListener(struct soap *soap, vmi1__TargetIdT tid, vmi1__ListenerT *listener, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:2423
int vmi1__PauseThread(struct soap *soap, vmi1__TargetIdT tid, vmi1__ThreadIdT thid, struct vmi1__NoneResponse *r)
Definition: target_rpc.c:1306
int target_id(struct target *target)
Definition: target_api.c:509
struct target_spec * spec
Definition: target_api.h:2605
void target_rpc_insert(int target_id, struct target *target)
int target_rpc_handle_request(struct soap *soap)
Definition: target_rpc.c:465