From 7bdebece8b79a7b445370d45028c071ceb1b5234 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 19 Nov 2001 05:48:54 +0000 Subject: [PATCH] Don't print out *all* bytecodes in the label's section for every label! svn path=/trunk/yasm/; revision=349 --- libyasm/section.c | 10 ++++++---- libyasm/section.h | 2 +- libyasm/symrec.c | 2 +- src/section.c | 10 ++++++---- src/section.h | 2 +- src/symrec.c | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) 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) -- 2.40.0