]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Print what's being expanded in stack_dump
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 18 May 2025 19:30:49 +0000 (13:30 -0600)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 18 Jun 2025 12:53:00 +0000 (13:53 +0100)
src/lib/unlang/xlat.c
src/tests/keywords/xlat-alternation-with-func

index 761e62d09bd85454ebc3886963c2b4309d780594..68819f9f5c70b7814b61cf8899d341f7903712d2 100644 (file)
@@ -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",
                           });
index cbf6a1c4f66f9fb22bb6867ce39a32fa3f22ec17..fc56ffc4b9928e0d66c0711bd8ce5635525b94ac 100644 (file)
@@ -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