diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | awkgram.c | 10 | ||||
-rw-r--r-- | awkgram.y | 10 | ||||
-rw-r--r-- | test/ChangeLog | 6 | ||||
-rw-r--r-- | test/Makefile.am | 10 | ||||
-rw-r--r-- | test/Makefile.in | 10 | ||||
-rw-r--r-- | test/dbugeval2.awk | 4 | ||||
-rw-r--r-- | test/dbugeval2.in | 3 | ||||
-rw-r--r-- | test/dbugeval2.ok | 7 |
9 files changed, 61 insertions, 6 deletions
@@ -1,3 +1,10 @@ +2015-06-29 Arnold D. Robbins <arnold@skeeve.com> + + * awkgram.y (yylex): If gawk extension function is found as + a function in a user-defined function body, treat it normally. + Makes eval "print and(a, 1)" work in the debugger again. + Thanks, yet again, to Hermann Peifer. + 2015-06-28 Arnold D. Robbins <arnold@skeeve.com> Improve memory tracking of typed regexps. @@ -6426,14 +6426,20 @@ retry: /* allow parameter names to shadow the names of gawk extension built-ins */ if ((tokentab[mid].flags & GAWKX) != 0) { + NODE *f; + switch (want_param_names) { case FUNC_HEADER: /* in header, defining parameter names */ goto out; case FUNC_BODY: /* in body, name must be in symbol table for it to be a parameter */ - if (lookup(tokstart) != NULL) - goto out; + if ((f = lookup(tokstart)) != NULL) { + if (f->type == Node_builtin_func) + break; + else + goto out; + } /* else fall through */ case DONT_CHECK: @@ -4006,14 +4006,20 @@ retry: /* allow parameter names to shadow the names of gawk extension built-ins */ if ((tokentab[mid].flags & GAWKX) != 0) { + NODE *f; + switch (want_param_names) { case FUNC_HEADER: /* in header, defining parameter names */ goto out; case FUNC_BODY: /* in body, name must be in symbol table for it to be a parameter */ - if (lookup(tokstart) != NULL) - goto out; + if ((f = lookup(tokstart)) != NULL) { + if (f->type == Node_builtin_func) + break; + else + goto out; + } /* else fall through */ case DONT_CHECK: diff --git a/test/ChangeLog b/test/ChangeLog index f29dea72..c9a8e301 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2015-06-29 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (dbugeval2): New test. + * dbugeval2.awk, dbugeval2.in, dbugeval2.ok: New files. + Thanks to Hermann Peifer for the report. + 2015-06-28 Arnold D. Robbins <arnold@skeeve.com> * Makefile.am (typedregex2): New test. diff --git a/test/Makefile.am b/test/Makefile.am index df1f1e2c..f646bc09 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -177,6 +177,9 @@ EXTRA_DIST = \ datanonl.ok \ dbugeval.in \ dbugeval.ok \ + dbugeval2.awk \ + dbugeval2.in \ + dbugeval2.ok \ dbugtypedre1.awk \ dbugtypedre1.in \ dbugtypedre1.ok \ @@ -1093,7 +1096,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way crlf dbugeval dbugtypedre1 dbugtypedre2 delsub \ + colonwarn clos1way crlf dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 delsub \ devfd devfd1 devfd2 dumpvars errno exit \ fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ @@ -2151,6 +2154,11 @@ dbugtypedre2: @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +dbugeval2: + @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 ec270c1b..981b6377 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -434,6 +434,9 @@ EXTRA_DIST = \ datanonl.ok \ dbugeval.in \ dbugeval.ok \ + dbugeval2.awk \ + dbugeval2.in \ + dbugeval2.ok \ dbugtypedre1.awk \ dbugtypedre1.in \ dbugtypedre1.ok \ @@ -1349,7 +1352,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way crlf dbugeval dbugtypedre1 dbugtypedre2 delsub \ + colonwarn clos1way crlf dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 delsub \ devfd devfd1 devfd2 dumpvars errno exit \ fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ @@ -2586,6 +2589,11 @@ dbugtypedre2: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -D -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +dbugeval2: + @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/dbugeval2.awk b/test/dbugeval2.awk new file mode 100644 index 00000000..4997d1b4 --- /dev/null +++ b/test/dbugeval2.awk @@ -0,0 +1,4 @@ +BEGIN { + a = 2 + b = 3 +} diff --git a/test/dbugeval2.in b/test/dbugeval2.in new file mode 100644 index 00000000..165f7147 --- /dev/null +++ b/test/dbugeval2.in @@ -0,0 +1,3 @@ +b 3 +r +eval "print and(a, 3)" diff --git a/test/dbugeval2.ok b/test/dbugeval2.ok new file mode 100644 index 00000000..4d645269 --- /dev/null +++ b/test/dbugeval2.ok @@ -0,0 +1,7 @@ +Breakpoint 1 set at file `dbugeval2.awk', line 3 +Starting program: +Stopping in BEGIN ... +Breakpoint 1, main() at `dbugeval2.awk':3 +3 b = 3 +2 +EXIT CODE: 2 |