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