24 static struct vmi1__DebugFileOptsT defDebugFileOpts = {
25 .debugfileRefDepth = 1,
32 static void *_soap_calloc(
struct soap *soap,
size_t size) {
35 r = soap_malloc(soap,size);
41 struct vmi1__LocationT *
43 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
45 struct vmi1__LocationT *vl;
49 vl = _soap_calloc(soap,1*
sizeof(*vl));
52 opts = &defDebugFileOpts;
57 vl->locationType = _vmi1__LocationT_locationType__addr;
58 vl->__union_LocationT = SOAP_UNION__vmi1__union_LocationT_addr;
62 vl->locationType = _vmi1__LocationT_locationType__reg;
63 vl->__union_LocationT = SOAP_UNION__vmi1__union_LocationT_reg;
67 vl->locationType = _vmi1__LocationT_locationType__regAddr;
68 vl->__union_LocationT = SOAP_UNION__vmi1__union_LocationT_regAddr;
72 vl->locationType = _vmi1__LocationT_locationType__regOffset;
73 vl->__union_LocationT = SOAP_UNION__vmi1__union_LocationT_regOffset;
74 vl->union_LocationT.regOffset = \
75 _soap_calloc(soap,1*
sizeof(*vl->union_LocationT.regOffset));
76 vl->union_LocationT.regOffset->reg = (
REG)(l)->extra;
77 vl->union_LocationT.regOffset->offset = (l)->l.
offset;
80 vl->locationType = _vmi1__LocationT_locationType__fbRegOffset;
81 vl->__union_LocationT = SOAP_UNION__vmi1__union_LocationT_fbRegOffset;
85 vl->locationType = _vmi1__LocationT_locationType__memberOffset;
86 vl->__union_LocationT = SOAP_UNION__vmi1__union_LocationT_memberOffset;
90 vl->locationType = _vmi1__LocationT_locationType__runtime;
91 vl->__union_LocationT = SOAP_UNION__vmi1__union_LocationT_runtimeLoc;
93 vl->union_LocationT.runtimeLoc.__size);
96 vl->locationType = _vmi1__LocationT_locationType__list;
97 vl->__union_LocationT = SOAP_UNION__vmi1__union_LocationT_locList;
98 vl->union_LocationT.locList = \
99 _soap_calloc(soap,1*
sizeof(*vl->union_LocationT.locList));
105 loclistloc = loclistloc->
next;
109 vl->union_LocationT.locList->__sizelocListLoc = count;
111 vl->union_LocationT.locList->locListLoc = \
114 sizeof(*vl->union_LocationT.locList->locListLoc));
117 struct _vmi1__locListLoc *lll = \
118 &vl->union_LocationT.locList->locListLoc[
i];
120 lll->start = loclistloc->
start;
121 lll->end = loclistloc->
end;
125 opts,reftab,refstack,depth);
128 loclistloc = loclistloc->
next;
134 vl->locationType = _vmi1__LocationT_locationType__none;
135 vl->__union_LocationT = 0;
142 struct vmi1__RangesT *
144 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
146 struct vmi1__RangesT *vr;
154 opts = &defDebugFileOpts;
156 vr = _soap_calloc(soap,1*
sizeof(*vr));
167 vr->__sizerange = count;
169 vr->range = _soap_calloc(soap,count*
sizeof(*vr->range));
173 vr->range[
i].end = tr->
end;
182 #define FILL_SYMBOLHEADER(s,r,reft,refv) \
189 _rc = snprintf(_idbuf,_idblen,"%s%d",reft,refv); \
190 _rc = (_rc > _idblen) ? _idblen : (_rc + 1); \
191 (r)->sid = _soap_calloc(soap,_rc); \
192 strncpy((r)->sid,_idbuf,_rc); \
193 if (symbol_get_name(s)) { \
194 _name = symbol_get_name((s)); \
195 _rc = strlen(_name) + 1; \
196 (r)->name = _soap_calloc(soap,_rc); \
197 strncpy((r)->name,_name,_rc); \
201 #define FILL_SYMBOLCOMMON(typename,s,r) \
203 struct __vmi1__ ## typename ## _sequence *guts; \
204 struct _vmi1__declaration *_decl; \
205 struct vmi1__SizeT *_size; \
207 guts = (r)->__ ## typename ## _sequence; \
209 if (SYMBOL_IS_DWARF((s))) \
210 guts->source = _vmi1__source__dwarf; \
211 else if (SYMBOL_IS_ELF((s))) \
212 guts->source = _vmi1__source__elf; \
214 _decl = _soap_calloc(soap,sizeof(*_decl)); \
215 _decl->isExternal = (enum xsd__boolean)((s)->isexternal & 1); \
216 _decl->isDeclaration = (enum xsd__boolean)((s)->isdeclaration & 1); \
217 _decl->isPrototyped = (enum xsd__boolean)((s)->isprototyped & 1); \
218 guts->declaration = _decl; \
220 if ((s)->size_is_bytes || (s)->size_is_bits) { \
221 _size = _soap_calloc(soap,sizeof(*_size)); \
222 _size->byteSize = symbol_get_bytesize((s)); \
224 if ((s)->size_is_bytes) { \
225 _size->sizeType = _vmi1__SizeT_sizeType__byte; \
227 else if ((s)->size_is_bits) { \
228 _size->sizeType = _vmi1__SizeT_sizeType__bit; \
229 _size->__size_SizeT_sequence = 1; \
230 _size->__SizeT_sequence = \
231 _soap_calloc(soap,sizeof(*_size->__SizeT_sequence)); \
232 _size->__SizeT_sequence->bitSize = symbol_get_bitsize(s); \
233 _size->__SizeT_sequence->bitOffset = symbol_get_bitoffset(s); \
234 _size->__SizeT_sequence->containingTypeByteSize = \
235 symbol_get_bitctbytes(s); \
238 guts->size = _size; \
242 #define FILL_SYMBOLCOMMON_NOSEQ(typename,s,r) \
244 struct _vmi1__declaration *_decl; \
245 struct vmi1__SizeT *_size; \
247 if (SYMBOL_IS_DWARF((s))) \
248 (r)->source = _vmi1__source__dwarf; \
249 else if (SYMBOL_IS_ELF((s))) \
250 (r)->source = _vmi1__source__elf; \
252 _decl = _soap_calloc(soap,sizeof(*_decl)); \
253 _decl->isExternal = (enum xsd__boolean)((s)->isexternal & 1); \
254 _decl->isDeclaration = (enum xsd__boolean)((s)->isdeclaration & 1); \
255 _decl->isPrototyped = (enum xsd__boolean)((s)->isprototyped & 1); \
256 (r)->declaration = _decl; \
258 if ((s)->size_is_bytes || (s)->size_is_bits) { \
259 _size = _soap_calloc(soap,sizeof(*_size)); \
260 _size->byteSize = symbol_get_bytesize((s)); \
262 if ((s)->size_is_bytes) { \
263 _size->sizeType = _vmi1__SizeT_sizeType__byte; \
265 else if ((s)->size_is_bits) { \
266 _size->sizeType = _vmi1__SizeT_sizeType__bit; \
267 _size->__size_SizeT_sequence = 1; \
268 _size->__SizeT_sequence = \
269 _soap_calloc(soap,sizeof(*_size->__SizeT_sequence)); \
270 _size->__SizeT_sequence->bitSize = symbol_get_bitsize(s); \
271 _size->__SizeT_sequence->bitOffset = symbol_get_bitoffset(s); \
272 _size->__SizeT_sequence->containingTypeByteSize = \
273 symbol_get_bitctbytes(s); \
280 #define FILL_SYMBOLTYPE(typename,s,r) \
282 (r)->__ ## typename ## _sequence->symtype = \
283 d_symbol_to_x_SymbolT(soap,(s)->datatype,(opts), \
284 (reftab),(refstack),(depth)+1);
286 #define FILL_INSTANCESYMBOLCONTENTS(typename,s,opts,reftab,refstack,depth,r) \
288 struct __vmi1__ ## typename ## _sequence *guts; \
289 struct _vmi1__inlineInfo *_inline = NULL; \
290 struct symbol_inline *_ii; \
292 guts = (r)->__ ## typename ## _sequence; \
294 if ((s)->has_addr) { \
295 guts->addr = _soap_calloc(soap,sizeof(*guts->addr)); \
296 *guts->addr = s->addr; \
299 _ii = SYMBOLX_INLINE((s)); \
300 if ((s)->isinlineinstance || (s)->isdeclinline || (s)->isinlined) { \
301 _inline = _soap_calloc(soap,sizeof(*guts->inlineInfo)); \
302 if (_ii && _ii->origin) { \
304 d_symbol_to_x_SymbolT(soap,_ii->origin,(opts), \
305 (reftab),(refstack),(depth)+1); \
307 _inline->isInlineInstance = (enum xsd__boolean) \
308 (s->isinlineinstance & 1); \
309 _inline->isDeclaredInline = (enum xsd__boolean) \
310 ((s)->isdeclinline & 1); \
311 _inline->isInlined = (enum xsd__boolean) \
312 ((s)->isinlined & 1); \
313 if (_ii && _ii->inline_instances) { \
314 _inline->instances = \
315 d_symbol_gslist_to_x_SymbolsT(soap, \
316 _ii->inline_instances, \
317 (opts),(reftab),(refstack),(depth)+1); \
320 guts->inlineInfo = _inline; \
323 #define REF_ALLOC_SEQ(typename,r,rs) \
324 if (!(r)->__ ## typename ## _sequence) { \
325 (r)->__size_ ## typename ## _sequence = 1; \
326 (r)->__ ## typename ## _sequence = \
327 _soap_calloc(soap,sizeof(*(r)->__ ## typename ## _sequence)); \
329 rs = (r)->__ ## typename ## _sequence;
331 #define REF_ALLOC_SEQ_NOSET(typename,r) \
332 if (!(r)->__ ## typename ## _sequence) { \
333 (r)->__size_ ## typename ## _sequence = 1; \
334 (r)->__ ## typename ## _sequence = \
335 _soap_calloc(soap,sizeof(*(r)->__ ## typename ## _sequence)); \
338 #define CLEANUP_REF(objtype,typename,s,opts,reftab,refstack,depth,r) \
340 array_list_remove(refstack);
345 #define RETURN_REF_OR_ALLOC(objtype,typename,s,reft,refv,opts,reftab,refstack,depth,r) \
347 typeof(r) _r = NULL; \
349 char *_name = objtype ## _get_name(s); \
362 && (_r = (typeof(r))g_hash_table_lookup(reftab,(gpointer)s)) \
363 && ((opts)->doMultiRef \
364 || (depth < (opts)-> objtype ## RefDepth \
365 && !(opts)->doManualRef \
366 && (_rfound = array_list_find(refstack,_r)) < 0))) { \
369 vdebug(5,LA_XML,LF_XML, \
370 "reusing encoded %s(%s) at (d=%d,%d/%d)" \
371 " (multiref=%d)\n", \
372 _name,_r->sid,depth, \
373 (opts)->symbolRefDepth,(opts)->scopeRefDepth, \
374 (opts)->doMultiRef); \
376 return (typeof(r))_r; \
380 vdebug(5,LA_XML,LF_XML, \
381 "copying encoded %s(%s) at (d=%d,%d/%d)" \
382 " (multiref=%d)\n", \
383 _name,_r->sid,depth, \
384 (opts)->symbolRefDepth,(opts)->scopeRefDepth, \
385 (opts)->doMultiRef); \
387 memcpy(r,_r,sizeof(r)); \
389 return (typeof(r))_r; \
396 if (_r && (opts)->doManualRef) { \
398 (r) = _soap_calloc(soap,sizeof(*(r))); \
400 _rc = snprintf(_idbuf,_idblen,"%s%d",reft,refv); \
401 _rc = (_rc > _idblen) ? _idblen : (_rc + 1); \
402 (r)->sref = _soap_calloc(soap,_rc); \
403 strncpy((r)->sref,_idbuf,_rc); \
407 vdebug(5,LA_XML,LF_XML, \
408 "encoding manual ref for %s(%s)" \
409 " at (d=%d,%d/%d)\n", \
410 _name,(r)->sref,depth, \
411 opts->symbolRefDepth,opts->scopeRefDepth); \
413 return (typeof(r))r; \
415 else if (_r && _rfound > -1) { \
417 (r) = _soap_calloc(soap,sizeof(*(r))); \
419 _rc = snprintf(_idbuf,_idblen,"%s%d",reft,refv); \
420 _rc = (_rc > _idblen) ? _idblen : (_rc + 1); \
421 (r)->sref = _soap_calloc(soap,_rc); \
422 strncpy((r)->sref,_idbuf,_rc); \
426 vdebug(5,LA_XML,LF_XML, \
427 "forcing (cyclic) manual ref for %s(%s)" \
428 " at (d=%d,%d/%d)\n", \
429 _name,(r)->sref,depth, \
430 opts->symbolRefDepth,opts->scopeRefDepth); \
432 return (typeof(r))r; \
434 else if (depth >= (opts)-> objtype ## RefDepth) { \
436 (r) = _soap_calloc(soap,sizeof(*(r))); \
438 _rc = snprintf(_idbuf,_idblen,"%s%d",reft,refv); \
439 _rc = (_rc > _idblen) ? _idblen : (_rc + 1); \
440 (r)->sref = _soap_calloc(soap,_rc); \
441 strncpy((r)->sref,_idbuf,_rc); \
445 if (objtype ## _get_name(s)) { \
446 _rc = strlen(_name) + 1; \
447 (r)->name = _soap_calloc(soap,_rc); \
448 strncpy((r)->name,_name,_rc); \
451 vdebug(5,LA_XML,LF_XML, \
452 "encoding fetchable ref for %s(%s)" \
453 " at (d=%d,%d/%d)\n", \
454 _name,(r)->sref,depth, \
455 opts->symbolRefDepth,opts->scopeRefDepth); \
457 return (typeof(r))r; \
465 (r) = _soap_calloc(soap,sizeof(*(r))); \
468 _rc = snprintf(_idbuf,_idblen,"%s%d",reft,refv); \
469 _rc = (_rc > _idblen) ? _idblen : (_rc + 1); \
470 (r)->sref = _soap_calloc(soap,_rc); \
471 strncpy((r)->sref,_idbuf,_rc); \
475 vdebug(5,LA_XML,LF_XML, \
476 "encoding full %s(%"PRIiSMOFFSET")" \
477 " at (d=%d,%d/%d)\n", \
478 _name,(r)->sref,depth, \
479 opts->symbolRefDepth,opts->scopeRefDepth); \
482 g_hash_table_insert(reftab,(gpointer)s,(gpointer)r);\
483 array_list_append(refstack,r); \
489 static inline char *_ref_build_int(
struct soap *soap,
char *reft,
int refv) {
494 rc = snprintf(idbuf,
sizeof(idbuf),
"%s%d",reft,refv);
495 rc = (rc > (int)
sizeof(idbuf)) ? (
int)
sizeof(idbuf) : (rc + 1);
496 retval = _soap_calloc(soap,rc);
497 strncpy(retval,idbuf,rc);
502 struct vmi1__VariableT *
504 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
506 struct vmi1__VariableT *r = NULL;
507 struct __vmi1__VariableT_sequence *rs;
510 opts = &defDebugFileOpts;
520 rs->kind = _vmi1__kind__parameter;
522 rs->kind = _vmi1__kind__member;
524 rs->kind = _vmi1__kind__enumerator;
526 rs->kind = _vmi1__kind__variable;
532 opts,reftab,refstack,depth);
536 rs->location = _soap_calloc(soap,
sizeof(*rs->location));
537 rs->location->__union_LocationT = 0;
538 rs->location->locationType = _vmi1__LocationT_locationType__none;
546 struct vmi1__FunctionT *
548 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
550 struct vmi1__FunctionT *r = NULL;
551 struct __vmi1__FunctionT_sequence *rs;
555 opts = &defDebugFileOpts;
564 rs->hasUnspecifiedParams = \
571 rs->entryPC = _soap_calloc(soap,
sizeof(*rs->entryPC));
575 rs->prologueEnd = _soap_calloc(soap,
sizeof(*rs->prologueEnd));
579 rs->prologueEnd = _soap_calloc(soap,
sizeof(*rs->prologueEnd));
583 rs->epilogueBegin = _soap_calloc(soap,
sizeof(*rs->epilogueBegin));
595 opts,reftab,refstack,depth+1);
598 rs->parameters = _soap_calloc(soap,
sizeof(*rs->parameters));
603 opts,reftab,refstack,depth+1,NULL);
611 struct vmi1__LabelT *
613 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
615 struct vmi1__LabelT *r = NULL;
618 opts = &defDebugFileOpts;
632 struct vmi1__BlockT *
634 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
636 struct vmi1__BlockT *r = NULL;
637 struct __vmi1__BlockT_sequence *rs;
641 opts = &defDebugFileOpts;
653 opts,reftab,refstack,depth+1,NULL);
663 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
665 struct vmi1__RootT *r = NULL;
669 opts = &defDebugFileOpts;
688 opts,reftab,refstack,depth+1,NULL);
696 struct vmi1__VoidTypeT *
698 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
700 struct vmi1__VoidTypeT *r = NULL;
703 opts = &defDebugFileOpts;
710 r->source = _vmi1__source__dwarf;
712 r->source = _vmi1__source__elf;
719 struct vmi1__BaseTypeT *
721 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
723 struct vmi1__BaseTypeT *r = NULL;
724 struct __vmi1__BaseTypeT_sequence *rs;
727 opts = &defDebugFileOpts;
738 rs->encoding = _vmi1__encoding__address;
741 rs->encoding = _vmi1__encoding__boolean;
744 rs->encoding = _vmi1__encoding__complexFloat;
747 rs->encoding = _vmi1__encoding__float_;
750 rs->encoding = _vmi1__encoding__signed_;
753 rs->encoding = _vmi1__encoding__signedChar;
756 rs->encoding = _vmi1__encoding__unsigned_;
759 rs->encoding = _vmi1__encoding__unsignedChar;
762 rs->encoding = _vmi1__encoding__imaginaryFloat;
765 rs->encoding = _vmi1__encoding__packedDecimal;
768 rs->encoding = _vmi1__encoding__numericString;
771 rs->encoding = _vmi1__encoding__edited;
774 rs->encoding = _vmi1__encoding__signedFixed;
777 rs->encoding = _vmi1__encoding__unsignedFixed;
780 rs->encoding = _vmi1__encoding__unknown;
790 struct vmi1__PointerTypeT *
792 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
794 struct vmi1__PointerTypeT *r = NULL;
797 opts = &defDebugFileOpts;
811 struct vmi1__RefTypeT *
813 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
815 struct vmi1__RefTypeT *r = NULL;
818 opts = &defDebugFileOpts;
832 struct vmi1__TypedefTypeT *
834 struct vmi1__DebugFileOptsT *
opts,
835 GHashTable *reftab,
struct array_list *refstack,
837 struct vmi1__TypedefTypeT *r = NULL;
840 opts = &defDebugFileOpts;
854 struct vmi1__ConstTypeT *
856 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
858 struct vmi1__ConstTypeT *r = NULL;
861 opts = &defDebugFileOpts;
875 struct vmi1__VolatileTypeT *
877 struct vmi1__DebugFileOptsT *
opts,
878 GHashTable *reftab,
struct array_list *refstack,
880 struct vmi1__VolatileTypeT *r = NULL;
883 opts = &defDebugFileOpts;
897 struct vmi1__ArrayTypeT *
899 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
901 struct vmi1__ArrayTypeT *r = NULL;
902 struct __vmi1__ArrayTypeT_sequence *rs;
907 opts = &defDebugFileOpts;
918 rs->subrangeCount = g_slist_length(l);
919 rs->subranges = _soap_calloc(soap,
sizeof(*rs->subranges));
920 rs->subranges->__sizesubrange = rs->subrangeCount;
921 if (rs->subrangeCount) {
922 rs->subranges->subrange = \
924 rs->subrangeCount *
sizeof(*rs->subranges->subrange));
927 rs->subranges->subrange[
i] = (int)(uintptr_t)g_slist_nth_data(l,0);
939 #define FILL_MEMBERS(s,rs,soap,opts,reftab,refstack,depth) \
941 GSList *_members = SYMBOLX_MEMBERS(s); \
944 rs->memberCount = (int)(uintptr_t)g_slist_length(_members); \
946 d_symbol_gslist_to_x_SymbolsOptT(soap,_members,opts,reftab, \
947 refstack,(depth)+1); \
950 rs->memberCount = 0; \
951 rs->members = NULL; \
955 struct vmi1__EnumTypeT *
957 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
959 struct vmi1__EnumTypeT *r = NULL;
960 struct __vmi1__EnumTypeT_sequence *rs;
963 opts = &defDebugFileOpts;
979 struct vmi1__StructTypeT *
981 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
983 struct vmi1__StructTypeT *r = NULL;
984 struct __vmi1__StructTypeT_sequence *rs;
987 opts = &defDebugFileOpts;
1003 struct vmi1__ClassTypeT *
1005 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
1007 struct vmi1__ClassTypeT *r = NULL;
1008 struct __vmi1__ClassTypeT_sequence *rs;
1011 opts = &defDebugFileOpts;
1027 struct vmi1__NamespaceTypeT *
1029 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
1031 struct vmi1__NamespaceTypeT *r = NULL;
1032 struct __vmi1__NamespaceTypeT_sequence *rs;
1035 opts = &defDebugFileOpts;
1051 struct vmi1__TemplateTypeT *
1053 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
1055 struct vmi1__TemplateTypeT *r = NULL;
1056 struct __vmi1__TemplateTypeT_sequence *rs;
1059 opts = &defDebugFileOpts;
1075 struct vmi1__UnionTypeT *
1077 struct vmi1__DebugFileOptsT *
opts,GHashTable *reftab,
1079 struct vmi1__UnionTypeT *r = NULL;
1080 struct __vmi1__UnionTypeT_sequence *rs;
1083 opts = &defDebugFileOpts;
1099 struct vmi1__FunctionTypeT *
1101 struct vmi1__DebugFileOptsT *
opts,
1102 GHashTable *reftab,
struct array_list *refstack,
1104 struct vmi1__FunctionTypeT *r = NULL;
1105 struct __vmi1__FunctionTypeT_sequence *rs;
1109 opts = &defDebugFileOpts;
1120 rs->parameterCount = (int)(uintptr_t)g_slist_length(members);
1123 refstack,(depth)+1);
1126 rs->parameterCount = 0;
1127 rs->parameters = NULL;
1140 struct vmi1__SymbolT *
1142 struct vmi1__DebugFileOptsT *
opts,
1143 GHashTable *reftab,
struct array_list *refstack,
int depth) {
1144 struct vmi1__SymbolT *r;
1147 opts = &defDebugFileOpts;
1149 r = (
struct vmi1__SymbolT *)_soap_calloc(soap,
sizeof(*r));
1152 r->union_SymbolT.variable =
\
1154 r->__union_SymbolT = \
1155 SOAP_UNION__vmi1__union_SymbolT_variable;
1158 r->union_SymbolT.function =
\
1160 r->__union_SymbolT = \
1161 SOAP_UNION__vmi1__union_SymbolT_function;
1164 r->union_SymbolT.label =
\
1166 r->__union_SymbolT = \
1167 SOAP_UNION__vmi1__union_SymbolT_label;
1172 r->union_SymbolT.voidType =
\
1174 r->__union_SymbolT = \
1175 SOAP_UNION__vmi1__union_SymbolT_voidType;
1178 r->union_SymbolT.arrayType =
\
1180 r->__union_SymbolT = \
1181 SOAP_UNION__vmi1__union_SymbolT_arrayType;
1184 r->union_SymbolT.structType =
\
1186 r->__union_SymbolT = \
1187 SOAP_UNION__vmi1__union_SymbolT_structType;
1190 r->union_SymbolT.enumType =
\
1192 r->__union_SymbolT = \
1193 SOAP_UNION__vmi1__union_SymbolT_enumType;
1196 r->union_SymbolT.pointerType =
\
1198 r->__union_SymbolT = \
1199 SOAP_UNION__vmi1__union_SymbolT_pointerType;
1202 r->union_SymbolT.functionType =
\
1204 r->__union_SymbolT = \
1205 SOAP_UNION__vmi1__union_SymbolT_functionType;
1208 r->union_SymbolT.typedefType =
\
1210 r->__union_SymbolT = \
1211 SOAP_UNION__vmi1__union_SymbolT_typedefType;
1214 r->union_SymbolT.unionType =
\
1216 r->__union_SymbolT = \
1217 SOAP_UNION__vmi1__union_SymbolT_unionType;
1220 r->union_SymbolT.baseType =
\
1222 r->__union_SymbolT = \
1223 SOAP_UNION__vmi1__union_SymbolT_baseType;
1226 r->union_SymbolT.constType =
\
1228 r->__union_SymbolT = \
1229 SOAP_UNION__vmi1__union_SymbolT_constType;
1232 r->union_SymbolT.volatileType =
\
1234 r->__union_SymbolT = \
1235 SOAP_UNION__vmi1__union_SymbolT_volatileType;
1252 struct vmi1__SymbolsT *
1255 struct vmi1__DebugFileOptsT *
opts,
1259 int len = array_list_len(list);
1261 struct vmi1__SymbolsT *r;
1262 union _vmi1__union_SymbolsT *ui;
1266 opts = &defDebugFileOpts;
1268 r = _soap_calloc(soap,
sizeof(*r));
1270 r->__size_SymbolsT =
len;
1271 r->__union_SymbolsT = _soap_calloc(soap,len*
sizeof(*r->__union_SymbolsT));
1273 for (i = 0; i <
len; ++
i) {
1274 s = (
struct symbol *)array_list_item(list,i);
1276 uw = &r->__union_SymbolsT[
i].__union_SymbolsT;
1277 ui = &r->__union_SymbolsT[
i].union_SymbolsT;
1282 *uw = SOAP_UNION__vmi1__union_SymbolsT_variable;
1287 *uw = SOAP_UNION__vmi1__union_SymbolsT_function;
1292 *uw = SOAP_UNION__vmi1__union_SymbolsT_label;
1297 *uw = SOAP_UNION__vmi1__union_SymbolsT_block;
1302 *uw = SOAP_UNION__vmi1__union_SymbolsT_root;
1309 *uw = SOAP_UNION__vmi1__union_SymbolsT_voidType;
1314 *uw = SOAP_UNION__vmi1__union_SymbolsT_arrayType;
1319 *uw = SOAP_UNION__vmi1__union_SymbolsT_structType;
1324 *uw = SOAP_UNION__vmi1__union_SymbolsT_classType;
1327 ui->namespaceType =
\
1329 *uw = SOAP_UNION__vmi1__union_SymbolsT_namespaceType;
1332 ui->templateType =
\
1334 *uw = SOAP_UNION__vmi1__union_SymbolsT_templateType;
1339 *uw = SOAP_UNION__vmi1__union_SymbolsT_enumType;
1344 *uw = SOAP_UNION__vmi1__union_SymbolsT_pointerType;
1349 *uw = SOAP_UNION__vmi1__union_SymbolsT_pointerType;
1352 ui->functionType =
\
1354 *uw = SOAP_UNION__vmi1__union_SymbolsT_functionType;
1359 *uw = SOAP_UNION__vmi1__union_SymbolsT_typedefType;
1364 *uw = SOAP_UNION__vmi1__union_SymbolsT_unionType;
1369 *uw = SOAP_UNION__vmi1__union_SymbolsT_baseType;
1374 *uw = SOAP_UNION__vmi1__union_SymbolsT_constType;
1377 ui->volatileType =
\
1379 *uw = SOAP_UNION__vmi1__union_SymbolsT_volatileType;
1382 verror(
"BUG: bad datatype code %d; skipping!\n",
1384 ui->variable = NULL;
1389 verror(
"BUG: bad symbol type %d; skipping!\n",s->
type);
1390 ui->variable = NULL;
1398 struct vmi1__SymbolsT *
1401 struct vmi1__DebugFileOptsT *
opts,
1405 int len = g_slist_length(list);
1407 struct vmi1__SymbolsT *r;
1408 union _vmi1__union_SymbolsT *ui;
1413 opts = &defDebugFileOpts;
1415 r = _soap_calloc(soap,
sizeof(*r));
1417 r->__size_SymbolsT =
len;
1418 r->__union_SymbolsT = _soap_calloc(soap,len*
sizeof(*r->__union_SymbolsT));
1424 uw = &r->__union_SymbolsT[
i].__union_SymbolsT;
1425 ui = &r->__union_SymbolsT[
i].union_SymbolsT;
1430 *uw = SOAP_UNION__vmi1__union_SymbolsT_variable;
1435 *uw = SOAP_UNION__vmi1__union_SymbolsT_function;
1440 *uw = SOAP_UNION__vmi1__union_SymbolsT_label;
1445 *uw = SOAP_UNION__vmi1__union_SymbolsT_block;
1450 *uw = SOAP_UNION__vmi1__union_SymbolsT_root;
1457 *uw = SOAP_UNION__vmi1__union_SymbolsT_voidType;
1462 *uw = SOAP_UNION__vmi1__union_SymbolsT_arrayType;
1467 *uw = SOAP_UNION__vmi1__union_SymbolsT_structType;
1472 *uw = SOAP_UNION__vmi1__union_SymbolsT_classType;
1475 ui->namespaceType =
\
1477 *uw = SOAP_UNION__vmi1__union_SymbolsT_namespaceType;
1480 ui->templateType =
\
1482 *uw = SOAP_UNION__vmi1__union_SymbolsT_templateType;
1487 *uw = SOAP_UNION__vmi1__union_SymbolsT_enumType;
1492 *uw = SOAP_UNION__vmi1__union_SymbolsT_pointerType;
1497 *uw = SOAP_UNION__vmi1__union_SymbolsT_pointerType;
1500 ui->functionType =
\
1502 *uw = SOAP_UNION__vmi1__union_SymbolsT_functionType;
1507 *uw = SOAP_UNION__vmi1__union_SymbolsT_typedefType;
1512 *uw = SOAP_UNION__vmi1__union_SymbolsT_unionType;
1517 *uw = SOAP_UNION__vmi1__union_SymbolsT_baseType;
1522 *uw = SOAP_UNION__vmi1__union_SymbolsT_constType;
1525 ui->volatileType =
\
1527 *uw = SOAP_UNION__vmi1__union_SymbolsT_volatileType;
1530 verror(
"BUG: bad datatype code %d; skipping!\n",
1532 ui->variable = NULL;
1537 verror(
"BUG: bad symbol type %d; skipping!\n",s->
type);
1538 ui->variable = NULL;
1546 struct vmi1__SymbolsOptT *
1549 struct vmi1__DebugFileOptsT *
opts,
1559 return (
struct vmi1__SymbolsOptT *)
\
1563 struct vmi1__SymbolsOptT *
1566 struct vmi1__DebugFileOptsT *
opts,
1576 return (
struct vmi1__SymbolsOptT *)
\
1580 struct vmi1__DebugFileT *
1582 struct vmi1__DebugFileOptsT *
opts,
1583 GHashTable *reftab,
struct array_list *refstack,
1585 struct vmi1__DebugFileT *r = NULL;
1586 struct __vmi1__DebugFileT_sequence *rs;
1591 opts = &defDebugFileOpts;
1596 *r->sid = _ref_build_int(soap,
"dbg",df->
id);
1600 rs->debugfileType = _vmi1__debugfileType__elf;
1603 rs->debugfileType = _vmi1__debugfileType__dwarf;
1606 rs->debugfileType = _vmi1__debugfileType__none;
1616 rs->debugfileTypeFlags =
1617 _soap_calloc(soap,1 *
sizeof(*rs->debugfileTypeFlags));
1618 rs->debugfileTypeFlags->__sizedebugfileTypeFlag = flen;
1619 rs->debugfileTypeFlags->debugfileTypeFlag =
1620 _soap_calloc(soap,rs->debugfileTypeFlags->__sizedebugfileTypeFlag * \
1621 sizeof(*rs->debugfileTypeFlags->debugfileTypeFlag));
1625 rs->debugfileTypeFlags->debugfileTypeFlag[
i] =
1626 _vmi1__debugfileTypeFlag__kernel;
1630 rs->debugfileTypeFlags->debugfileTypeFlag[
i] =
1631 _vmi1__debugfileTypeFlag__kmod;
1640 gslist = g_hash_table_get_values_slist(df->
srcfiles);
1642 opts,reftab,refstack,depth);
1644 g_slist_free(gslist);
1646 gslist = g_hash_table_get_values_slist(df->
globals);
1648 opts,reftab,refstack,depth);
1650 g_slist_free(gslist);
1657 struct vmi1__ScopeT *
1659 struct vmi1__DebugFileOptsT *
opts,
1660 GHashTable *reftab,
struct array_list *refstack,
int depth,
1661 struct vmi1__ScopeT *ir) {
1662 struct vmi1__ScopeT *r = ir;
1663 struct __vmi1__ScopeT_sequence *rs;
1671 opts = &defDebugFileOpts;
1676 r->sid = _ref_build_int(soap,
"sc",st->
ref);
1695 rs->scopes = _soap_calloc(soap,1 *
sizeof(*rs->scopes));
1696 rs->scopes->__sizescope =
len;
1698 rs->scopes->scope = _soap_calloc(soap,len*
sizeof(*rs->scopes->scope));
1700 rs->scopes->scope = NULL;
1706 &rs->scopes->scope[i]);
1717 reftab,refstack,depth);
1719 g_slist_free(gslist);
1727 reftab,refstack,depth);
1729 g_slist_free(gslist);
1731 CLEANUP_REF(scope,ScopeT,st,opts,reftab,refstack,depth,r);
struct vmi1__ClassTypeT * d_symbol_to_x_ClassTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define LOCATION_ADDR(loc)
struct vmi1__PointerTypeT * d_symbol_to_x_PointerTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define FILL_SYMBOLCOMMON(typename, s, r)
#define SYMBOLX_SUBRANGES(sym)
#define REF_ALLOC_SEQ_NOSET(typename, r)
struct vmi1__RangesT * d_range_to_x_RangesT(struct soap *soap, struct range *r, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define RETURN_REF_OR_ALLOC(objtype, typename, s, reft, refv, opts, reftab, refstack, depth, r)
#define SYMBOL_IS_ELF(sym)
struct vmi1__VariableT * d_symbol_to_x_VariableT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct vmi1__UnionTypeT * d_symbol_to_x_UnionTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
static uint64_t unsigned int i
#define SYMBOLX_MEMBERS(sym)
struct vmi1__SymbolsOptT * d_symbol_gslist_to_x_SymbolsOptT(struct soap *soap, GSList *list, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define FILL_SYMBOLCOMMON_NOSEQ(typename, s, r)
#define v_g_slist_foreach(gslhead, gslcur, elm)
#define SYMBOL_IS_FULL(sym)
struct vmi1__SymbolsT * d_symbol_gslist_to_x_SymbolsT(struct soap *soap, GSList *list, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define LOCATION_LOCLIST(loc)
GSList * symdict_match_syms_by_tab(struct symdict *symdict, struct rfilter *symbol_filter, symbol_type_flag_t flags, int no_main, int no_dup, int no_anon)
#define verror(format,...)
#define SYMBOLX_ROOT(sym)
#define SYMBOLX_VAR_LOC(sym)
struct vmi1__FunctionT * d_symbol_to_x_FunctionT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct vmi1__BaseTypeT * d_symbol_to_x_BaseTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define LOCATION_GET_DATA(loc, buf, buflen)
struct symbol_variable * variable
struct vmi1__SymbolsOptT * d_symbol_array_list_to_x_SymbolsOptT(struct soap *soap, struct array_list *list, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct vmi1__LocationT * d_location_to_x_LocationT(struct soap *soap, struct location *l, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define FILL_SYMBOLHEADER(s, r, reft, refv)
#define SYMBOL_IS_LABEL(sym)
#define LOCATION_OFFSET(loc)
struct vmi1__BlockT * d_symbol_to_x_BlockT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct vmi1__ArrayTypeT * d_symbol_to_x_ArrayTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct vmi1__TypedefTypeT * d_symbol_to_x_TypedefTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
datatype_code_t datatype_code
#define FILL_SYMBOLTYPE(typename, s, r)
struct vmi1__VoidTypeT * d_symbol_to_x_VoidTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct vmi1__RefTypeT * d_symbol_to_x_RefTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct dt_argp_state opts
struct vmi1__SymbolT * d_symbol_to_x_SymbolT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define SYMBOLX_ENCODING_V(sym)
#define SYMBOL_IS_BLOCK(sym)
struct vmi1__StructTypeT * d_symbol_to_x_StructTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define SYMBOL_IS_DWARF(sym)
#define FILL_INSTANCESYMBOLCONTENTS(typename, s, opts, reftab, refstack, depth, r)
struct vmi1__DebugFileT * d_debugfile_to_x_DebugFileT(struct soap *soap, struct debugfile *df, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
unsigned int has_unspec_params
struct vmi1__RootT * d_symbol_to_x_RootT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define REF_ALLOC_SEQ(typename, r, rs)
#define FILL_MEMBERS(s, rs, soap, opts, reftab, refstack, depth)
#define SYMBOL_IS_TYPE(sym)
struct vmi1__VolatileTypeT * d_symbol_to_x_VolatileTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct vmi1__SymbolsT * d_symbol_array_list_to_x_SymbolsT(struct soap *soap, struct array_list *list, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct vmi1__ScopeT * d_scope_to_x_ScopeT(struct soap *soap, struct scope *st, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth, struct vmi1__ScopeT *ir)
#define SYMBOL_IS_ROOT(sym)
#define LOCATION_REG(loc)
debugfile_type_flags_t flags
char * symbol_get_name(struct symbol *symbol)
#define SYMBOLX_FUNC(sym)
struct vmi1__EnumTypeT * d_symbol_to_x_EnumTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct vmi1__ConstTypeT * d_symbol_to_x_ConstTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define SOAP_STRCPY(soap, d, s)
#define CLEANUP_REF(objtype, typename, s, opts, reftab, refstack, depth, r)
struct vmi1__NamespaceTypeT * d_symbol_to_x_NamespaceTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define SYMBOL_IS_FUNC(sym)
struct vmi1__TemplateTypeT * d_symbol_to_x_TemplateTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
struct vmi1__FunctionTypeT * d_symbol_to_x_FunctionTypeT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)
#define SYMBOL_IS_VAR(sym)
#define SYMBOLX_BLOCK(sym)
struct vmi1__LabelT * d_symbol_to_x_LabelT(struct soap *soap, struct symbol *s, struct vmi1__DebugFileOptsT *opts, GHashTable *reftab, struct array_list *refstack, int depth)