From 72645295eec48c30ed6a9b9f8bf21b9f53995524 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 1 Jul 2016 10:05:03 +0300 Subject: Add FUNCTAB and SYMTAB to variables dumped with -d. --- ChangeLog | 5 +++++ symbol.c | 6 +++++- test/ChangeLog | 1 + test/dumpvars.ok | 2 ++ test/symtab6.ok | 2 ++ test/symtab8.ok | 2 ++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a109b7d3..5e381305 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,11 @@ * gawkapi.c (api_warning): Fix the comment header. (api_lintwarn): Factor out the call to va_end to after the if. + Unrelated: + + * symbol.c (get_symbols): Add FUNCTAB and SYMTAB to the list + for the -d option. Thanks to Hermann Peifer for the report. + 2016-06-26 Arnold D. Robbins Repair change of 2015-08-25 to handling of MAYBE_NUM. diff --git a/symbol.c b/symbol.c index 8533fad6..fe7e3753 100644 --- a/symbol.c +++ b/symbol.c @@ -409,7 +409,8 @@ get_symbols(SYMBOL_TYPE what, bool sort) max = the_table->table_size * 2; list = assoc_list(the_table, "@unsorted", ASORTI); - emalloc(table, NODE **, (var_count + 1) * sizeof(NODE *), "get_symbols"); + /* add three: one for FUNCTAB, one for SYMTAB, and one for a final NULL */ + emalloc(table, NODE **, (var_count + 1 + 1 + 1) * sizeof(NODE *), "get_symbols"); for (i = count = 0; i < max; i += 2) { r = list[i+1]; @@ -417,6 +418,9 @@ get_symbols(SYMBOL_TYPE what, bool sort) continue; table[count++] = r; } + + table[count++] = func_table; + table[count++] = symbol_table; } efree(list); diff --git a/test/ChangeLog b/test/ChangeLog index 585ab146..f7c28922 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -2,6 +2,7 @@ * arrayind1.awk, arrayind1.ok: Comment out prints to stderr to avoid buffer flushing on obscure systems. + * dumpvars.ok, symtab6.ok, symtab8.ok: Update after code changes. 2016-06-14 Arnold D. Robbins diff --git a/test/dumpvars.ok b/test/dumpvars.ok index 73d3d306..85d1c859 100644 --- a/test/dumpvars.ok +++ b/test/dumpvars.ok @@ -9,6 +9,7 @@ FILENAME: "-" FNR: 3 FPAT: "[^[:space:]]+" FS: " " +FUNCTAB: array, 41 elements IGNORECASE: 0 LINT: 0 NF: 1 @@ -23,4 +24,5 @@ RS: "\n" RSTART: 0 RT: "\n" SUBSEP: "\034" +SYMTAB: array, 28 elements TEXTDOMAIN: "messages" diff --git a/test/symtab6.ok b/test/symtab6.ok index 91f27e75..7de717a0 100644 --- a/test/symtab6.ok +++ b/test/symtab6.ok @@ -9,6 +9,7 @@ FILENAME: "" FNR: 0 FPAT: "[^[:space:]]+" FS: " " +FUNCTAB: array, 41 elements IGNORECASE: 0 LINT: 0 NF: 0 @@ -23,4 +24,5 @@ RS: "\n" RSTART: 0 RT: "" SUBSEP: "\034" +SYMTAB: array, 29 elements TEXTDOMAIN: "messages" diff --git a/test/symtab8.ok b/test/symtab8.ok index 724f374b..da29b585 100644 --- a/test/symtab8.ok +++ b/test/symtab8.ok @@ -9,6 +9,7 @@ FIELDWIDTHS: "" FNR: 1 FPAT: "[^[:space:]]+" FS: " " +FUNCTAB: array, 41 elements IGNORECASE: 0 LINT: 0 NF: 1 @@ -23,5 +24,6 @@ RS: "\n" RSTART: 0 RT: "\n" SUBSEP: "\034" +SYMTAB: array, 29 elements TEXTDOMAIN: "messages" test: 1 -- cgit v1.2.3 From ce41ffb80b068139b4e04e3cff1d5dc2ee0ccc78 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 1 Jul 2016 10:07:43 +0300 Subject: Fix test suite after merge from master. --- test/dumpvars.ok | 2 +- test/symtab6.ok | 2 +- test/symtab8.ok | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/dumpvars.ok b/test/dumpvars.ok index 85d1c859..7caecd35 100644 --- a/test/dumpvars.ok +++ b/test/dumpvars.ok @@ -9,7 +9,7 @@ FILENAME: "-" FNR: 3 FPAT: "[^[:space:]]+" FS: " " -FUNCTAB: array, 41 elements +FUNCTAB: array, 42 elements IGNORECASE: 0 LINT: 0 NF: 1 diff --git a/test/symtab6.ok b/test/symtab6.ok index 7de717a0..34c10636 100644 --- a/test/symtab6.ok +++ b/test/symtab6.ok @@ -9,7 +9,7 @@ FILENAME: "" FNR: 0 FPAT: "[^[:space:]]+" FS: " " -FUNCTAB: array, 41 elements +FUNCTAB: array, 42 elements IGNORECASE: 0 LINT: 0 NF: 0 diff --git a/test/symtab8.ok b/test/symtab8.ok index da29b585..0cf40fe9 100644 --- a/test/symtab8.ok +++ b/test/symtab8.ok @@ -9,7 +9,7 @@ FIELDWIDTHS: "" FNR: 1 FPAT: "[^[:space:]]+" FS: " " -FUNCTAB: array, 41 elements +FUNCTAB: array, 42 elements IGNORECASE: 0 LINT: 0 NF: 1 -- cgit v1.2.3