printing methods
This commit is contained in:
parent
af118981c4
commit
0def8039e1
29
classfile.c
29
classfile.c
@ -456,27 +456,28 @@ void ClassFile_info(const ClassFile* cf) {
|
|||||||
printf("\t%s %s%s%s%s %s", access, flags & ACC_STATIC ? "static " : "", flags & ACC_FINAL ? "final " : "", flags & ACC_VOLATLE ? "volatile " : "",
|
printf("\t%s %s%s%s%s %s", access, flags & ACC_STATIC ? "static " : "", flags & ACC_FINAL ? "final " : "", flags & ACC_VOLATLE ? "volatile " : "",
|
||||||
descriptor, name);
|
descriptor, name);
|
||||||
|
|
||||||
|
// TODO: print field attributes
|
||||||
for (u2 j = 0; j < cf->fields[i].attributes_count; j++) {
|
for (u2 j = 0; j < cf->fields[i].attributes_count; j++) {
|
||||||
switch (cf->fields[i].attributes[j]._tag) {
|
|
||||||
case CONSTANT_VALUE:
|
|
||||||
break;
|
|
||||||
case BOOTSTRAP_METHODS:
|
|
||||||
break;
|
|
||||||
case NEST_HOST:
|
|
||||||
break;
|
|
||||||
case NEST_MEMBERS:
|
|
||||||
break;
|
|
||||||
case PERMITTED_SUBCLASSES:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(";\n");
|
printf(";\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
|
for (u2 i = 0; i < cf->methods_count; i++) {
|
||||||
|
u2 flags = cf->methods[i].access_flags;
|
||||||
|
char* access = flags & ACC_PUBLIC ? "public" : flags & ACC_PRIVATE ? "private" : flags & ACC_PROTECTED ? "protected" : "";
|
||||||
|
char* descriptor = (char*)cf->constant_pool[cf->methods[i].descriptor_index - 1].info.utf8_info.bytes;
|
||||||
|
char* name = (char*)cf->constant_pool[cf->methods[i].name_index - 1].info.utf8_info.bytes;
|
||||||
|
printf("\t%s %s%s%s%s %s", access, flags & ACC_STATIC ? "static " : "", flags & ACC_FINAL ? "final " : "", flags & ACC_VOLATLE ? "volatile " : "",
|
||||||
|
descriptor, name);
|
||||||
|
|
||||||
|
// TODO: print field attributes
|
||||||
|
for (u2 j = 0; j < cf->methods[i].attributes_count; j++) {
|
||||||
|
}
|
||||||
|
|
||||||
|
printf(";\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char* ClassFile_resolve_NameAnyType(const ClassFile* cf, CONSTANT_NameAndType_info info) {
|
char* ClassFile_resolve_NameAnyType(const ClassFile* cf, CONSTANT_NameAndType_info info) {
|
||||||
|
Loading…
Reference in New Issue
Block a user