diff --git a/src/Debug.cc b/src/Debug.cc index 1763e1b952..1c756820b3 100644 --- a/src/Debug.cc +++ b/src/Debug.cc @@ -25,6 +25,7 @@ #include "zeek/IntrusivePtr.h" #include "zeek/PolicyFile.h" #include "zeek/Reporter.h" +#include "zeek/RunState.h" #include "zeek/Scope.h" #include "zeek/Stmt.h" #include "zeek/Val.h" diff --git a/src/Func.cc b/src/Func.cc index 2a1247d725..e6047df71e 100644 --- a/src/Func.cc +++ b/src/Func.cc @@ -339,8 +339,7 @@ ValPtr ScriptFunc::Invoke(zeek::Args* args, Frame* parent) const { f->SetTriggerAssoc(parent->GetTriggerAssoc()); } - if ( ! g_policy_debug ) - g_frame_stack.push_back(f.get()); // used for backtracing + g_frame_stack.push_back(f.get()); // used for backtracing const CallExpr* call_expr = parent ? parent->GetCall() : nullptr; call_stack.emplace_back(CallInfo{call_expr, this, *args}); @@ -392,8 +391,7 @@ ValPtr ScriptFunc::Invoke(zeek::Args* args, Frame* parent) const { catch ( InterpreterException& e ) { // Already reported, but now determine whether to unwind further. if ( Flavor() == FUNC_FLAVOR_FUNCTION ) { - if ( ! g_policy_debug ) - g_frame_stack.pop_back(); + g_frame_stack.pop_back(); call_stack.pop_back(); // Result not set b/c exception was thrown throw; @@ -450,8 +448,7 @@ ValPtr ScriptFunc::Invoke(zeek::Args* args, Frame* parent) const { g_trace_state.LogTrace("Function return: %s\n", d.Description()); } - if ( ! g_policy_debug ) - g_frame_stack.pop_back(); + g_frame_stack.pop_back(); return result; } diff --git a/src/Stmt.cc b/src/Stmt.cc index 15d6920fa9..5f210013a3 100644 --- a/src/Stmt.cc +++ b/src/Stmt.cc @@ -12,6 +12,7 @@ #include "zeek/Frame.h" #include "zeek/IntrusivePtr.h" #include "zeek/Reporter.h" +#include "zeek/RunState.h" #include "zeek/Scope.h" #include "zeek/Traverse.h" #include "zeek/Trigger.h" diff --git a/src/zeek-setup.cc b/src/zeek-setup.cc index 898ce050a6..070aad5308 100644 --- a/src/zeek-setup.cc +++ b/src/zeek-setup.cc @@ -1105,8 +1105,7 @@ SetupResult setup(int argc, char** argv, Options* zopts) { auto [body, scope] = get_global_stmts(); StmtFlowType flow; Frame f(scope->Length(), nullptr, nullptr); - if ( ! g_policy_debug ) - g_frame_stack.push_back(&f); + g_frame_stack.push_back(&f); try { body->Exec(&f, flow); @@ -1114,8 +1113,7 @@ SetupResult setup(int argc, char** argv, Options* zopts) { reporter->FatalError("failed to execute script statements at top-level scope"); } - if ( ! g_policy_debug ) - g_frame_stack.pop_back(); + g_frame_stack.pop_back(); } clear_script_analysis();