diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2018-12-18 11:12:46 -0800 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2018-12-18 11:14:59 -0800 |
commit | e55d03dd47c221f631fe518c623cdd8a703076b2 (patch) | |
tree | a8dad51972e4dd49b401afcc0f08ce4b53b331f1 /output/outdbg.c | |
parent | 8c17bb2fc4d61675b6775e78fbb37b48f19379d3 (diff) | |
download | nasm-e55d03dd47c221f631fe518c623cdd8a703076b2.tar.gz |
Clean up the handling of various passes
The use of pass0, pass1, pass2, and "pass" passed as an argument is
really confusing and already caused a severe bug in the 2.14.01
release cycle. Clean them up and be far more explicit about what
various passes mean.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'output/outdbg.c')
-rw-r--r-- | output/outdbg.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/output/outdbg.c b/output/outdbg.c index b5496b98..e5f15ef7 100644 --- a/output/outdbg.c +++ b/output/outdbg.c @@ -75,8 +75,8 @@ static void dbg_init(void) static void dbg_reset(void) { - fprintf(ofile, "*** pass reset: pass0 = %d, passn = %"PRId64"\n", - pass0, passn); + fprintf(ofile, "*** pass reset: pass = %"PRId64" (%s)\n", + pass_count(), pass_type_name()); } static void dbg_cleanup(void) @@ -90,8 +90,7 @@ static void dbg_cleanup(void) } } -static int32_t dbg_add_section(char *name, int pass, int *bits, - const char *whatwecallit) +static int32_t dbg_add_section(char *name, int *bits, const char *whatwecallit) { int seg; @@ -121,8 +120,8 @@ static int32_t dbg_add_section(char *name, int pass, int *bits, s->number = seg = seg_alloc(); s->next = dbgsect; dbgsect = s; - fprintf(ofile, "%s %s (%s) pass %d: returning %d\n", - whatwecallit, name, tail, pass, seg); + fprintf(ofile, "%s %s (%s) pass %"PRId64" (%s) : returning %d\n", + whatwecallit, name, tail, pass_count(), pass_type_name(), seg); if (section_labels) backend_label(s->name, s->number + 1, 0); @@ -131,9 +130,9 @@ static int32_t dbg_add_section(char *name, int pass, int *bits, return seg; } -static int32_t dbg_section_names(char *name, int pass, int *bits) +static int32_t dbg_section_names(char *name, int *bits) { - return dbg_add_section(name, pass, bits, "section_names"); + return dbg_add_section(name, bits, "section_names"); } static int32_t dbg_herelabel(const char *name, enum label_type type, @@ -323,7 +322,7 @@ static void dbg_sectalign(int32_t seg, unsigned int value) } static enum directive_result -dbg_directive(enum directive directive, char *value, int pass) +dbg_directive(enum directive directive, char *value) { switch (directive) { /* @@ -334,7 +333,7 @@ dbg_directive(enum directive directive, char *value, int pass) case D_GROUP: { int dummy; - dbg_add_section(value, pass, &dummy, "directive:group"); + dbg_add_section(value, &dummy, "directive:group"); break; } @@ -342,8 +341,8 @@ dbg_directive(enum directive directive, char *value, int pass) break; } - fprintf(ofile, "directive [%s] value [%s] (pass %d)\n", - directive_dname(directive), value, pass); + fprintf(ofile, "directive [%s] value [%s] pass %"PRId64" (%s)\n", + directive_dname(directive), value, pass_count(), pass_type_name()); return DIRR_OK; } |