aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-07-01 10:05:03 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-07-01 10:05:03 +0300
commit72645295eec48c30ed6a9b9f8bf21b9f53995524 (patch)
tree4dd74b5c99098c91714da87d14b3e0715428249b
parent82024c4ac22e50de3b0ad36d8aa81c52e7b4c9ae (diff)
downloadegawk-72645295eec48c30ed6a9b9f8bf21b9f53995524.tar.gz
egawk-72645295eec48c30ed6a9b9f8bf21b9f53995524.tar.bz2
egawk-72645295eec48c30ed6a9b9f8bf21b9f53995524.zip
Add FUNCTAB and SYMTAB to variables dumped with -d.
-rw-r--r--ChangeLog5
-rw-r--r--symbol.c6
-rw-r--r--test/ChangeLog1
-rw-r--r--test/dumpvars.ok2
-rw-r--r--test/symtab6.ok2
-rw-r--r--test/symtab8.ok2
6 files changed, 17 insertions, 1 deletions
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 <arnold@skeeve.com>
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 <arnold@skeeve.com>
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