System.err.println("Unable to open file: " + state.infile + ".struct");
System.exit(-1);
} catch (Exception e) {
- // System.out.println(e);
- // e.printStackTrace();
+ System.out.println(e);
+ e.printStackTrace();
return false;
}
System.err.println("Unable to open file: " + state.infile + ".model");
System.exit(-1);
} catch (Exception e) {
- // System.out.println(e);
- // e.printStackTrace();
+ System.out.println(e);
+ e.printStackTrace();
return false;
}
System.err.println("Unable to open file: " + state.infile + ".constraints");
System.exit(-1);
} catch (Exception e) {
- // System.out.println(e);
- // e.printStackTrace();
+ System.out.println(e);
+ e.printStackTrace();
return false;
}
if (newtype == null) {
// type never defined
// #TBD#: replace new ParseNode with original parsenode
- er.report(null, "Undefined type '" + fieldtype.getSymbol() + "'");
- ok = false;
+
+ if (!field.getPtr()) {
+ /* Pointer types don't have to be defined */
+ er.report(null, "Undefined type '" + fieldtype.getSymbol() + "'");
+ ok = false;
+ }
} else {
assert newtype != null;
field.setType(newtype);
}
- }
+ }
}
Iterator labels = type.getLabels();
#include "typedata.h"
#include "elf/dwarf2.h"
-
#define GETTYPE 1
#define POSTNAME 2
#define GETJUSTTYPE 3
+int FOLLOW_PTRS=0;
+
int process_elf_binary_data(char* filename);
char *rootfile=NULL;
dwarf_entry *typeptr=in_ptr->target_ptr;
collection_type* sub_ptr = (collection_type*)(typeptr->entry_ptr);
if (j==0)
- printf("subclasses ");
+ printf("subclass of ");
else
printf(", ");
printf("%s ",sub_ptr->name);
dwarf_entry *type=member_ptr->type_ptr;
char *typestr=printname(type,GETTYPE);
char *poststr=printname(type,POSTNAME);
+ char *newname=NULL;
if (member_ptr->data_member_location>offset) {
printf(" reserved byte[%ld];\n",member_ptr->data_member_location-offset);
offset=member_ptr->data_member_location;
}
offset+=getsize(type);
-
- printf(" %s %s%s;\n",typestr,name,poststr);
+ newname=escapestr(name);
+ printf(" %s %s%s;\n",typestr,newname,poststr);
+ free(newname);
}
}
if (offset<collection_ptr->byte_size)
} else {
member * member_ptr=(member *)entry->entry_ptr;
char *name=member_ptr->name;
+ char *newname=NULL;
dwarf_entry *type=member_ptr->type_ptr;
char *typestr=printname(type,GETTYPE);
char *poststr=printname(type,POSTNAME);
}
offset+=getsize(type);
- printf(" %s %s%s;\n",typestr,name,poststr);
+ newname=escapestr(name);
+ printf(" %s %s%s;\n",typestr,newname,poststr);
+ free(newname);
}
}
return offset;
}
-
-
int getsize(dwarf_entry *type) {
if (type==NULL)
return 0;
return newptr;
}
} else if (op==GETJUSTTYPE) {
+ if (!FOLLOW_PTRS)
+ return NULL;
+
if (modifier_ptr->target_ptr==NULL)
return NULL;
{