#include "dumpstructures.h"
#include "typedata.h"
#include "elf/dwarf2.h"
+#include <string.h>
#define GETTYPE 1
#define POSTNAME 2
int main(int argc, char **argv) {
if (argc<2)
return 0;
- if (argc==3)
+ if (argc>=3)
rootfile=argv[2];
+ if (argc==4&&(strcmp("-r",argv[3])==0))
+ FOLLOW_PTRS=1;
+
process_elf_binary_data(argv[1]);
daikon_preprocess_entry_array();
}
}
}
}
-
+
for (i = 0; i < dwarf_entry_array_size; i++)
{
cur_entry = &dwarf_entry_array[i];
dwarf_entry *type=member_ptr->type_ptr;
char *typestr=printname(type,GETTYPE);
char *poststr=printname(type,POSTNAME);
-
+
if (typestr!=NULL)
value++;
}
struct valuepair *vp=(struct valuepair*)gengettable(ght,collection_ptr->name);
if (vp->index!=i)
continue;
- }
-
+ }
+
for(j=0;j<collection_ptr->num_members;j++) {
dwarf_entry *entry=collection_ptr->members[j];
if (entry->tag_name==DW_TAG_inheritance) {
j++;
}
printf("{ \n");
-
+
for(j=0;j<collection_ptr->num_members;j++) {
dwarf_entry *entry=collection_ptr->members[j];
if (entry->tag_name==DW_TAG_inheritance) {
int j=0;
int offset=0;
int value=0;
-
+
struct valuepair *vp=NULL;
if (gencontains(ght,collection_ptr->name))
vp=(struct valuepair *)gengettable(ght,collection_ptr->name);
offset=member_ptr->data_member_location;
}
offset+=getsize(type);
-
+
newname=escapestr(name);
printf(" %s %s%s;\n",typestr,newname,poststr);
free(newname);
case DW_TAG_pointer_type: {
return 4;
}
- case DW_TAG_union_type:
+ case DW_TAG_union_type:
case DW_TAG_structure_type: {
collection_type *ctype=(collection_type*)type->entry_ptr;
return ctype->byte_size;
case DW_TAG_subroutine_type: {
return 4;
}
- case DW_TAG_typedef:
+ case DW_TAG_typedef:
{
tdef * tdef_ptr=(tdef*)type->entry_ptr;
return getsize(tdef_ptr->target_ptr);
case DW_TAG_subroutine_type: {
return "void";
}
- case DW_TAG_typedef:
+ case DW_TAG_typedef:
{
tdef * tdef_ptr=(tdef*)type->entry_ptr;
if (op==GETTYPE||op==GETJUSTTYPE) {
return NULL;
return "ERROR";
}
-
-