diff options
author | Juergen Kahrs <Juergen.Kahrs@googlemail.com> | 2014-06-24 13:18:33 +0200 |
---|---|---|
committer | Juergen Kahrs <Juergen.Kahrs@googlemail.com> | 2014-06-24 13:18:33 +0200 |
commit | f1245d04a9f076773c60499b468f44ed9c91b59b (patch) | |
tree | 2b49234400150bfaac7ebf8c017562300edc7471 /debug.c | |
parent | ee9707cc44eea3ca64cb71666ac3e8ed26a3bb7f (diff) | |
parent | 78ded8ee8f11a321c96417e7d02dac2f5723a221 (diff) | |
download | egawk-f1245d04a9f076773c60499b468f44ed9c91b59b.tar.gz egawk-f1245d04a9f076773c60499b468f44ed9c91b59b.tar.bz2 egawk-f1245d04a9f076773c60499b468f44ed9c91b59b.zip |
Merge remote-tracking branch 'origin/master' into cmake
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -2801,7 +2801,7 @@ debug_prog(INSTRUCTION *pc) unserialize(OPTION); unsetenv("DGAWK_RESTART"); fprintf(out_fp, "Restarting ...\n"); - if (run[0] == 'T') + if (strcasecmp(run, "true") == 0) (void) do_run(NULL, 0); } else if (command_file != NULL) { @@ -4851,7 +4851,7 @@ do_commands(CMDARG *arg, int cmd) struct commands_item *c; if (cmd == D_commands) { - int num, type; + int num = -1, type; if (arg == NULL) type = has_break_or_watch_point(&num, true); else { @@ -5448,6 +5448,7 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) int ecount = 0, pcount = 0; int ret; int save_flags = do_flags; + SRCFILE *the_source; if (prog_running) { this_frame = find_frame(0); @@ -5458,7 +5459,7 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) ctxt = new_context(); ctxt->install_func = append_symbol; /* keep track of newly installed globals */ push_context(ctxt); - (void) add_srcfile(SRC_CMDLINE, arg->a_string, srcfiles, NULL, NULL); + the_source = add_srcfile(SRC_CMDLINE, arg->a_string, srcfiles, NULL, NULL); do_flags = false; ret = parse_program(&code); do_flags = save_flags; @@ -5559,14 +5560,27 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) this_func->param_cnt -= ecount; } - /* always destroy symbol "@eval", however destroy all newly installed + /* + * Always destroy symbol "@eval", however destroy all newly installed * globals only if fatal error (execute_code() returing NULL). */ pop_context(); /* switch to prev context */ free_context(ctxt, (ret_val != NULL)); /* free all instructions and optionally symbols */ - if (ret_val != NULL) - destroy_symbol(f); /* destroy "@eval" */ + + if (ret_val != NULL) { + /* + * Remove @eval from FUNCTAB, so that above code + * will work the next time around. + */ + NODE *s = make_string("@eval", 5); + + (void) assoc_remove(func_table, s); + unref(s); + } + + free_srcfile(the_source); + return false; } |