Lift backtrace() code into Func.{h,cc}

This is to be re-used by the assertion facility.
This commit is contained in:
Arne Welzel 2023-06-05 18:56:32 +02:00
parent 857c15a293
commit e8811a55ef
3 changed files with 77 additions and 43 deletions

View file

@ -364,6 +364,25 @@ private:
extern std::vector<CallInfo> call_stack;
/**
* Create a single BacktraceElement record val.
*
* @param name the name of the function.
* @param args call argument vector created by MakeCallArgumentVector().
* @param loc optional location information of the caller.
*
* @return record value representing a BacktraceElement.
*/
zeek::RecordValPtr make_backtrace_element(std::string_view name, const VectorValPtr args,
const zeek::detail::Location* loc);
/**
* Create a Zeek script Backtrace of the current script call_stack.
*
* @return VectorValPtr containing BacktraceElement entries.
*/
zeek::VectorValPtr get_current_script_backtrace();
// This is set to true after the built-in functions have been initialized.
extern bool did_builtin_init;
extern std::vector<void (*)()> bif_initializers;