diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-06-08 22:59:28 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-06-08 22:59:28 +0300 |
commit | bb331e22c3207863ebd923bd4c8a36c256485c6b (patch) | |
tree | 7039148192ed814eac679ec2ed0e8894b3e18fe8 | |
parent | 4f758771937fcbd59b1fd2db017c4995513c3988 (diff) | |
parent | b504b2707e0780d5f0b347aef9bead0e516813a2 (diff) | |
download | egawk-bb331e22c3207863ebd923bd4c8a36c256485c6b.tar.gz egawk-bb331e22c3207863ebd923bd4c8a36c256485c6b.tar.bz2 egawk-bb331e22c3207863ebd923bd4c8a36c256485c6b.zip |
Merge branch 'gawk-4.1-stable'
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | helpers/ChangeLog | 5 | ||||
-rw-r--r-- | helpers/changed-files.awk | 19 | ||||
-rw-r--r-- | symbol.c | 4 | ||||
-rw-r--r-- | test/ChangeLog | 6 | ||||
-rw-r--r-- | test/Makefile.am | 10 | ||||
-rw-r--r-- | test/Makefile.in | 10 | ||||
-rw-r--r-- | test/symtab10.awk | 1 | ||||
-rw-r--r-- | test/symtab10.in | 4 | ||||
-rw-r--r-- | test/symtab10.ok | 11 |
10 files changed, 74 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2016-06-08 Arnold D. Robbins <arnold@skeeve.com> + + * symbol.c (lookup): If got Node_val, it's a non-variable + in SYMTAB, return NULL. Can affect watchpoints in the debugger, + maybe other places. Thanks to Hermann Peifer for the + test case and report. + 2016-06-05 Arnold D. Robbins <arnold@skeeve.com> * dfa.c: Sync with GNU grep. diff --git a/helpers/ChangeLog b/helpers/ChangeLog index aaf1e489..9802b287 100644 --- a/helpers/ChangeLog +++ b/helpers/ChangeLog @@ -1,3 +1,8 @@ +2016-06-08 Arnold D. Robbins <arnold@skeeve.com> + + * changed-files.awk: New program. Helps find files that need + copyright updates by scanning ChangeLog files. + 2016-03-07 Arnold D. Robbins <arnold@skeeve.com> * fixdump.awk (translate): Remove extraneous spaces in diff --git a/helpers/changed-files.awk b/helpers/changed-files.awk new file mode 100644 index 00000000..937ecd51 --- /dev/null +++ b/helpers/changed-files.awk @@ -0,0 +1,19 @@ +#! /usr/bin/gawk -f + +/^2014-/ { nextfile } + +/^\t\*/ { + sub(/^\t\*[[:space:]]*/, "") + sub(/[:\[(].*/, "") + gsub(/,/, "") + for (i = 1; i <= NF; i++) { + fname = $i + if (! (fname in names)) + names[fname]++ + } +} + +END { + for (i in names) + print i +} @@ -117,7 +117,9 @@ lookup(const char *name) } unref(tmp); - return n; /* NULL or new place */ + if (n == NULL || n->type == Node_val) /* non-variable in SYMTAB */ + return NULL; + return n; /* new place */ } /* make_params --- allocate function parameters for the symbol table */ diff --git a/test/ChangeLog b/test/ChangeLog index a0f8f47a..49ad457e 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2016-06-08 Arnold D. Robbins <arnold@skeeve.com> + + * symtab10.awk, symtab10.in, symtab10.ok: New files. + * Makefile.am (symtab10): New test. + Thanks to Hermann Peifer for the report. + 2016-06-01 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (hex2): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 6e25290d..9d95a609 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1020,6 +1020,9 @@ EXTRA_DIST = \ symtab8.ok \ symtab9.awk \ symtab9.ok \ + symtab10.awk \ + symtab10.in \ + symtab10.ok \ synerr1.awk \ synerr1.ok \ synerr2.awk \ @@ -1170,7 +1173,7 @@ GAWK_EXT_TESTS = \ sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ - symtab7 symtab8 symtab9 \ + symtab7 symtab8 symtab9 symtab10 \ typedregex1 typedregex2 typedregex3 typeof1 typeof2 typeof3 typeof4 \ timeout \ watchpoint1 @@ -2253,6 +2256,11 @@ rscompat: @AWKPATH="$(srcdir)" $(AWK) --traditional -f $@.awk "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +symtab10: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index e2c3e33e..67fc7b45 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1277,6 +1277,9 @@ EXTRA_DIST = \ symtab8.ok \ symtab9.awk \ symtab9.ok \ + symtab10.awk \ + symtab10.in \ + symtab10.ok \ synerr1.awk \ synerr1.ok \ synerr2.awk \ @@ -1426,7 +1429,7 @@ GAWK_EXT_TESTS = \ sortfor sortu split_after_fpat \ splitarg4 strftime \ strtonum switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ - symtab7 symtab8 symtab9 \ + symtab7 symtab8 symtab9 symtab10 \ typedregex1 typedregex2 typedregex3 typeof1 typeof2 typeof3 typeof4 \ timeout \ watchpoint1 @@ -2690,6 +2693,11 @@ rscompat: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --traditional -f $@.awk "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +symtab10: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: diff --git a/test/symtab10.awk b/test/symtab10.awk new file mode 100644 index 00000000..6fbd3994 --- /dev/null +++ b/test/symtab10.awk @@ -0,0 +1 @@ +BEGIN { SYMTAB["x"] ; y=1 ; y++ } diff --git a/test/symtab10.in b/test/symtab10.in new file mode 100644 index 00000000..d9afcd66 --- /dev/null +++ b/test/symtab10.in @@ -0,0 +1,4 @@ +watch y +run +watch x +continue diff --git a/test/symtab10.ok b/test/symtab10.ok new file mode 100644 index 00000000..b0cabd7c --- /dev/null +++ b/test/symtab10.ok @@ -0,0 +1,11 @@ +Watchpoint 1: y +Starting program: +Stopping in BEGIN ... +Watchpoint 1: y + Old value: untyped variable + New value: 1 +main() at `symtab10.awk':1 +1 BEGIN { SYMTAB["x"] ; y=1 ; y++ } +no symbol `x' in current context +Program exited normally with exit value: 0 +EXIT CODE: 2 |