Compare commits

...

2 commits

Author SHA1 Message Date
Tim Wojtulewicz
54c26f768f fixup! Disable Stmt hooks for the built-in debugger if not a debug build 2025-09-30 13:05:54 -07:00
Tim Wojtulewicz
3878353a7a Disable Stmt hooks for the built-in debugger if not a debug build 2025-09-30 12:48:02 -07:00
2 changed files with 10 additions and 2 deletions

View file

@ -25,6 +25,7 @@
#include "zeek/IntrusivePtr.h" #include "zeek/IntrusivePtr.h"
#include "zeek/PolicyFile.h" #include "zeek/PolicyFile.h"
#include "zeek/Reporter.h" #include "zeek/Reporter.h"
#include "zeek/RunState.h"
#include "zeek/Scope.h" #include "zeek/Scope.h"
#include "zeek/Stmt.h" #include "zeek/Stmt.h"
#include "zeek/Val.h" #include "zeek/Val.h"
@ -821,6 +822,10 @@ bool pre_execute_stmt(Stmt* stmt, Frame* f) {
} }
bool post_execute_stmt(Stmt* stmt, Frame* f, Val* result, StmtFlowType* flow) { bool post_execute_stmt(Stmt* stmt, Frame* f, Val* result, StmtFlowType* flow) {
// If the debugger isn't currently active, return true so the caller continues.
if ( ! g_policy_debug )
return true;
// Handle the case where someone issues a "next" debugger command, // Handle the case where someone issues a "next" debugger command,
// but we're at a return statement, so the next statement is in // but we're at a return statement, so the next statement is in
// some other function. // some other function.

View file

@ -12,6 +12,7 @@
#include "zeek/Frame.h" #include "zeek/Frame.h"
#include "zeek/IntrusivePtr.h" #include "zeek/IntrusivePtr.h"
#include "zeek/Reporter.h" #include "zeek/Reporter.h"
#include "zeek/RunState.h"
#include "zeek/Scope.h" #include "zeek/Scope.h"
#include "zeek/Traverse.h" #include "zeek/Traverse.h"
#include "zeek/Trigger.h" #include "zeek/Trigger.h"
@ -147,8 +148,10 @@ const AssertStmt* Stmt::AsAssertStmt() const {
} }
bool Stmt::SetLocationInfo(const Location* start, const Location* end) { bool Stmt::SetLocationInfo(const Location* start, const Location* end) {
if ( ! Obj::SetLocationInfo(start, end) ) // Skip the rest of this code if the debugger isn't active or if the initial set
return false; // failed.
if ( bool res = Obj::SetLocationInfo(start, end); ! res || ! detail::g_policy_debug )
return res;
// Update the Filemap of line number -> statement mapping for // Update the Filemap of line number -> statement mapping for
// breakpoints (Debug.h). // breakpoints (Debug.h).