From: Arran Cudbard-Bell Date: Sun, 18 May 2025 19:30:49 +0000 (-0600) Subject: Print what's being expanded in stack_dump X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4de32b3f6b4df73919debbd2cc2b7d859511c03d;p=thirdparty%2Ffreeradius-server.git Print what's being expanded in stack_dump --- diff --git a/src/lib/unlang/xlat.c b/src/lib/unlang/xlat.c index 761e62d09bd..68819f9f5c7 100644 --- a/src/lib/unlang/xlat.c +++ b/src/lib/unlang/xlat.c @@ -816,7 +816,13 @@ int unlang_xlat_eval_type(TALLOC_CTX *ctx, fr_value_box_t *vb, fr_type_t type, f return 0; } +static void unlang_xlat_dump(request_t *request, unlang_stack_frame_t *frame) +{ + unlang_frame_state_xlat_t *state = talloc_get_type_abort(frame->state, unlang_frame_state_xlat_t); + xlat_exp_t const *exp = state->exp; + if (exp) RDEBUG("expression %s", exp->fmt); +} /** Register xlat operation with the interpreter * */ @@ -827,6 +833,7 @@ void unlang_xlat_init(void) .name = "xlat_eval", .interpret = unlang_xlat, .signal = unlang_xlat_signal, + .dump = unlang_xlat_dump, .frame_state_size = sizeof(unlang_frame_state_xlat_t), .frame_state_type = "unlang_frame_state_xlat_t", }); diff --git a/src/tests/keywords/xlat-alternation-with-func b/src/tests/keywords/xlat-alternation-with-func index cbf6a1c4f66..fc56ffc4b99 100644 --- a/src/tests/keywords/xlat-alternation-with-func +++ b/src/tests/keywords/xlat-alternation-with-func @@ -8,9 +8,6 @@ string dummy_string test_string1 := "foo" test_string2 := "bar" -if (!(%{%test.passthrough(%{test_string1}) || %{test_string2}} == 'foo')) { - test_fail -} if (!(%{%test.passthrough(%{dummy_string}) || %{test_string2}} == 'bar')) { test_fail