From 5a7197d76cde55d728dd881a37fc23703104b18e Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 18 Dec 2015 06:57:15 -0800 Subject: debugger: stopped at line nil of nil. Address some situations in which the debug_check call is given a piece of spec with no source loc information attached. * (h_var): Use rlcp when constructing new piece of spec representing a substituted variable, or a spec confined to just search for a piece of text with no trailing match. (do_match_line): Pass the whole specline to debug_check, rather than just the elem, which might just be a string with no location info attached. (match_files): Likewise. --- match.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/match.c b/match.c index 004306fc..ffa249c5 100644 --- a/match.c +++ b/match.c @@ -692,11 +692,12 @@ static val h_var(match_line_ctx *c) } else { /* Re-generate a new spec in which the next variable is replaced by its value, and repeat. */ - c->specline = cons(elem, cons(cdr(pair), rest(c->specline))); + val r = rest(c->specline); + c->specline = rlcp(cons(elem, rlcp(cons(cdr(pair), r), r)), r); return repeat_spec_k; } } else if (op == text_s) { - val text_only_spec = cons(next, nil); + val text_only_spec = rlcp(cons(next, nil), next); val find = search_match(c, modifier, text_only_spec); val fpos = car(find); if (!find) { @@ -1254,7 +1255,7 @@ static val do_match_line(match_line_ctx *c) elem = first(c->specline); - debug_check(elem, c->bindings, c->dataline, c->data_lineno, + debug_check(c->specline, c->bindings, c->dataline, c->data_lineno, c->pos, c->base); switch (type(elem)) { @@ -3961,7 +3962,7 @@ repeat_spec_same_data: open_data_source(&c); - debug_check(first_spec, c.bindings, c.data, c.data_lineno, nil, nil); + debug_check(specline, c.bindings, c.data, c.data_lineno, nil, nil); if (consp(first_spec) && !rest(specline)) { val sym = first(first_spec); -- cgit v1.2.3