30 #define DBG_FDB LOG_STREAM(debug, log_formula_debugger)
31 #define LOG_FDB LOG_STREAM(info, log_formula_debugger)
32 #define WRN_FDB LOG_STREAM(warn, log_formula_debugger)
33 #define ERR_FDB LOG_STREAM(err, log_formula_debugger)
39 : arg_number_(arg_number), counter_(counter), level_(
level), name_(name), str_(str), value_(value), evaluated_(evaluated)
97 : call_stack_(), counter_(0), current_breakpoint_(), breakpoints_(), execution_trace_(),arg_number_extra_debug_info(-1), f_name_extra_debug_info(
"")
109 static void msg(
const char *act,
debug_info &
i,
const char *to=
"",
const char *result =
"")
111 DBG_FDB <<
"#" <<
i.counter() << act << std::endl <<
" \""<<
i.name() <<
"\"='" <<
i.str() <<
"' " << to << result;
141 if ((*b)->is_break_now()){
145 if ((*b)->is_one_time_only()) {
156 WRN_FDB <<
"skipping WFL debug window due to nullptr gui";
160 gui2::dialogs::formula_debugger::display(*
this);
162 WRN_FDB <<
"skipping WFL debug window because :debug is not enabled";
212 variant v =
f.execute(variables,
this);
226 msg(
" evaluating formula without variables: ",
call_stack_.back());
238 : fdb_(fdb), name_(name), one_time_only_(one_time_only)
363 LOG_FDB <<
"added 'end' breakpoint";
370 LOG_FDB <<
"added 'step into' breakpoint";
377 LOG_FDB <<
"added 'step out' breakpoint";
384 LOG_FDB <<
"added 'next' breakpoint";
static game_display * get_singleton()
virtual ~base_breakpoint()
const std::string & name() const
base_breakpoint(formula_debugger &fdb, const std::string &name, bool one_time_only)
bool is_one_time_only() const
debug_info(int arg_number, int counter, int level, const std::string &name, const std::string &str, const variant &value, bool evaluated)
const variant & value() const
void set_evaluated(bool evaluated)
const std::string & name() const
const std::string & str() const
void set_value(const variant &value)
end_breakpoint(formula_debugger &fdb)
virtual ~end_breakpoint()
virtual bool is_break_now() const
virtual ~next_breakpoint()
virtual bool is_break_now() const
next_breakpoint(formula_debugger &fdb)
virtual ~step_in_breakpoint()
virtual bool is_break_now() const
step_in_breakpoint(formula_debugger &fdb)
step_out_breakpoint(formula_debugger &fdb)
virtual bool is_break_now() const
virtual ~step_out_breakpoint()
std::string to_debug_string(bool verbose=false, formula_seen_stack *seen=nullptr) const
static lg::log_domain log_formula_debugger("scripting/formula/debug")
Standard logging facilities (interface).
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
std::string::const_iterator iterator
std::shared_ptr< base_breakpoint > breakpoint_ptr
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
static thread_local std::deque< std::string > call_stack
For printing error messages when WFL parsing or evaluation fails, this contains the names of the WFL ...