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_xml.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, 2013, 2014, 2015 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 #include "glib_wrapper.h"
20 #include "target_xml.h"
21 #include "debuginfo_xml.h"
22 #include "util.h"
23 #include "alist.h"
24 #include "list.h"
25 #include "target.h"
26 
27 #include <signal.h>
28 
31  enum vmi1__TargetTypeT type,
32  GHashTable *reftab,
33  target_type_t *out) {
34  switch (type) {
35  case vmi1__TargetTypeT__none:
36  if (out)
37  *out = TARGET_TYPE_NONE;
38  return TARGET_TYPE_NONE;
39  case vmi1__TargetTypeT__ptrace:
40  if (out)
41  *out = TARGET_TYPE_PTRACE;
42  return TARGET_TYPE_PTRACE;
43  case vmi1__TargetTypeT__xen:
44  if (out)
45  *out = TARGET_TYPE_XEN;
46  return TARGET_TYPE_XEN;
47  case vmi1__TargetTypeT__gdb:
48  if (out)
49  *out = TARGET_TYPE_GDB;
50  return TARGET_TYPE_GDB;
51  case vmi1__TargetTypeT__osProcess:
52  if (out)
55  case vmi1__TargetTypeT__php:
56  if (out)
57  *out = TARGET_TYPE_PHP;
58  return TARGET_TYPE_PHP;
59  default:
60  verror("unknown TargetTypeT %d\n",type);
61  return TARGET_TYPE_NONE;
62  }
63 }
64 
65 enum vmi1__TargetTypeT
67  target_type_t type,
68  GHashTable *reftab,
69  enum vmi1__TargetTypeT *out) {
70  switch (type) {
71  case TARGET_TYPE_NONE:
72  if (out)
73  *out = vmi1__TargetTypeT__none;
74  return vmi1__TargetTypeT__none;
75  case TARGET_TYPE_PTRACE:
76  if (out)
77  *out = vmi1__TargetTypeT__ptrace;
78  return vmi1__TargetTypeT__ptrace;
79  case TARGET_TYPE_XEN:
80  if (out)
81  *out = vmi1__TargetTypeT__xen;
82  return vmi1__TargetTypeT__xen;
83  case TARGET_TYPE_GDB:
84  if (out)
85  *out = vmi1__TargetTypeT__gdb;
86  return vmi1__TargetTypeT__gdb;
88  if (out)
89  *out = vmi1__TargetTypeT__osProcess;
90  return vmi1__TargetTypeT__osProcess;
91  case TARGET_TYPE_PHP:
92  if (out)
93  *out = vmi1__TargetTypeT__php;
94  return vmi1__TargetTypeT__php;
95  default:
96  verror("unknown target_type_t %d\n",type);
97  return vmi1__TargetTypeT__none;
98  }
99 }
100 
103  enum vmi1__TargetModeT mode,
104  GHashTable *reftab,
105  target_mode_t *out) {
106  switch (mode) {
107  case vmi1__TargetModeT__none:
108  if (out)
109  *out = TARGET_MODE_NONE;
110  return TARGET_MODE_NONE;
111  case vmi1__TargetModeT__live:
112  if (out)
113  *out = TARGET_MODE_LIVE;
114  return TARGET_MODE_LIVE;
115  case vmi1__TargetModeT__replay:
116  if (out)
117  *out = TARGET_MODE_REPLAY;
118  return TARGET_MODE_REPLAY;
119  case vmi1__TargetModeT__record:
120  if (out)
121  *out = TARGET_MODE_RECORD;
122  return TARGET_MODE_RECORD;
123  default:
124  verror("unknown TargetModeT %d\n",mode);
125  return TARGET_MODE_NONE;
126  }
127 }
128 
129 enum vmi1__TargetModeT
131  target_mode_t mode,
132  GHashTable *reftab,
133  enum vmi1__TargetModeT *out) {
134  switch (mode) {
135  case TARGET_MODE_NONE:
136  if (out)
137  *out = vmi1__TargetModeT__none;
138  return vmi1__TargetModeT__none;
139  case TARGET_MODE_LIVE:
140  if (out)
141  *out = vmi1__TargetModeT__live;
142  return vmi1__TargetModeT__live;
143  case TARGET_MODE_REPLAY:
144  if (out)
145  *out = vmi1__TargetModeT__replay;
146  return vmi1__TargetModeT__replay;
147  case TARGET_MODE_RECORD:
148  if (out)
149  *out = vmi1__TargetModeT__record;
150  return vmi1__TargetModeT__record;
151  default:
152  verror("unknown target_mode_t %d\n",mode);
153  return vmi1__TargetModeT__none;
154  }
155 }
156 
159  enum vmi1__ThreadBPModeT mode,
160  GHashTable *reftab,
161  thread_bpmode_t *out) {
162  switch (mode) {
163  case vmi1__ThreadBPModeT__strict:
164  if (out)
165  *out = THREAD_BPMODE_STRICT;
166  return THREAD_BPMODE_STRICT;
167  case vmi1__ThreadBPModeT__semiStrict:
168  if (out)
171  case vmi1__ThreadBPModeT__loose:
172  if (out)
173  *out = THREAD_BPMODE_LOOSE;
174  return THREAD_BPMODE_LOOSE;
175  default:
176  verror("unknown ThreadBPModeT %d; returning STRICT!\n",mode);
177  return THREAD_BPMODE_STRICT;
178  }
179 }
180 
181 enum vmi1__ThreadBPModeT
183  thread_bpmode_t mode,
184  GHashTable *reftab,
185  enum vmi1__ThreadBPModeT *out) {
186  switch (mode) {
188  if (out)
189  *out = vmi1__ThreadBPModeT__strict;
190  return vmi1__ThreadBPModeT__strict;
192  if (out)
193  *out = vmi1__ThreadBPModeT__semiStrict;
194  return vmi1__ThreadBPModeT__semiStrict;
195  case THREAD_BPMODE_LOOSE:
196  if (out)
197  *out = vmi1__ThreadBPModeT__loose;
198  return vmi1__ThreadBPModeT__loose;
199  default:
200  verror("unknown thread_bpmode_t %d; returning STRICT!\n",mode);
201  return vmi1__ThreadBPModeT__strict;
202  }
203 }
204 
205 struct target_spec *
207  struct vmi1__TargetSpecT *spec,
208  GHashTable *reftab,
209  struct target_spec *out) {
210  struct target_spec *ospec;
211  target_type_t type;
212  target_type_t mode;
213 
214  type = x_TargetTypeT_to_t_target_type_t(soap,spec->type,reftab,NULL);
215  mode = x_TargetTypeT_to_t_target_type_t(soap,spec->mode,reftab,NULL);
216 
217  if (out) {
218  ospec = out;
219  ospec->target_type = type;
220  ospec->target_mode = mode;
221  }
222  else {
223  ospec = target_build_spec(type,mode);
224  }
225 
226  if (spec->targetId)
227  ospec->target_id = *spec->targetId;
228 
229  if (spec->defaultProbeStyle)
230  ospec->style =
232  *spec->defaultProbeStyle);
233 
234  if (spec->startPaused == xsd__boolean__false_)
235  ospec->start_paused = 0;
236  else
237  ospec->start_paused = 1;
238  if (spec->stayPaused == xsd__boolean__false_)
239  ospec->stay_paused = 0;
240  else
241  ospec->stay_paused = 1;
242  if ((spec->killOnClose && *spec->killOnClose == xsd__boolean__true_)
243  || spec->killOnCloseSignal) {
244  ospec->kill_on_close = 1;
245  ospec->kill_on_close_sig =
246  (spec->killOnCloseSignal) ? *spec->killOnCloseSignal : SIGKILL;
247  }
248  if (spec->debugfileRootPrefix)
249  ospec->debugfile_root_prefix = strdup(spec->debugfileRootPrefix);
250  if (spec->activeProbeThreadEntry
251  && *spec->activeProbeThreadEntry == xsd__boolean__true_)
252  ospec->ap_flags |= APF_THREAD_ENTRY;
253  if (spec->activeProbeThreadExit
254  && *spec->activeProbeThreadExit == xsd__boolean__true_)
255  ospec->ap_flags |= APF_THREAD_EXIT;
256  if (spec->activeProbeMemory
257  && *spec->activeProbeMemory == xsd__boolean__true_)
258  ospec->ap_flags |= APF_MEMORY;
259  if (spec->activeProbeOther
260  && *spec->activeProbeOther == xsd__boolean__true_)
261  ospec->ap_flags |= APF_OTHER;
262 
263  if (type == TARGET_TYPE_PTRACE
264  && spec->backendSpec
265  && spec->backendSpec->__union_backendSpec \
266  == SOAP_UNION__vmi1__union_backendSpec_targetPtraceSpec)
268  (struct vmi1__TargetPtraceSpecT *)spec->backendSpec->union_backendSpec.targetPtraceSpec,
269  reftab,
270  ospec->backend_spec);
271 #ifdef ENABLE_XENSUPPORT
272  else if (type == TARGET_TYPE_XEN
273  && spec->backendSpec
274  && spec->backendSpec->__union_backendSpec \
275  == SOAP_UNION__vmi1__union_backendSpec_targetXenSpec)
276  x_TargetXenSpecT_to_t_xen_vm_spec(soap,
277  (struct vmi1__TargetXenSpecT *)spec->backendSpec->union_backendSpec.targetXenSpec,
278  reftab,
279  ospec->backend_spec);
280 #endif
281  else if (type == TARGET_TYPE_GDB
282  && spec->backendSpec
283  && spec->backendSpec->__union_backendSpec \
284  == SOAP_UNION__vmi1__union_backendSpec_targetGdbSpec)
286  (struct vmi1__TargetGdbSpecT *)spec->backendSpec->union_backendSpec.targetGdbSpec,
287  reftab,
288  ospec->backend_spec);
289  else if (type == TARGET_TYPE_OS_PROCESS) {
290  spec->backendSpec = NULL;
291  }
292  else if (type == TARGET_TYPE_PHP) {
293  spec->backendSpec = NULL;
294  }
295  else {
296  verror("bad target-specific spec (%d)\n",type);
297  return NULL;
298  }
299 
300  return ospec;
301 }
302 
303 struct vmi1__TargetSpecT *
305  struct target_spec *spec,
306  GHashTable *reftab,
307  struct vmi1__TargetSpecT *out) {
308  struct vmi1__TargetSpecT *ospec;
309 
310  if (out) {
311  ospec = out;
312  }
313  else {
314  ospec = SOAP_CALLOC(soap,1,sizeof(*ospec));
315  }
316 
317  ospec->type = t_target_type_t_to_x_TargetTypeT(soap,spec->target_type,
318  reftab,NULL);
319  ospec->mode = t_target_mode_t_to_x_TargetModeT(soap,spec->target_mode,
320  reftab,NULL);
321  if (!spec->start_paused)
322  ospec->startPaused = xsd__boolean__false_;
323  else
324  ospec->startPaused = xsd__boolean__true_;
325  if (!spec->stay_paused)
326  ospec->stayPaused = xsd__boolean__false_;
327  else
328  ospec->stayPaused = xsd__boolean__true_;
329 
330  if (spec->target_id > -1) {
331  ospec->targetId = SOAP_CALLOC(soap,1,sizeof(*ospec->targetId));
332  *ospec->targetId = spec->target_id;
333  }
334 
335  ospec->defaultProbeStyle =
336  SOAP_CALLOC(soap,1,sizeof(*ospec->defaultProbeStyle));
337  *ospec->defaultProbeStyle =
339 
340  /* XXX: this might be a lie. */
341  ospec->dedicatedMonitor = xsd__boolean__false_;
342  ospec->logStdout = SOAP_CALLOC(soap,1,sizeof(*ospec->logStdout));
343  if (spec->outfile)
344  *ospec->logStdout = xsd__boolean__true_;
345  else
346  *ospec->logStdout = xsd__boolean__false_;
347  ospec->logStderr = SOAP_CALLOC(soap,1,sizeof(*ospec->logStderr));
348  if (spec->errfile)
349  *ospec->logStderr = xsd__boolean__true_;
350  else
351  *ospec->logStderr = xsd__boolean__false_;
352  ospec->killOnClose = SOAP_CALLOC(soap,1,sizeof(*ospec->killOnClose));
353  if (spec->kill_on_close)
354  *ospec->killOnClose = xsd__boolean__true_;
355  else
356  *ospec->killOnClose = xsd__boolean__false_;
357  if (spec->kill_on_close) {
358  ospec->killOnCloseSignal =
359  SOAP_CALLOC(soap,1,sizeof(*ospec->killOnCloseSignal));
360  *ospec->killOnCloseSignal = spec->kill_on_close_sig;
361  }
362  if (spec->debugfile_root_prefix)
363  SOAP_STRCPY(soap,ospec->debugfileRootPrefix,spec->debugfile_root_prefix);
364  ospec->activeProbeThreadEntry =
365  SOAP_CALLOC(soap,1,sizeof(*ospec->activeProbeThreadEntry));
366  if (spec->ap_flags & APF_THREAD_ENTRY)
367  *ospec->activeProbeThreadEntry = xsd__boolean__true_;
368  else
369  *ospec->activeProbeThreadEntry = xsd__boolean__false_;
370  ospec->activeProbeThreadExit =
371  SOAP_CALLOC(soap,1,sizeof(*ospec->activeProbeThreadExit));
372  if (spec->ap_flags & APF_THREAD_EXIT)
373  *ospec->activeProbeThreadExit = xsd__boolean__true_;
374  else
375  *ospec->activeProbeThreadExit = xsd__boolean__false_;
376  ospec->activeProbeMemory =
377  SOAP_CALLOC(soap,1,sizeof(*ospec->activeProbeMemory));
378  if (spec->ap_flags & APF_MEMORY)
379  *ospec->activeProbeMemory = xsd__boolean__true_;
380  else
381  *ospec->activeProbeMemory = xsd__boolean__false_;
382  ospec->activeProbeOther =
383  SOAP_CALLOC(soap,1,sizeof(*ospec->activeProbeOther));
384  if (spec->ap_flags & APF_OTHER)
385  *ospec->activeProbeOther = xsd__boolean__true_;
386  else
387  *ospec->activeProbeOther = xsd__boolean__false_;
388 
389  if (spec->target_type == TARGET_TYPE_PTRACE) {
390  ospec->backendSpec = SOAP_CALLOC(soap,1,sizeof(*ospec->backendSpec));
391  ospec->backendSpec->__union_backendSpec = \
392  SOAP_UNION__vmi1__union_backendSpec_targetPtraceSpec;
393  ospec->backendSpec->union_backendSpec.targetPtraceSpec = \
395  (struct linux_userproc_spec *)spec->backend_spec,
396  reftab,NULL);
397  }
398 #ifdef ENABLE_XENSUPPORT
399  else if (spec->target_type == TARGET_TYPE_XEN) {
400  ospec->backendSpec = SOAP_CALLOC(soap,1,sizeof(*ospec->backendSpec));
401  ospec->backendSpec->__union_backendSpec = \
402  SOAP_UNION__vmi1__union_backendSpec_targetXenSpec;
403  ospec->backendSpec->union_backendSpec.targetXenSpec = \
404  t_xen_vm_spec_to_x_TargetXenSpecT(soap,
405  (struct xen_vm_spec *)spec->backend_spec,
406  reftab,NULL);
407  }
408 #endif
409  else if (spec->target_type == TARGET_TYPE_GDB) {
410  ospec->backendSpec = SOAP_CALLOC(soap,1,sizeof(*ospec->backendSpec));
411  ospec->backendSpec->__union_backendSpec = \
412  SOAP_UNION__vmi1__union_backendSpec_targetGdbSpec;
413  ospec->backendSpec->union_backendSpec.targetGdbSpec = \
415  (struct gdb_spec *)spec->backend_spec,
416  reftab,NULL);
417  }
418  else if (spec->target_type == TARGET_TYPE_OS_PROCESS) {
419  ospec->backendSpec = SOAP_CALLOC(soap,1,sizeof(*ospec->backendSpec));
420  ospec->backendSpec->__union_backendSpec = \
421  SOAP_UNION__vmi1__union_backendSpec_targetOsProcessSpec;
422  ospec->backendSpec->union_backendSpec.targetOsProcessSpec = NULL;
423  }
424  else if (spec->target_type == TARGET_TYPE_PHP) {
425  ospec->backendSpec = SOAP_CALLOC(soap,1,sizeof(*ospec->backendSpec));
426  ospec->backendSpec->__union_backendSpec = \
427  SOAP_UNION__vmi1__union_backendSpec_targetPhpSpec;
428  ospec->backendSpec->union_backendSpec.targetPhpSpec = NULL;
429  }
430 
431  return ospec;
432 }
433 
434 #ifdef ENABLE_XENSUPPORT
435 struct xen_vm_spec *
436 x_TargetXenSpecT_to_t_xen_vm_spec(struct soap *soap,
437  struct vmi1__TargetXenSpecT *spec,
438  GHashTable *reftab,
439  struct xen_vm_spec *out) {
440  struct xen_vm_spec *ospec;
441 
442  if (out)
443  ospec = out;
444  else
445  ospec = xen_vm_build_spec();
446 
447  if (spec->domain)
448  ospec->domain = strdup(spec->domain);
449  if (spec->kernelFilename)
450  ospec->kernel_filename = strdup(spec->kernelFilename);
451  if (spec->configFile)
452  ospec->config_file = strdup(spec->configFile);
453  if (spec->noHVMSetContext && *spec->noHVMSetContext == xsd__boolean__true_)
454  ospec->no_hvm_setcontext = 1;
455  if (spec->clearMemCachesEachException
456  && *spec->clearMemCachesEachException == xsd__boolean__true_)
458  if (spec->memcacheMmapSize && *spec->memcacheMmapSize > 0)
459  ospec->memcache_mmap_size = *spec->memcacheMmapSize;
460 #ifdef ENABLE_XENACCESS
461  if (spec->useXenAccess && *spec->useXenAccess == xsd__boolean__true_)
462  ospec->use_xenaccess = 1;
463 #endif
464 #ifdef ENABLE_LIBVMI
465  if (spec->useLibVMI && *spec->useLibVMI == xsd__boolean__true_)
466  ospec->use_libvmi = 1;
467 #endif
468  if (spec->noClearHWDbgReg && *spec->noClearHWDbgReg == xsd__boolean__true_)
469  ospec->no_hw_debug_reg_clear = 1;
470  if (spec->noUseMultiplexer && *spec->noUseMultiplexer == xsd__boolean__true_)
471  ospec->no_use_multiplexer = 1;
472  if (spec->dominfoTimeout && *spec->dominfoTimeout > 0)
473  ospec->dominfo_timeout = *spec->dominfoTimeout;
474 
475  return ospec;
476 }
477 
478 struct vmi1__TargetXenSpecT *
479 t_xen_vm_spec_to_x_TargetXenSpecT(struct soap *soap,
480  struct xen_vm_spec *spec,
481  GHashTable *reftab,
482  struct vmi1__TargetXenSpecT *out) {
483  struct vmi1__TargetXenSpecT *ospec;
484 
485  if (out)
486  ospec = out;
487  else
488  ospec = SOAP_CALLOC(soap,1,sizeof(*ospec));
489 
490  if (spec->domain)
491  SOAP_STRCPY(soap,ospec->domain,spec->domain);
492  if (spec->kernel_filename)
493  SOAP_STRCPY(soap,ospec->kernelFilename,spec->kernel_filename);
494  if (spec->config_file)
495  SOAP_STRCPY(soap,ospec->configFile,spec->config_file);
496  if (spec->no_hvm_setcontext) {
497  ospec->noHVMSetContext =
498  SOAP_CALLOC(soap,1,sizeof(*ospec->noHVMSetContext));
499  *ospec->noHVMSetContext = xsd__boolean__true_;
500  }
502  ospec->clearMemCachesEachException =
503  SOAP_CALLOC(soap,1,sizeof(*ospec->clearMemCachesEachException));
504  *ospec->clearMemCachesEachException = xsd__boolean__true_;
505  }
506  if (spec->memcache_mmap_size > 0) {
507  ospec->memcacheMmapSize =
508  SOAP_CALLOC(soap,1,sizeof(*ospec->memcacheMmapSize));
509  *ospec->memcacheMmapSize = spec->memcache_mmap_size;
510  }
511  if (spec->use_libvmi) {
512  ospec->useLibVMI =
513  SOAP_CALLOC(soap,1,sizeof(*ospec->useLibVMI));
514  *ospec->useLibVMI = xsd__boolean__true_;
515  }
516  if (spec->use_xenaccess) {
517  ospec->useXenAccess =
518  SOAP_CALLOC(soap,1,sizeof(*ospec->useXenAccess));
519  *ospec->useXenAccess = xsd__boolean__true_;
520  }
521  if (spec->no_hw_debug_reg_clear) {
522  ospec->noClearHWDbgReg =
523  SOAP_CALLOC(soap,1,sizeof(*ospec->noClearHWDbgReg));
524  *ospec->noClearHWDbgReg = xsd__boolean__true_;
525  }
526  if (spec->no_use_multiplexer) {
527  ospec->noUseMultiplexer =
528  SOAP_CALLOC(soap,1,sizeof(*ospec->noUseMultiplexer));
529  *ospec->noUseMultiplexer = xsd__boolean__true_;
530  }
531  if (spec->dominfo_timeout > 0) {
532  ospec->dominfoTimeout =
533  SOAP_CALLOC(soap,1,sizeof(*ospec->dominfoTimeout));
534  *ospec->dominfoTimeout = spec->dominfo_timeout;
535  }
536 
537  return ospec;
538 }
539 #endif
540 
541 struct gdb_spec *
543  struct vmi1__TargetGdbSpecT *spec,
544  GHashTable *reftab,
545  struct gdb_spec *out) {
546  struct gdb_spec *ospec;
547 
548  if (out)
549  ospec = out;
550  else
551  ospec = gdb_build_spec();
552 
553  if (spec->gdbHostname)
554  ospec->hostname = strdup(spec->gdbHostname);
555  if (spec->gdbPort && *spec->gdbPort > 0)
556  ospec->port = *spec->gdbPort;
557  if (spec->gdbSockfile)
558  ospec->sockfile = strdup(spec->gdbSockfile);
559  if (spec->isQemu && *spec->isQemu == xsd__boolean__true_)
560  ospec->is_qemu = 1;
561  if (spec->isKvm && *spec->isKvm == xsd__boolean__true_)
562  ospec->is_kvm = 1;
563  if (spec->clearMemCachesEachException
564  && *spec->clearMemCachesEachException == xsd__boolean__true_)
566  if (spec->qemuQmpHostname)
567  ospec->qemu_qmp_hostname = strdup(spec->qemuQmpHostname);
568  if (spec->qemuQmpPort && *spec->qemuQmpPort > 0)
569  ospec->qemu_qmp_port = *spec->qemuQmpPort;
570  if (spec->qemuMemPath)
571  ospec->qemu_mem_path = strdup(spec->qemuMemPath);
572  if (spec->mainFilename)
573  ospec->main_filename = strdup(spec->mainFilename);
574  if (spec->memcacheMmapSize && *spec->memcacheMmapSize > 0)
575  ospec->memcache_mmap_size = *spec->memcacheMmapSize;
576 
577  return ospec;
578 }
579 
580 struct vmi1__TargetGdbSpecT *
582  struct gdb_spec *spec,
583  GHashTable *reftab,
584  struct vmi1__TargetGdbSpecT *out) {
585  struct vmi1__TargetGdbSpecT *ospec;
586 
587  if (out)
588  ospec = out;
589  else
590  ospec = SOAP_CALLOC(soap,1,sizeof(*ospec));
591 
592  if (spec->hostname)
593  SOAP_STRCPY(soap,ospec->gdbHostname,spec->hostname);
594  if (spec->port > 0) {
595  ospec->gdbPort =
596  SOAP_CALLOC(soap,1,sizeof(*ospec->gdbPort));
597  *ospec->gdbPort = spec->port;
598  }
599  if (spec->sockfile)
600  SOAP_STRCPY(soap,ospec->gdbSockfile,spec->sockfile);
601  if (spec->do_udp) {
602  ospec->doUdp =
603  SOAP_CALLOC(soap,1,sizeof(*ospec->doUdp));
604  *ospec->doUdp = xsd__boolean__true_;
605  }
606  if (spec->is_qemu) {
607  ospec->isQemu =
608  SOAP_CALLOC(soap,1,sizeof(*ospec->isQemu));
609  *ospec->isQemu = xsd__boolean__true_;
610  }
611  if (spec->is_kvm) {
612  ospec->isKvm =
613  SOAP_CALLOC(soap,1,sizeof(*ospec->isKvm));
614  *ospec->isKvm = xsd__boolean__true_;
615  }
616  if (spec->qemu_qmp_hostname)
617  SOAP_STRCPY(soap,ospec->qemuQmpHostname,spec->qemu_qmp_hostname);
618  if (spec->qemu_qmp_port > 0) {
619  ospec->qemuQmpPort =
620  SOAP_CALLOC(soap,1,sizeof(*ospec->qemuQmpPort));
621  *ospec->qemuQmpPort = spec->qemu_qmp_port;
622  }
623  if (spec->qemu_mem_path)
624  SOAP_STRCPY(soap,ospec->qemuMemPath,spec->qemu_mem_path);
625  if (spec->main_filename)
626  SOAP_STRCPY(soap,ospec->mainFilename,spec->main_filename);
628  ospec->clearMemCachesEachException =
629  SOAP_CALLOC(soap,1,sizeof(*ospec->clearMemCachesEachException));
630  *ospec->clearMemCachesEachException = xsd__boolean__true_;
631  }
632  if (spec->memcache_mmap_size > 0) {
633  ospec->memcacheMmapSize =
634  SOAP_CALLOC(soap,1,sizeof(*ospec->memcacheMmapSize));
635  *ospec->memcacheMmapSize = spec->memcache_mmap_size;
636  }
637 
638  return ospec;
639 }
640 
641 struct linux_userproc_spec *
643  struct vmi1__TargetPtraceSpecT *spec,
644  GHashTable *reftab,
645  struct linux_userproc_spec *out) {
646  struct linux_userproc_spec *ospec;
647  int i;
648 
649  if (out) {
650  ospec = out;
651  ospec->pid = -1;
652  }
653  else
654  ospec = linux_userproc_build_spec();
655 
656  if (spec->pid)
657  ospec->pid = *(spec->pid);
658  if (spec->program)
659  ospec->program = strdup(spec->program);
660  if (spec->arguments && spec->arguments->__sizeargument) {
661  ospec->argv = calloc(spec->arguments->__sizeargument + 1,sizeof(char *));
662  for (i = 0; i < spec->arguments->__sizeargument; ++i) {
663  if (spec->arguments->argument[i].__size >= 0) {
664  ospec->argv[i] =
665  malloc(spec->arguments->argument[i].__size + 1);
666  memcpy(ospec->argv[i],spec->arguments->argument[i].__ptr,
667  spec->arguments->argument[i].__size);
668  /* NULL-terminate it; args are supposed to be strings. */
669  ospec->argv[i][spec->arguments->argument[i].__size] = '\0';
670  }
671  else
672  ospec->argv[i] = NULL;
673  }
674  }
675  if (spec->environment && spec->environment->__sizeenvvar) {
676  ospec->envp = calloc(spec->environment->__sizeenvvar + 1,sizeof(char *));
677  for (i = 0; i < spec->environment->__sizeenvvar; ++i)
678  ospec->envp[i] = strdup(spec->environment->envvar[i]);
679  ospec->envp[i] = NULL;
680  }
681 
682  return ospec;
683 }
684 
685 struct vmi1__TargetPtraceSpecT *
687  struct linux_userproc_spec *spec,
688  GHashTable *reftab,
689  struct vmi1__TargetPtraceSpecT *out) {
690  struct vmi1__TargetPtraceSpecT *ospec;
691  int len;
692  int i;
693 
694  if (out)
695  ospec = out;
696  else
697  ospec = SOAP_CALLOC(soap,1,sizeof(*ospec));
698 
699  if (spec->pid > 0) {
700  ospec->pid = SOAP_CALLOC(soap,1,sizeof(*(ospec->pid)));
701  *(ospec->pid) = spec->pid;
702  }
703  if (spec->program)
704  SOAP_STRCPY(soap,ospec->program,spec->program);
705  if (spec->argv) {
706  len = 0;
707  for (i = 0; spec->argv[i] != NULL; ++i)
708  ;
709  len = i;
710  ospec->arguments = SOAP_CALLOC(soap,1,sizeof(*(ospec->arguments)));
711  ospec->arguments->__sizeargument = len;
712  ospec->arguments->argument = \
713  SOAP_CALLOC(soap,len,sizeof(*(ospec->arguments->argument)));
714  for (i = 0; i < len; ++i) {
715  ospec->arguments->argument[i].__size = strlen(spec->argv[i]);
716  SOAP_STRCPY(soap,ospec->arguments->argument[i].__ptr,spec->argv[i]);
717  }
718  }
719  if (spec->envp) {
720  len = 0;
721  for (i = 0; spec->envp[i] != NULL; ++i)
722  ;
723  len = i;
724  ospec->environment = SOAP_CALLOC(soap,1,sizeof(*(ospec->environment)));
725  ospec->environment->__sizeenvvar = len;
726  ospec->environment->envvar = \
727  SOAP_CALLOC(soap,len,sizeof(*(ospec->environment->envvar)));
728  for (i = 0; i < len; ++i)
729  SOAP_STRCPY(soap,ospec->environment->envvar[i],spec->envp[i]);
730  }
731 
732  return ospec;
733 }
734 
735 
736 
739  enum vmi1__ThreadStatusT status,
740  GHashTable *reftab,
741  thread_status_t *out) {
742  thread_status_t retval;
743 
744  switch (status) {
745  case vmi1__ThreadStatusT__unknown:
746  retval = THREAD_STATUS_UNKNOWN;
747  break;
748  case vmi1__ThreadStatusT__running:
749  retval = THREAD_STATUS_RUNNING;
750  break;
751  case vmi1__ThreadStatusT__stopped:
752  retval = THREAD_STATUS_STOPPED;
753  break;
754  case vmi1__ThreadStatusT__sleeping:
755  retval = THREAD_STATUS_SLEEPING;
756  break;
757  case vmi1__ThreadStatusT__zombie:
758  retval = THREAD_STATUS_ZOMBIE;
759  break;
760  case vmi1__ThreadStatusT__dead:
761  retval = THREAD_STATUS_DEAD;
762  break;
763  case vmi1__ThreadStatusT__blockedio:
764  retval = THREAD_STATUS_BLOCKEDIO;
765  break;
766  case vmi1__ThreadStatusT__paging:
767  retval = THREAD_STATUS_PAGING;
768  break;
769  case vmi1__ThreadStatusT__paused:
770  retval = THREAD_STATUS_PAUSED;
771  break;
772 
773  default:
774  verror("unknown ThreadStatusT %d\n",status);
775  retval = THREAD_STATUS_UNKNOWN;
776  break;
777  }
778 
779  if (out)
780  *out = retval;
781 
782  return retval;
783 }
784 
785 enum vmi1__ThreadStatusT
787  thread_status_t status,
788  GHashTable *reftab,
789  enum vmi1__ThreadStatusT *out) {
790  enum vmi1__ThreadStatusT retval;
791 
792  switch (status) {
794  retval = vmi1__ThreadStatusT__unknown;
795  break;
797  retval = vmi1__ThreadStatusT__running;
798  break;
800  retval = vmi1__ThreadStatusT__stopped;
801  break;
803  retval = vmi1__ThreadStatusT__sleeping;
804  break;
806  retval = vmi1__ThreadStatusT__zombie;
807  break;
808  case THREAD_STATUS_DEAD:
809  retval = vmi1__ThreadStatusT__dead;
810  break;
812  retval = vmi1__ThreadStatusT__blockedio;
813  break;
815  retval = vmi1__ThreadStatusT__paging;
816  break;
818  retval = vmi1__ThreadStatusT__paused;
819  break;
820  default:
821  verror("unknown thread_status_t %d\n",status);
822  retval = vmi1__ThreadStatusT__unknown;
823  break;
824  }
825 
826  if (out)
827  *out = retval;
828 
829  return retval;
830 }
831 
834  enum vmi1__TargetStatusT status,
835  GHashTable *reftab,
836  target_status_t *out) {
837  target_status_t retval;
838 
839  switch (status) {
840  case vmi1__TargetStatusT__unknown:
841  retval = TSTATUS_UNKNOWN;
842  break;
843  case vmi1__TargetStatusT__running:
844  retval = TSTATUS_RUNNING;
845  break;
846  case vmi1__TargetStatusT__paused:
847  retval = TSTATUS_PAUSED;
848  break;
849  case vmi1__TargetStatusT__dead:
850  retval = TSTATUS_DEAD;
851  break;
852  case vmi1__TargetStatusT__stopped:
853  retval = TSTATUS_STOPPED;
854  break;
855  case vmi1__TargetStatusT__error:
856  retval = TSTATUS_ERROR;
857  break;
858  case vmi1__TargetStatusT__done:
859  retval = TSTATUS_DONE;
860  break;
861  default:
862  verror("unknown TargetStatusT %d\n",status);
863  retval = TSTATUS_UNKNOWN;
864  break;
865  }
866 
867  if (out)
868  *out = retval;
869 
870  return retval;
871 }
872 
873 enum vmi1__TargetStatusT
875  target_status_t status,
876  GHashTable *reftab,
877  enum vmi1__TargetStatusT *out) {
878 
879  enum vmi1__TargetStatusT retval;
880 
881  switch (status) {
882  case TSTATUS_UNKNOWN:
883  retval = vmi1__TargetStatusT__unknown;
884  break;
885  case TSTATUS_RUNNING:
886  retval = vmi1__TargetStatusT__running;
887  break;
888  case TSTATUS_PAUSED:
889  retval = vmi1__TargetStatusT__paused;
890  break;
891  case TSTATUS_DEAD:
892  retval = vmi1__TargetStatusT__dead;
893  break;
894  case TSTATUS_STOPPED:
895  retval = vmi1__TargetStatusT__stopped;
896  break;
897  case TSTATUS_ERROR:
898  retval = vmi1__TargetStatusT__error;
899  break;
900  case TSTATUS_DONE:
901  retval = vmi1__TargetStatusT__done;
902  break;
903  default:
904  verror("unknown target_status_t %d\n",status);
905  retval = vmi1__TargetStatusT__unknown;
906  break;
907  }
908 
909  if (out)
910  *out = retval;
911 
912  return retval;
913 }
914 
915 struct vmi1__ThreadT *
917  struct target_thread *thread,
918  GHashTable *reftab,
919  struct vmi1__ThreadT *out) {
920  struct vmi1__ThreadT *othread;
921 
922  if (out)
923  othread = out;
924  else
925  othread = SOAP_CALLOC(soap,1,sizeof(*othread));
926 
927  othread->thid = thread->tid;
928  othread->tid = thread->target->id;
929  othread->threadStatus = \
931  reftab,NULL);
932  if (thread->name) {
933  SOAP_STRCPY(soap,othread->name,thread->name);
934  }
935  else
936  othread->name = "";
937  if (thread->supported_overlay_types)
938  othread->canOverlay = xsd__boolean__true_;
939  else
940  othread->canOverlay = xsd__boolean__false_;
941 
942  return othread;
943 }
944 
945 struct vmi1__TargetT *
946 t_target_id_to_x_TargetT(struct soap *soap,
947  int target_id,struct target_spec *spec,
948  GHashTable *reftab,
949  struct vmi1__TargetT *out) {
950  struct vmi1__TargetT *otarget;
951 
952  if (out)
953  otarget = out;
954  else
955  otarget = SOAP_CALLOC(soap,1,sizeof(*otarget));
956 
957  otarget->tid = target_id;
958  otarget->name = "";
959 
960  /*
961  * Since we don't have a target yet, probably, just use the spec
962  * values for now.
963  */
964  otarget->activeProbeThreadEntry =
965  SOAP_CALLOC(soap,1,sizeof(*otarget->activeProbeThreadEntry));
966  if (spec->ap_flags & APF_THREAD_ENTRY)
967  *otarget->activeProbeThreadEntry = xsd__boolean__true_;
968  else
969  *otarget->activeProbeThreadEntry = xsd__boolean__false_;
970  otarget->activeProbeThreadExit =
971  SOAP_CALLOC(soap,1,sizeof(*otarget->activeProbeThreadExit));
972  if (spec->ap_flags & APF_THREAD_EXIT)
973  *otarget->activeProbeThreadExit = xsd__boolean__true_;
974  else
975  *otarget->activeProbeThreadExit = xsd__boolean__false_;
976  otarget->activeProbeMemory =
977  SOAP_CALLOC(soap,1,sizeof(*otarget->activeProbeMemory));
978  if (spec->ap_flags & APF_MEMORY)
979  *otarget->activeProbeMemory = xsd__boolean__true_;
980  else
981  *otarget->activeProbeMemory = xsd__boolean__false_;
982  otarget->activeProbeOther =
983  SOAP_CALLOC(soap,1,sizeof(*otarget->activeProbeOther));
984  if (spec->ap_flags & APF_OTHER)
985  *otarget->activeProbeOther = xsd__boolean__true_;
986  else
987  *otarget->activeProbeOther = xsd__boolean__false_;
988 
989  otarget->targetSpec = \
990  t_target_spec_to_x_TargetSpecT(soap,spec,reftab,NULL);
991 
992  otarget->targetStatus = vmi1__TargetStatusT__unknown;
993 
994  otarget->__sizethread = 0;
995  otarget->thread = NULL;
996 
997  otarget->__sizeaddrSpace = 0;
998  otarget->addrSpace = NULL;
999 
1000  return otarget;
1001 }
1002 
1003 struct vmi1__TargetT *
1004 t_target_to_x_TargetT(struct soap *soap,
1005  struct target *target,
1006  GHashTable *reftab,
1007  struct vmi1__TargetT *out) {
1008  struct vmi1__TargetT *otarget;
1009  struct array_list *threads;
1010  struct target_thread *thread;
1011  int i;
1012  int len;
1013  struct addrspace *space;
1014  GList *t1;
1015 
1016  if (out)
1017  otarget = out;
1018  else
1019  otarget = SOAP_CALLOC(soap,1,sizeof(*otarget));
1020 
1021  otarget->tid = target->id;
1022 
1023  if (target->name) {
1024  SOAP_STRCPY(soap,otarget->name,target->name);
1025  }
1026  else
1027  otarget->name = "";
1028 
1029  otarget->activeProbeThreadEntry =
1030  SOAP_CALLOC(soap,1,sizeof(*otarget->activeProbeThreadEntry));
1031  if (target->ap_flags & APF_THREAD_ENTRY)
1032  *otarget->activeProbeThreadEntry = xsd__boolean__true_;
1033  else
1034  *otarget->activeProbeThreadEntry = xsd__boolean__false_;
1035  otarget->activeProbeThreadExit =
1036  SOAP_CALLOC(soap,1,sizeof(*otarget->activeProbeThreadExit));
1037  if (target->ap_flags & APF_THREAD_EXIT)
1038  *otarget->activeProbeThreadExit = xsd__boolean__true_;
1039  else
1040  *otarget->activeProbeThreadExit = xsd__boolean__false_;
1041  otarget->activeProbeMemory =
1042  SOAP_CALLOC(soap,1,sizeof(*otarget->activeProbeMemory));
1043  if (target->ap_flags & APF_MEMORY)
1044  *otarget->activeProbeMemory = xsd__boolean__true_;
1045  else
1046  *otarget->activeProbeMemory = xsd__boolean__false_;
1047  otarget->activeProbeOther =
1048  SOAP_CALLOC(soap,1,sizeof(*otarget->activeProbeOther));
1049  if (target->ap_flags & APF_OTHER)
1050  *otarget->activeProbeOther = xsd__boolean__true_;
1051  else
1052  *otarget->activeProbeOther = xsd__boolean__false_;
1053 
1054  otarget->targetSpec = \
1055  t_target_spec_to_x_TargetSpecT(soap,target->spec,reftab,NULL);
1056 
1057  otarget->targetStatus = \
1059  reftab,NULL);
1060 
1061  threads = target_list_threads(target);
1062  if (threads && array_list_len(threads)) {
1063  otarget->__sizethread = array_list_len(threads);
1064  otarget->thread = SOAP_CALLOC(soap,array_list_len(threads),
1065  sizeof(*(otarget->thread)));
1066  array_list_foreach(threads,i,thread) {
1067  t_target_thread_to_x_ThreadT(soap,thread,reftab,
1068  &otarget->thread[i]);
1069  }
1070  }
1071 
1072  len = 0;
1073  v_g_list_foreach(target->spaces,t1,space)
1074  ++len;
1075  if (len) {
1076  otarget->__sizeaddrSpace = len;
1077  otarget->addrSpace = SOAP_CALLOC(soap,len,sizeof(*(otarget->addrSpace)));
1078  i = 0;
1079  v_g_list_foreach(target->spaces,t1,space) {
1080  t_addrspace_to_x_AddrSpaceT(soap,space,reftab,
1081  &otarget->addrSpace[i]);
1082  ++i;
1083  }
1084  }
1085 
1086  if (threads)
1087  array_list_free(threads);
1088 
1089  return otarget;
1090 }
1091 
1092 struct vmi1__AddrSpaceT *
1094  struct addrspace *space,
1095  GHashTable *reftab,
1096  struct vmi1__AddrSpaceT *out) {
1097  struct vmi1__AddrSpaceT *ospace;
1098  struct memregion *region;
1099  int i;
1100  int len;
1101  GList *t1;
1102 
1103  if (out)
1104  ospace = out;
1105  else
1106  ospace = SOAP_CALLOC(soap,1,sizeof(*ospace));
1107 
1108  if (space->name)
1109  SOAP_STRCPY(soap,ospace->name,space->name);
1110  ospace->id = space->tag;
1111  ospace->tid = space->target->id;
1112 
1113  len = 0;
1114  v_g_list_foreach(space->regions,t1,region)
1115  ++len;
1116  if (len) {
1117  ospace->__sizememRegion = len;
1118  ospace->memRegion = SOAP_CALLOC(soap,len,sizeof(*(ospace->memRegion)));
1119  i = 0;
1120  v_g_list_foreach(space->regions,t1,region) {
1121  t_memregion_to_x_MemRegionT(soap,region,reftab,
1122  &ospace->memRegion[i]);
1123  ++i;
1124  }
1125  }
1126 
1127  return ospace;
1128 }
1129 
1130 enum vmi1__MemRegionTypeT
1132  region_type_t rtype,
1133  GHashTable *reftab,
1134  enum vmi1__MemRegionTypeT *out) {
1135 
1136  enum vmi1__MemRegionTypeT retval;
1137 
1138  switch (rtype) {
1139  case REGION_TYPE_UNKNOWN:
1140  retval = vmi1__MemRegionTypeT__unknown;
1141  break;
1142  case REGION_TYPE_HEAP:
1143  retval = vmi1__MemRegionTypeT__heap;
1144  break;
1145  case REGION_TYPE_STACK:
1146  retval = vmi1__MemRegionTypeT__stack;
1147  break;
1148  case REGION_TYPE_VDSO:
1149  retval = vmi1__MemRegionTypeT__vdso;
1150  break;
1151  case REGION_TYPE_VSYSCALL:
1152  retval = vmi1__MemRegionTypeT__vsyscall;
1153  break;
1154  case REGION_TYPE_ANON:
1155  retval = vmi1__MemRegionTypeT__anon;
1156  break;
1157  case REGION_TYPE_MAIN:
1158  retval = vmi1__MemRegionTypeT__main;
1159  break;
1160  case REGION_TYPE_LIB:
1161  retval = vmi1__MemRegionTypeT__lib;
1162  break;
1163  default:
1164  verror("unknown region_type_t %d\n",rtype);
1165  retval = vmi1__MemRegionTypeT__unknown;
1166  break;
1167  }
1168 
1169  if (out)
1170  *out = retval;
1171 
1172  return retval;
1173 }
1174 
1175 struct vmi1__MemRegionT *
1177  struct memregion *region,
1178  GHashTable *reftab,
1179  struct vmi1__MemRegionT *out) {
1180  struct vmi1__MemRegionT *oregion;
1181  int i;
1182  int len;
1183  struct memrange *range;
1184  GHashTableIter iter;
1185  struct debugfile *df;
1186  char idbuf[12];
1187  GList *t1;
1188 
1189  if (out)
1190  oregion = out;
1191  else
1192  oregion = SOAP_CALLOC(soap,1,sizeof(*oregion));
1193 
1194  if (region->name) {
1195  SOAP_STRCPY(soap,oregion->name,region->name);
1196  }
1197  else
1198  oregion->name = "";
1199 
1200  oregion->memRegionType = \
1201  t_region_type_t_to_x_MemRegionTypeT(soap,region->type,reftab,NULL);
1202 
1203  oregion->baseLoadAddr = region->base_load_addr;
1204  oregion->basePhysAddr = region->base_phys_addr;
1205  oregion->baseVirtAddr = region->base_virt_addr;
1206  oregion->physOffset = region->phys_offset;
1207 
1208  len = 0;
1209  v_g_list_foreach(region->ranges,t1,range)
1210  ++len;
1211  if (len) {
1212  oregion->__sizememRange = len;
1213  oregion->memRange = SOAP_CALLOC(soap,len,sizeof(*(oregion->memRange)));
1214  i = 0;
1215  v_g_list_foreach(region->ranges,t1,range) {
1216  t_memrange_to_x_MemRangeT(soap,range,reftab,&oregion->memRange[i]);
1217  ++i;
1218  }
1219  }
1220 
1221  len = g_hash_table_size(region->debugfiles);
1222  if (len) {
1223  oregion->__sizedebugFileId = len;
1224  oregion->debugFileId = \
1225  SOAP_CALLOC(soap,len,sizeof(*(oregion->debugFileId)));
1226  g_hash_table_iter_init(&iter,region->debugfiles);
1227  i = 0;
1228  while (g_hash_table_iter_next(&iter,NULL,(gpointer *)&df)) {
1229  snprintf(idbuf,12,"i%d",df->id);
1230  SOAP_STRCPY(soap,oregion->debugFileId[i],idbuf);
1231  ++i;
1232  }
1233  }
1234 
1235  return oregion;
1236 }
1237 
1238 struct vmi1__MemRangeT *
1239 t_memrange_to_x_MemRangeT(struct soap *soap,
1240  struct memrange *range,
1241  GHashTable *reftab,
1242  struct vmi1__MemRangeT *out) {
1243  struct vmi1__MemRangeT *orange;
1244 
1245  if (out)
1246  orange = out;
1247  else
1248  orange = SOAP_CALLOC(soap,1,sizeof(*orange));
1249 
1250  if (range->prot_flags & PROT_READ)
1251  orange->read = xsd__boolean__true_;
1252  else
1253  orange->read = xsd__boolean__false_;
1254  if (range->prot_flags & PROT_WRITE)
1255  orange->write = xsd__boolean__true_;
1256  else
1257  orange->write = xsd__boolean__false_;
1258  if (range->prot_flags & PROT_EXEC)
1259  orange->execute = xsd__boolean__true_;
1260  else
1261  orange->execute = xsd__boolean__false_;
1262 
1263  orange->start = range->start;
1264  orange->end = range->end;
1265  orange->offset = range->offset;
1266 
1267  return orange;
1268 }
1269 
1270 struct vmi1__ProbeT *
1271 t_probe_to_x_ProbeT(struct soap *soap,
1272  struct probe *probe,
1273  GHashTable *reftab,
1274  struct vmi1__ProbeT *out) {
1275  struct vmi1__ProbeT *oprobe;
1276  struct probepoint *pp;
1277 
1278  if (out)
1279  oprobe = out;
1280  else
1281  oprobe = SOAP_CALLOC(soap,1,sizeof(*oprobe));
1282 
1283  oprobe->pid = probe->id;
1284  SOAP_STRCPY(soap,oprobe->name,probe_name(probe));
1285  oprobe->addr = probe_addr(probe);
1286  if (probe->target)
1287  oprobe->tid = probe->target->id;
1288  if (probe->thread)
1289  oprobe->thid = probe->thread->tid;
1290 
1291  if (probe->probepoint) {
1292  pp = probe->probepoint;
1293 
1295  oprobe->style = t_probepoint_style_t_to_x_ProbepointStyleT(soap,pp->style);
1296  oprobe->whence = t_probepoint_whence_t_to_x_ProbepointWhenceT(soap,pp->whence);
1297  oprobe->psize = t_probepoint_watchsize_t_to_x_ProbepointSizeT(soap,pp->watchsize);
1298  }
1299 
1300  return oprobe;
1301 }
1302 
1303 struct vmi1__ProbeEventT *
1304 t_probe_to_x_ProbeEventT(struct soap *soap,
1305  struct probe *probe,tid_t tid,int type,struct probe *trigger,struct probe *base,
1306  GHashTable *reftab,
1307  struct vmi1__ProbeEventT *out) {
1308  struct vmi1__ProbeEventT *oevent;
1309  GHashTable *regs;
1310  GHashTableIter iter;
1311  REGVAL *rvp;
1312  char *rname;
1313  int i;
1314  struct target_thread *tthread;
1315 
1316  tthread = target_lookup_thread(probe->target,tid);
1317 
1318  if (out)
1319  oevent = out;
1320  else
1321  oevent = SOAP_CALLOC(soap,1,sizeof(*oevent));
1322 
1323  if (type == 0)
1324  oevent->probeEventType = _vmi1__probeEventType__pre;
1325  else if (type == 1)
1326  oevent->probeEventType = _vmi1__probeEventType__post;
1327 
1328  oevent->probe = t_probe_to_x_ProbeT(soap,probe,reftab,NULL);
1329  if (tthread)
1330  oevent->thread = t_target_thread_to_x_ThreadT(soap,tthread,reftab,NULL);
1331 
1332  oevent->registerValues = SOAP_CALLOC(soap,1,sizeof(*oevent->registerValues));
1333 
1334  regs = target_copy_registers(probe->target,tid);
1335  if (regs) {
1336  g_hash_table_iter_init(&iter,regs);
1337 
1338  oevent->registerValues->__sizeregisterValue = g_hash_table_size(regs);
1339  oevent->registerValues->registerValue =
1340  SOAP_CALLOC(soap,g_hash_table_size(regs),
1341  sizeof(*oevent->registerValues->registerValue));
1342  i = 0;
1343  while (g_hash_table_iter_next(&iter,
1344  (gpointer *)&rname,(gpointer *)&rvp)) {
1345  oevent->registerValues->registerValue[i].name = rname;
1346  oevent->registerValues->registerValue[i].value = *rvp;
1347  ++i;
1348  }
1349  g_hash_table_destroy(regs);
1350  }
1351  else {
1352  oevent->registerValues->__sizeregisterValue = 0;
1353  oevent->registerValues->registerValue = NULL;
1354  }
1355 
1356  return oevent;
1357 }
1358 
1361  enum vmi1__ProbepointTypeT in) {
1362  switch (in) {
1363  case vmi1__ProbepointTypeT__break_:
1364  return PROBEPOINT_BREAK;
1365  case vmi1__ProbepointTypeT__watch:
1366  return PROBEPOINT_WATCH;
1367  default:
1368  verror("unknown ProbepointTypeT %d!\n",in);
1369  return -1;
1370  }
1371 }
1372 enum vmi1__ProbepointTypeT
1374  probepoint_type_t in) {
1375  switch (in) {
1376  case PROBEPOINT_BREAK:
1377  return vmi1__ProbepointTypeT__break_;
1378  case PROBEPOINT_WATCH:
1379  return vmi1__ProbepointTypeT__watch;
1380  default:
1381  verror("unknown probepoint_type_t %d!\n",in);
1382  return -1;
1383  }
1384 }
1385 
1388  enum vmi1__ProbepointStyleT in) {
1389  switch (in) {
1390  case vmi1__ProbepointStyleT__hw:
1391  return PROBEPOINT_HW;
1392  case vmi1__ProbepointStyleT__sw:
1393  return PROBEPOINT_SW;
1394  case vmi1__ProbepointStyleT__fastest:
1395  return PROBEPOINT_FASTEST;
1396  default:
1397  verror("unknown ProbepointStyleT %d!\n",in);
1398  return -1;
1399  }
1400 }
1401 enum vmi1__ProbepointStyleT
1403  probepoint_style_t in) {
1404  switch (in) {
1405  case PROBEPOINT_HW:
1406  return vmi1__ProbepointStyleT__hw;
1407  case PROBEPOINT_SW:
1408  return vmi1__ProbepointStyleT__sw;
1409  case PROBEPOINT_FASTEST:
1410  return vmi1__ProbepointStyleT__fastest;
1411  default:
1412  verror("unknown probepoint_style_t %d!\n",in);
1413  return -1;
1414  }
1415 }
1416 
1419  enum vmi1__ProbepointWhenceT in) {
1420  switch (in) {
1421  case vmi1__ProbepointWhenceT__auto_:
1422  return PROBEPOINT_WAUTO;
1423  case vmi1__ProbepointWhenceT__exec:
1424  return PROBEPOINT_EXEC;
1425  case vmi1__ProbepointWhenceT__write:
1426  return PROBEPOINT_WRITE;
1427  case vmi1__ProbepointWhenceT__readwrite:
1428  return PROBEPOINT_READWRITE;
1429  default:
1430  verror("unknown ProbepointWhenceT %d!\n",in);
1431  return -1;
1432  }
1433 }
1434 enum vmi1__ProbepointWhenceT
1436  probepoint_whence_t in) {
1437  switch (in) {
1438  case PROBEPOINT_WAUTO:
1439  return vmi1__ProbepointWhenceT__auto_;
1440  case PROBEPOINT_EXEC:
1441  return vmi1__ProbepointWhenceT__exec;
1442  case PROBEPOINT_WRITE:
1443  return vmi1__ProbepointWhenceT__write;
1444  case PROBEPOINT_READWRITE:
1445  return vmi1__ProbepointWhenceT__readwrite;
1446  default:
1447  verror("unknown probepoint_whence_t %d!\n",in);
1448  return -1;
1449  }
1450 }
1451 
1454  enum vmi1__ProbepointSizeT in) {
1455  switch (in) {
1456  case vmi1__ProbepointSizeT__auto_:
1457  return PROBEPOINT_LAUTO;
1458  case vmi1__ProbepointSizeT__0:
1459  return PROBEPOINT_L0;
1460  case vmi1__ProbepointSizeT__2:
1461  return PROBEPOINT_L2;
1462  case vmi1__ProbepointSizeT__4:
1463  return PROBEPOINT_L4;
1464  case vmi1__ProbepointSizeT__8:
1465  return PROBEPOINT_L8;
1466  default:
1467  verror("unknown ProbepointSizeT %d!\n",in);
1468  return -1;
1469  }
1470 }
1471 enum vmi1__ProbepointSizeT
1474  switch (in) {
1475  case PROBEPOINT_LAUTO:
1476  return vmi1__ProbepointSizeT__auto_;
1477  case PROBEPOINT_L0:
1478  return vmi1__ProbepointSizeT__0;
1479  case PROBEPOINT_L2:
1480  return vmi1__ProbepointSizeT__2;
1481  case PROBEPOINT_L4:
1482  return vmi1__ProbepointSizeT__4;
1483  case PROBEPOINT_L8:
1484  return vmi1__ProbepointSizeT__8;
1485  default:
1486  verror("unknown probepoint_watchsize_t %d!\n",in);
1487  return -1;
1488  }
1489 }
1490 
1493  enum vmi1__ActionTypeT in) {
1494  switch (in) {
1495  case vmi1__ActionTypeT__return_:
1496  return ACTION_RETURN;
1497  case vmi1__ActionTypeT__regmod:
1498  return ACTION_REGMOD;
1499  case vmi1__ActionTypeT__memmod:
1500  return ACTION_MEMMOD;
1501  case vmi1__ActionTypeT__singlestep:
1502  return ACTION_SINGLESTEP;
1503  default:
1504  verror("unknown ActionTypeT %d!\n",in);
1505  return -1;
1506  }
1507 }
1508 enum vmi1__ActionTypeT
1510  action_type_t in) {
1511  switch (in) {
1512  case ACTION_RETURN:
1513  return vmi1__ActionTypeT__return_;
1514  case ACTION_REGMOD:
1515  return vmi1__ActionTypeT__regmod;
1516  case ACTION_MEMMOD:
1517  return vmi1__ActionTypeT__memmod;
1518  case ACTION_SINGLESTEP:
1519  return vmi1__ActionTypeT__singlestep;
1520  default:
1521  verror("unknown action_type_t %d!\n",in);
1522  return -1;
1523  }
1524 }
1525 
1528  enum vmi1__ActionWhenceT in) {
1529  switch (in) {
1530  case vmi1__ActionWhenceT__oneshot:
1531  return ACTION_ONESHOT;
1532  case vmi1__ActionWhenceT__repeatpre:
1533  return ACTION_REPEATPRE;
1534  case vmi1__ActionWhenceT__repeatpost:
1535  return ACTION_REPEATPOST;
1536  default:
1537  verror("unknown ActionWhenceT %d!\n",in);
1538  return -1;
1539  }
1540 }
1541 enum vmi1__ActionWhenceT
1543  action_whence_t in) {
1544  switch (in) {
1545  case ACTION_ONESHOT:
1546  return vmi1__ActionWhenceT__oneshot;
1547  case ACTION_REPEATPRE:
1548  return vmi1__ActionWhenceT__repeatpre;
1549  case ACTION_REPEATPOST:
1550  return vmi1__ActionWhenceT__repeatpost;
1551  default:
1552  verror("unknown action_whence_t %d!\n",in);
1553  return -1;
1554  }
1555 }
1556 
1559  enum vmi1__HandlerMsgT in) {
1560  switch (in) {
1561  case vmi1__HandlerMsgT__success:
1562  return MSG_SUCCESS;
1563  case vmi1__HandlerMsgT__failure:
1564  return MSG_FAILURE;
1565  case vmi1__HandlerMsgT__stepping:
1566  return MSG_STEPPING;
1567  case vmi1__HandlerMsgT__stepping_USCOREat_USCOREbp:
1568  return MSG_STEPPING_AT_BP;
1569  default:
1570  verror("unknown HandlerMsgT %d!\n",in);
1571  return -1;
1572  }
1573 }
1574 enum vmi1__HandlerMsgT
1576  handler_msg_t in) {
1577  switch (in) {
1578  case MSG_SUCCESS:
1579  return vmi1__HandlerMsgT__success;
1580  case MSG_FAILURE:
1581  return vmi1__HandlerMsgT__failure;
1582  case MSG_STEPPING:
1583  return vmi1__HandlerMsgT__stepping;
1584  case MSG_STEPPING_AT_BP:
1585  return vmi1__HandlerMsgT__stepping_USCOREat_USCOREbp;
1586  default:
1587  verror("unknown handler_msg_t %d!\n",in);
1588  return -1;
1589  }
1590 }
1591 
1592 struct vmi1__ActionT *
1593 t_action_to_x_ActionT(struct soap *soap,
1594  struct action *action,
1595  GHashTable *reftab,
1596  struct vmi1__ActionT *out) {
1597  struct vmi1__ActionT *oaction;
1598 
1599  if (out)
1600  oaction = out;
1601  else
1602  oaction = SOAP_CALLOC(soap,1,sizeof(*oaction));
1603 
1604  oaction->actionId = action->id;
1605  oaction->actionSpec = SOAP_CALLOC(soap,1,sizeof(*oaction->actionSpec));
1606  oaction->actionSpec->tid = action->target->id;
1607  oaction->actionSpec->pid = action->probe->id;
1608  oaction->actionSpec->type = \
1610  oaction->actionSpec->whence = \
1612  switch (action->type) {
1613  case ACTION_RETURN:
1614  oaction->actionSpec->__union_ActionSpecT = \
1615  SOAP_UNION__vmi1__union_ActionSpecT_return_;
1616  oaction->actionSpec->union_ActionSpecT.return_ = \
1617  SOAP_CALLOC(soap,1,sizeof(*oaction->actionSpec->union_ActionSpecT.return_));
1618  oaction->actionSpec->union_ActionSpecT.return_->code = \
1619  action->detail.ret.retval;
1620  break;
1621  case ACTION_REGMOD:
1622  oaction->actionSpec->__union_ActionSpecT = \
1623  SOAP_UNION__vmi1__union_ActionSpecT_regmod;
1624  oaction->actionSpec->union_ActionSpecT.regmod = \
1625  SOAP_CALLOC(soap,1,sizeof(*oaction->actionSpec->union_ActionSpecT.regmod));
1626  oaction->actionSpec->union_ActionSpecT.regmod->registerValue = \
1627  SOAP_CALLOC(soap,1,sizeof(*oaction->actionSpec->union_ActionSpecT.regmod->registerValue));
1628  SOAP_STRCPY(soap,
1629  oaction->actionSpec->union_ActionSpecT.regmod->registerValue->name,
1630  (char *)target_regname(action->target,action->detail.regmod.regnum));
1631  oaction->actionSpec->union_ActionSpecT.regmod->registerValue->value = \
1632  action->detail.regmod.regval;
1633  break;
1634  case ACTION_MEMMOD:
1635  oaction->actionSpec->__union_ActionSpecT = \
1636  SOAP_UNION__vmi1__union_ActionSpecT_memmod;
1637  oaction->actionSpec->union_ActionSpecT.memmod = \
1638  SOAP_CALLOC(soap,1,sizeof(*oaction->actionSpec->union_ActionSpecT.memmod));
1639  oaction->actionSpec->union_ActionSpecT.memmod->addr = \
1640  action->detail.memmod.destaddr;
1641  /* Convert to a hexBinary string */
1642  oaction->actionSpec->union_ActionSpecT.memmod->data.__ptr = \
1643  (unsigned char *)action->detail.memmod.data;
1644  oaction->actionSpec->union_ActionSpecT.memmod->data.__size = \
1645  action->detail.memmod.len;
1646  /*
1647  oaction->actionSpec->union_ActionSpecT.memmod->data = \
1648  SOAP_CALLOC(soap,2 * action->detail.memmod.len + 1,1);
1649  for (i = 0; i < action->detail.memmod.len; ++i)
1650  sprintf(oaction->actionSpec->union_ActionSpecT.memmod->data + i * 2,
1651  "%02x",action->detail.memmod.data[i]);
1652  oaction->actionSpec->union_ActionSpecT.memmod->data[action->detail.memmod.len] = '\0';
1653  */
1654  break;
1655  case ACTION_SINGLESTEP:
1656 
1657  break;
1658  default:
1659  verror("unknown action type %d!\n",action->type);
1660  return NULL;
1661  }
1662 
1663  return oaction;
1664 }
1665 
1666 struct vmi1__ActionEventT *
1667 t_action_to_x_ActionEventT(struct soap *soap,
1668  struct action *action,struct target_thread *tthread,
1669  handler_msg_t msg,int msg_detail,
1670  GHashTable *reftab,
1671  struct vmi1__ActionEventT *out) {
1672  struct vmi1__ActionEventT *oevent;
1673  GHashTable *regs;
1674  GHashTableIter iter;
1675  REGVAL *rvp;
1676  char *rname;
1677  int i;
1678 
1679  if (out)
1680  oevent = out;
1681  else
1682  oevent = SOAP_CALLOC(soap,1,sizeof(*oevent));
1683 
1684  oevent->handlerMsg = t_handler_msg_t_to_x_HandlerMsgT(soap,msg);
1685 
1686  if (action->type == ACTION_SINGLESTEP) {
1687  oevent->actionDetail = SOAP_CALLOC(soap,1,sizeof(*oevent->actionDetail));
1688  oevent->actionDetail->stepCount = \
1689  SOAP_CALLOC(soap,1,sizeof(*oevent->actionDetail->stepCount));
1690  *oevent->actionDetail->stepCount = msg_detail;
1691  }
1692 
1693  oevent->action = t_action_to_x_ActionT(soap,action,reftab,NULL);
1694  oevent->thread = t_target_thread_to_x_ThreadT(soap,tthread,reftab,NULL);
1695 
1696  oevent->registerValues = SOAP_CALLOC(soap,1,sizeof(*oevent->registerValues));
1697 
1698  regs = target_copy_registers(tthread->target,tthread->tid);
1699  if (regs) {
1700  g_hash_table_iter_init(&iter,regs);
1701 
1702  oevent->registerValues->__sizeregisterValue = g_hash_table_size(regs);
1703  oevent->registerValues->registerValue =
1704  SOAP_CALLOC(soap,g_hash_table_size(regs),
1705  sizeof(*oevent->registerValues->registerValue));
1706  i = 0;
1707  while (g_hash_table_iter_next(&iter,
1708  (gpointer *)&rname,(gpointer *)&rvp)) {
1709  oevent->registerValues->registerValue[i].name = rname;
1710  oevent->registerValues->registerValue[i].value = *rvp;
1711  ++i;
1712  }
1713  g_hash_table_destroy(regs);
1714  }
1715  else {
1716  oevent->registerValues->__sizeregisterValue = 0;
1717  oevent->registerValues->registerValue = NULL;
1718  }
1719 
1720  return oevent;
1721 }
struct vmi1__TargetSpecT * t_target_spec_to_x_TargetSpecT(struct soap *soap, struct target_spec *spec, GHashTable *reftab, struct vmi1__TargetSpecT *out)
Definition: target_xml.c:304
char * domain
Definition: target_xen_vm.h:68
int qemu_qmp_port
Definition: target_gdb.h:55
target_mode_t target_mode
Definition: target_api.h:2210
enum vmi1__ThreadBPModeT t_thread_bpmode_t_to_x_ThreadBPModeT(struct soap *soap, thread_bpmode_t mode, GHashTable *reftab, enum vmi1__ThreadBPModeT *out)
Definition: target_xml.c:182
unsigned int use_xenaccess
Definition: target_xen_vm.h:77
void * backend_spec
Definition: target_api.h:2290
struct vmi1__TargetT * t_target_to_x_TargetT(struct soap *soap, struct target *target, GHashTable *reftab, struct vmi1__TargetT *out)
Definition: target_xml.c:1004
int32_t tid_t
Definition: common.h:36
struct vmi1__TargetPtraceSpecT * t_linux_userproc_spec_to_x_TargetPtraceSpecT(struct soap *soap, struct linux_userproc_spec *spec, GHashTable *reftab, struct vmi1__TargetPtraceSpecT *out)
Definition: target_xml.c:686
#define SOAP_CALLOC(soap, nmemb, size)
Definition: util.h:25
probepoint_type_t
Definition: probe_api.h:213
target_status_t
Definition: target_api.h:197
int id
Definition: probe.h:396
char * hostname
Definition: target_gdb.h:51
action_whence_t
Definition: probe_api.h:257
probepoint_style_t style
Definition: probe.h:223
Definition: probe.h:392
char * kernel_filename
Definition: target_xen_vm.h:69
struct linux_userproc_spec * linux_userproc_build_spec(void)
static uint64_t unsigned int i
struct vmi1__MemRangeT * t_memrange_to_x_MemRangeT(struct soap *soap, struct memrange *range, GHashTable *reftab, struct vmi1__MemRangeT *out)
Definition: target_xml.c:1239
GHashTable * target_copy_registers(struct target *target, tid_t tid)
Definition: target_api.c:1203
unsigned long int memcache_mmap_size
Definition: target_gdb.h:47
ADDR end
Definition: target.h:995
#define v_g_list_foreach(glhead, glcur, elm)
Definition: glib_wrapper.h:34
probepoint_whence_t
Definition: probe_api.h:234
uint8_t kill_on_close
Definition: target_api.h:2213
enum vmi1__HandlerMsgT t_handler_msg_t_to_x_HandlerMsgT(struct soap *soap, handler_msg_t in)
Definition: target_xml.c:1575
active_probe_flags_t ap_flags
Definition: target_api.h:2477
probepoint_style_t style
Definition: target_api.h:2212
char * name
Definition: target.h:939
char * qemu_mem_path
Definition: target_gdb.h:61
struct target * target
Definition: target.h:895
OFFSET phys_offset
Definition: target.h:987
ADDR start
Definition: target.h:994
uint8_t stay_paused
Definition: target_api.h:2213
#define verror(format,...)
Definition: log.h:30
int id
Definition: dwdebug.h:823
GHashTable * debugfiles
Definition: target.h:956
char * qemu_qmp_hostname
Definition: target_gdb.h:54
unsigned int use_libvmi
Definition: target_xen_vm.h:77
union action::@17 detail
struct vmi1__AddrSpaceT * t_addrspace_to_x_AddrSpaceT(struct soap *soap, struct addrspace *space, GHashTable *reftab, struct vmi1__AddrSpaceT *out)
Definition: target_xml.c:1093
ADDR base_phys_addr
Definition: target.h:977
thread_status_t x_ThreadStatusT_to_t_thread_status_t(struct soap *soap, enum vmi1__ThreadStatusT status, GHashTable *reftab, thread_status_t *out)
Definition: target_xml.c:738
thread_status_t status
Definition: target_api.h:2084
unsigned int clear_mem_caches_each_exception
Definition: target_xen_vm.h:77
struct gdb_spec * x_TargetGdbSpecT_to_t_gdb_spec(struct soap *soap, struct vmi1__TargetGdbSpecT *spec, GHashTable *reftab, struct gdb_spec *out)
Definition: target_xml.c:542
action_whence_t x_ActionWhenceT_to_t_action_whence_t(struct soap *soap, enum vmi1__ActionWhenceT in)
Definition: target_xml.c:1527
unsigned int no_hvm_setcontext
Definition: target_xen_vm.h:77
ADDR probe_addr(struct probe *probe)
Definition: probe.c:1959
struct target_spec * x_TargetSpecT_to_t_target_spec(struct soap *soap, struct vmi1__TargetSpecT *spec, GHashTable *reftab, struct target_spec *out)
Definition: target_xml.c:206
struct vmi1__ThreadT * t_target_thread_to_x_ThreadT(struct soap *soap, struct target_thread *thread, GHashTable *reftab, struct vmi1__ThreadT *out)
Definition: target_xml.c:916
struct target * target
Definition: probe.h:452
enum vmi1__ActionWhenceT t_action_whence_t_to_x_ActionWhenceT(struct soap *soap, action_whence_t in)
Definition: target_xml.c:1542
#define array_list_foreach(alist, lpc, placeholder)
Definition: alist.h:371
struct xen_vm_spec * xen_vm_build_spec(void)
enum vmi1__ThreadStatusT t_thread_status_t_to_x_ThreadStatusT(struct soap *soap, thread_status_t status, GHashTable *reftab, enum vmi1__ThreadStatusT *out)
Definition: target_xml.c:786
unsigned int no_hw_debug_reg_clear
Definition: target_xen_vm.h:77
struct action::@17::@21 memmod
struct vmi1__ProbeEventT * t_probe_to_x_ProbeEventT(struct soap *soap, struct probe *probe, tid_t tid, int type, struct probe *trigger, struct probe *base, GHashTable *reftab, struct vmi1__ProbeEventT *out)
Definition: target_xml.c:1304
struct vmi1__MemRegionT * t_memregion_to_x_MemRegionT(struct soap *soap, struct memregion *region, GHashTable *reftab, struct vmi1__MemRegionT *out)
Definition: target_xml.c:1176
region_type_t
char * main_filename
Definition: target_gdb.h:63
probepoint_watchsize_t
Definition: probe_api.h:241
unsigned int clear_mem_caches_each_exception
Definition: target_gdb.h:39
action_whence_t whence
Definition: probe.h:407
handler_msg_t x_HandlerMsgT_to_t_handler_msg_t(struct soap *soap, enum vmi1__HandlerMsgT in)
Definition: target_xml.c:1558
unsigned int no_use_multiplexer
Definition: target_xen_vm.h:77
thread_bpmode_t
Definition: target_api.h:366
target_mode_t
Definition: target_api.h:187
struct vmi1__ActionT * t_action_to_x_ActionT(struct soap *soap, struct action *action, GHashTable *reftab, struct vmi1__ActionT *out)
Definition: target_xml.c:1593
const char * target_regname(struct target *target, REG reg)
Definition: target_api.c:1114
unsigned int is_qemu
Definition: target_gdb.h:39
target_mode_t x_TargetModeT_to_t_target_mode_t(struct soap *soap, enum vmi1__TargetModeT mode, GHashTable *reftab, target_mode_t *out)
Definition: target_xml.c:102
enum vmi1__MemRegionTypeT t_region_type_t_to_x_MemRegionTypeT(struct soap *soap, region_type_t rtype, GHashTable *reftab, enum vmi1__MemRegionTypeT *out)
Definition: target_xml.c:1131
enum vmi1__TargetStatusT t_target_status_t_to_x_TargetStatusT(struct soap *soap, target_status_t status, GHashTable *reftab, enum vmi1__TargetStatusT *out)
Definition: target_xml.c:874
struct action::@17::@20 regmod
probepoint_whence_t x_ProbepointWhenceT_to_t_probepoint_whence_t(struct soap *soap, enum vmi1__ProbepointWhenceT in)
Definition: target_xml.c:1418
unsigned int do_udp
Definition: target_gdb.h:39
ADDR tag
Definition: target.h:897
probepoint_watchsize_t x_ProbepointSizeT_to_t_probepoint_watchsize_t(struct soap *soap, enum vmi1__ProbepointSizeT in)
Definition: target_xml.c:1453
probepoint_style_t x_ProbepointStyleT_to_t_probepoint_style_t(struct soap *soap, enum vmi1__ProbepointStyleT in)
Definition: target_xml.c:1387
char * config_file
Definition: target_xen_vm.h:70
#define PROT_EXEC
Definition: common.h:108
int len
Definition: dumptarget.c:52
#define PROT_WRITE
Definition: common.h:107
struct vmi1__ActionEventT * t_action_to_x_ActionEventT(struct soap *soap, struct action *action, struct target_thread *tthread, handler_msg_t msg, int msg_detail, GHashTable *reftab, struct vmi1__ActionEventT *out)
Definition: target_xml.c:1667
Definition: probe.h:308
target_type_t target_type
Definition: target_api.h:2203
GList * spaces
Definition: target_api.h:2643
struct target_thread * thread
Definition: probe.h:343
probepoint_type_t x_ProbepointTypeT_to_t_probepoint_type_t(struct soap *soap, enum vmi1__ProbepointTypeT in)
Definition: target_xml.c:1360
handler_msg_t
Definition: probe_api.h:52
ADDR offset
Definition: target.h:996
unsigned int prot_flags
Definition: target.h:997
enum vmi1__TargetTypeT t_target_type_t_to_x_TargetTypeT(struct soap *soap, target_type_t type, GHashTable *reftab, enum vmi1__TargetTypeT *out)
Definition: target_xml.c:66
struct vmi1__TargetT * t_target_id_to_x_TargetT(struct soap *soap, int target_id, struct target_spec *spec, GHashTable *reftab, struct vmi1__TargetT *out)
Definition: target_xml.c:946
void * calloc(size_t nmemb, size_t size)
Definition: debugserver.c:200
struct target * target
Definition: target_api.h:2078
GList * ranges
Definition: target.h:947
enum vmi1__ProbepointSizeT t_probepoint_watchsize_t_to_x_ProbepointSizeT(struct soap *soap, probepoint_watchsize_t in)
Definition: target_xml.c:1472
uint32_t REGVAL
Definition: common.h:66
unsigned int is_kvm
Definition: target_gdb.h:39
enum vmi1__ProbepointWhenceT t_probepoint_whence_t_to_x_ProbepointWhenceT(struct soap *soap, probepoint_whence_t in)
Definition: target_xml.c:1435
target_status_t target_status(struct target *target)
Definition: target_api.c:1046
struct target_spec * target_build_spec(target_type_t type, target_mode_t mode)
Definition: target_api.c:410
int dominfo_timeout
Definition: target_xen_vm.h:72
target_type_t
Definition: target_api.h:163
probepoint_style_t
Definition: probe_api.h:228
unsigned long int memcache_mmap_size
Definition: target_xen_vm.h:75
struct target * target
Definition: probe.h:342
char * name
Definition: target_api.h:2521
char * name
Definition: target.h:898
thread_status_t
Definition: target_api.h:254
struct linux_userproc_spec * x_TargetPtraceSpecT_to_t_linux_userproc_spec(struct soap *soap, struct vmi1__TargetPtraceSpecT *spec, GHashTable *reftab, struct linux_userproc_spec *out)
Definition: target_xml.c:642
probepoint_watchsize_t watchsize
Definition: probe.h:232
#define PROT_READ
Definition: common.h:106
int port
Definition: target_gdb.h:52
int target_id(struct target *target)
Definition: target_api.c:509
int kill_on_close_sig
Definition: target_api.h:2242
struct target_spec * spec
Definition: target_api.h:2605
ADDR base_virt_addr
Definition: target.h:978
int id
Definition: probe.h:312
action_type_t x_ActionTypeT_to_t_action_type_t(struct soap *soap, enum vmi1__ActionTypeT in)
Definition: target_xml.c:1492
int id
Definition: target_api.h:2514
void * malloc(size_t size)
Definition: debugserver.c:214
char * debugfile_root_prefix
Definition: target_api.h:2235
region_type_t type
Definition: target.h:940
struct target_thread * target_lookup_thread(struct target *target, tid_t tid)
Definition: target.c:4023
ADDR base_load_addr
Definition: target.h:968
enum vmi1__ProbepointStyleT t_probepoint_style_t_to_x_ProbepointStyleT(struct soap *soap, probepoint_style_t in)
Definition: target_xml.c:1402
struct gdb_spec * gdb_build_spec(void)
Definition: target_gdb.c:574
struct vmi1__TargetGdbSpecT * t_gdb_spec_to_x_TargetGdbSpecT(struct soap *soap, struct gdb_spec *spec, GHashTable *reftab, struct vmi1__TargetGdbSpecT *out)
Definition: target_xml.c:581
char * errfile
Definition: target_api.h:2288
#define SOAP_STRCPY(soap, d, s)
Definition: util.h:28
enum vmi1__ActionTypeT t_action_type_t_to_x_ActionTypeT(struct soap *soap, action_type_t in)
Definition: target_xml.c:1509
char * probe_name(struct probe *probe)
Definition: probe.c:1935
char * outfile
Definition: target_api.h:2287
target_type_t x_TargetTypeT_to_t_target_type_t(struct soap *soap, enum vmi1__TargetTypeT type, GHashTable *reftab, target_type_t *out)
Definition: target_xml.c:30
action_type_t
Definition: probe_api.h:249
char * sockfile
Definition: target_gdb.h:50
target_status_t x_TargetStatusT_to_t_target_status_t(struct soap *soap, enum vmi1__TargetStatusT status, GHashTable *reftab, target_status_t *out)
Definition: target_xml.c:833
struct target * otarget
Definition: cfi_check.c:45
uint8_t start_paused
Definition: target_api.h:2213
struct array_list * target_list_threads(struct target *target)
Definition: target_api.c:1233
struct probe * probe
Definition: probe.h:450
action_type_t type
Definition: probe.h:406
struct vmi1__ProbeT * t_probe_to_x_ProbeT(struct soap *soap, struct probe *probe, GHashTable *reftab, struct vmi1__ProbeT *out)
Definition: target_xml.c:1271
enum vmi1__ProbepointTypeT t_probepoint_type_t_to_x_ProbepointTypeT(struct soap *soap, probepoint_type_t in)
Definition: target_xml.c:1373
probepoint_type_t type
Definition: probe.h:222
struct probepoint * probepoint
Definition: probe.h:347
active_probe_flags_t ap_flags
Definition: target_api.h:2220
GList * regions
Definition: target.h:909
thread_bpmode_t x_ThreadBPModeT_to_t_thread_bpmode_t(struct soap *soap, enum vmi1__ThreadBPModeT mode, GHashTable *reftab, thread_bpmode_t *out)
Definition: target_xml.c:158
enum vmi1__TargetModeT t_target_mode_t_to_x_TargetModeT(struct soap *soap, target_mode_t mode, GHashTable *reftab, enum vmi1__TargetModeT *out)
Definition: target_xml.c:130
probepoint_whence_t whence
Definition: probe.h:231
target_type_t supported_overlay_types
Definition: target_api.h:2085