From: Peter Johnson Date: Mon, 19 Nov 2001 05:48:54 +0000 (-0000) Subject: Don't print out *all* bytecodes in the label's section for every label! X-Git-Tag: v0.1.0~181 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bdebece8b79a7b445370d45028c071ceb1b5234;p=yasm Don't print out *all* bytecodes in the label's section for every label! svn path=/trunk/yasm/; revision=349 --- diff --git a/libyasm/section.c b/libyasm/section.c index 1e9f51eb..df38d1dd 100644 --- a/libyasm/section.c +++ b/libyasm/section.c @@ -170,7 +170,7 @@ sections_print(const sectionhead *headp) STAILQ_FOREACH(cur, headp, link) { printf("***SECTION***\n"); - section_print(cur); + section_print(cur, 1); } } @@ -227,7 +227,7 @@ section_delete(section *sect) } void -section_print(const section *sect) +section_print(const section *sect, int print_bcs) { printf(" type="); switch (sect->type) { @@ -247,6 +247,8 @@ section_print(const section *sect) break; } - printf(" Bytecodes:\n"); - bcs_print(§->bc); + if (print_bcs) { + printf(" Bytecodes:\n"); + bcs_print(§->bc); + } } diff --git a/libyasm/section.h b/libyasm/section.h index a2ebcae6..ddfaaddd 100644 --- a/libyasm/section.h +++ b/libyasm/section.h @@ -50,5 +50,5 @@ void sections_parser_finalize(sectionhead *headp); void section_delete(/*@only@*/ section *sect); -void section_print(const section *sect); +void section_print(const section *sect, int print_bcs); #endif diff --git a/libyasm/symrec.c b/libyasm/symrec.c index 041d28fe..f2cc8c4c 100644 --- a/libyasm/symrec.c +++ b/libyasm/symrec.c @@ -297,7 +297,7 @@ symrec_print(const symrec *sym) case SYM_LABEL: printf("_Label_\nSection:"); if (sym->value.label.sect) - section_print(sym->value.label.sect); + section_print(sym->value.label.sect, 0); else printf(" (none)\n"); if (!sym->value.label.bc) diff --git a/src/section.c b/src/section.c index 1e9f51eb..df38d1dd 100644 --- a/src/section.c +++ b/src/section.c @@ -170,7 +170,7 @@ sections_print(const sectionhead *headp) STAILQ_FOREACH(cur, headp, link) { printf("***SECTION***\n"); - section_print(cur); + section_print(cur, 1); } } @@ -227,7 +227,7 @@ section_delete(section *sect) } void -section_print(const section *sect) +section_print(const section *sect, int print_bcs) { printf(" type="); switch (sect->type) { @@ -247,6 +247,8 @@ section_print(const section *sect) break; } - printf(" Bytecodes:\n"); - bcs_print(§->bc); + if (print_bcs) { + printf(" Bytecodes:\n"); + bcs_print(§->bc); + } } diff --git a/src/section.h b/src/section.h index a2ebcae6..ddfaaddd 100644 --- a/src/section.h +++ b/src/section.h @@ -50,5 +50,5 @@ void sections_parser_finalize(sectionhead *headp); void section_delete(/*@only@*/ section *sect); -void section_print(const section *sect); +void section_print(const section *sect, int print_bcs); #endif diff --git a/src/symrec.c b/src/symrec.c index 041d28fe..f2cc8c4c 100644 --- a/src/symrec.c +++ b/src/symrec.c @@ -297,7 +297,7 @@ symrec_print(const symrec *sym) case SYM_LABEL: printf("_Label_\nSection:"); if (sym->value.label.sect) - section_print(sym->value.label.sect); + section_print(sym->value.label.sect, 0); else printf(" (none)\n"); if (!sym->value.label.bc)