diff --git a/Makefile b/Makefile index 04e6d61..da83501 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ CC ?= gcc ARCH = -m32 CFLAGS += -Wall -Werror -Wfatal-errors -Wno-error=unused-variable -fstack-protector -std=c2x -g CFLAGS += -DDEBUG -#CFLAGS += -DDEBUG_PRINT +CFLAGS += -DDEBUG_PRINT LDFLAGS = -lm OPT ?= -O0 DEPFLAGS = -MMD -MP diff --git a/c/class_resolver.c b/c/class_resolver.c index aeaf892..9c17ed8 100644 --- a/c/class_resolver.c +++ b/c/class_resolver.c @@ -161,8 +161,8 @@ static void class_resolver_create_methods_hash_table(struct class_entry * class_ struct constant * descriptor_constant = &class_file->constant_pool[descriptor_index - 1]; assert(descriptor_constant->tag == CONSTANT_Utf8); debugf("hash table entry for method: "); - print_utf8_string(name_constant); - debugf("\n"); + debug_print__constant__method_name(name_constant, descriptor_constant); + debugc('\n'); hash_table_add2(methods_hash_table_length, methods_hash_table, diff --git a/c/debug.c b/c/debug.c index 1f01408..905bde5 100644 --- a/c/debug.c +++ b/c/debug.c @@ -30,3 +30,12 @@ void debug_print__method_info__method_name(struct class_entry * class_entry, str assert(method_descriptor_constant->tag == CONSTANT_Utf8); debug_print__constant__utf8_string(method_descriptor_constant); } + +void debug_print__constant__method_name(struct constant * name_constant, struct constant * descriptor_constant) +{ + assert(name_constant->tag == CONSTANT_Utf8); + debug_print__constant__utf8_string(name_constant); + debugc(' '); + assert(descriptor_constant->tag == CONSTANT_Utf8); + debug_print__constant__utf8_string(descriptor_constant); +} diff --git a/c/debug.h b/c/debug.h index aa7d923..e2ac9c5 100644 --- a/c/debug.h +++ b/c/debug.h @@ -6,3 +6,4 @@ void debug_print__constant__utf8_string(struct constant * constant); void debug_print__class_entry__class_name(struct class_entry * class_entry); void debug_print__method_info__method_name(struct class_entry * class_entry, struct method_info * method_info); +void debug_print__constant__method_name(struct constant * name_constant, struct constant * descriptor_constant);