c = unlang_group_to_generic(g);
c->parent = parent;
c->type = ext->type;
+ c->ci = CF_TO_ITEM(cs);
return g;
}
c->name = cf_section_name1(cs);
c->debug_name = c->name;
c->type = UNLANG_TYPE_EDIT;
+ c->ci = CF_TO_ITEM(cs);
map_list_init(&edit->maps);
edit_free = edit;
c->name = cf_pair_attr(cp);
c->debug_name = c->name;
c->type = UNLANG_TYPE_EDIT;
+ c->ci = CF_TO_ITEM(cp);
map_list_init(&edit->maps);
edit_free = edit;
c->name = p;
c->debug_name = c->name;
c->type = UNLANG_TYPE_TMPL;
+ c->ci = CF_TO_ITEM(cp);
RULES_VERIFY(unlang_ctx->rules);
slen = tmpl_afrom_substr(ut, &vpt,
c->name = talloc_typed_strdup(c, realname);
c->debug_name = c->name;
c->type = UNLANG_TYPE_MODULE;
+ c->ci = ci;
/*
* Set the default actions for this module.
#include "module_priv.h"
#include "parallel_priv.h"
+
/** The default interpreter instance for this thread
*/
static _Thread_local unlang_interpret_t *intp_thread_default;
}
/*
- * Line number of the current section.
+ * All of the remaining things need a CONF_ITEM.
*/
- if (strcmp(fmt, "line") == 0) {
- unlang_group_t const *g;
-
- if (!unlang_ops[instruction->type].debug_braces) {
- if (fr_value_box_bstrndup(ctx, vb, NULL, "???", 3, false) < 0) goto error;
+ if (!instruction->ci) {
+ if (fr_value_box_bstrndup(ctx, vb, NULL, "???", 3, false) < 0) goto error;
goto finish;
- }
-
- g = (unlang_group_t const *) instruction;
- fr_assert(g->cs != NULL);
+ }
- fr_value_box_int32(vb, NULL, cf_lineno(g->cs), false);
+ /*
+ * Line number of the current section.
+ */
+ if (strcmp(fmt, "line") == 0) {
+ fr_value_box_int32(vb, NULL, cf_lineno(instruction->ci), false);
goto finish;
}
* Filename of the current section.
*/
if (strcmp(fmt, "filename") == 0) {
- unlang_group_t const *g;
-
- if (!unlang_ops[instruction->type].debug_braces) {
- if (fr_value_box_bstrndup(ctx, vb, NULL, "???", 3, false) < 0) goto error;
- goto finish;
- }
-
- g = (unlang_group_t const *) instruction;
- fr_assert(g->cs != NULL);
+ char const *filename = cf_filename(instruction->ci);
- if (fr_value_box_bstrndup(ctx, vb, NULL, cf_filename(g->cs),
- strlen(cf_filename(g->cs)), false) < 0) goto error;
+ if (fr_value_box_bstrndup(ctx, vb, NULL, filename, strlen(filename), false) < 0) goto error;
goto finish;
}