31 #define DBG_FDB LOG_STREAM(debug, log_formula_debugger) 32 #define LOG_FDB LOG_STREAM(info, log_formula_debugger) 33 #define WRN_FDB LOG_STREAM(warn, log_formula_debugger) 34 #define ERR_FDB LOG_STREAM(err, log_formula_debugger) 40 : arg_number_(arg_number), counter_(counter), level_(level), name_(name), str_(str), value_(value), evaluated_(evaluated)
98 : call_stack_(),
counter_(0), current_breakpoint_(), breakpoints_(), execution_trace_(),arg_number_extra_debug_info(-1), f_name_extra_debug_info(
"")
110 static void msg(
const char *act,
debug_info &
i,
const char *to=
"",
const char *result =
"")
112 DBG_FDB <<
"#" << i.
counter() << act << std::endl <<
" \""<< i.
name() <<
"\"='" << i.
str() <<
"' " << to << result;
142 if ((*b)->is_break_now()){
146 if ((*b)->is_one_time_only()) {
157 WRN_FDB <<
"skipping WFL debug window due to nullptr gui";
161 gui2::dialogs::formula_debugger::display(*
this);
163 WRN_FDB <<
"skipping WFL debug window because :debug is not enabled";
201 msg(
" evaluated expression: ",
call_stack_.back(),
" to ",v.to_debug_string(
true).c_str());
216 msg(
" evaluated formula: ",
call_stack_.back(),
" to ",v.to_debug_string(
true).c_str());
227 msg(
" evaluating formula without variables: ",
call_stack_.back());
231 msg(
" evaluated formula without variables: ",
call_stack_.back(),
" to ",v.to_debug_string(
true).c_str());
239 : fdb_(fdb), name_(name), one_time_only_(one_time_only)
275 if ((call_stack.size() == 1) && (call_stack.front().evaluated()) ) {
297 if (call_stack.empty() || call_stack.back().evaluated()) {
320 if (call_stack.empty() || call_stack.back().evaluated()) {
324 if (call_stack.size() == level_) {
348 if (call_stack.empty() || call_stack.back().evaluated()) {
351 if (call_stack.size() == level_) {
364 LOG_FDB <<
"added 'end' breakpoint";
371 LOG_FDB <<
"added 'step into' breakpoint";
378 LOG_FDB <<
"added 'step out' breakpoint";
385 LOG_FDB <<
"added 'next' breakpoint";
virtual ~next_breakpoint()
virtual ~step_in_breakpoint()
virtual bool is_break_now() const
debug_info(int arg_number, int counter, int level, const std::string &name, const std::string &str, const variant &value, bool evaluated)
void set_evaluated(bool evaluated)
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
const std::string & name() const
std::shared_ptr< base_breakpoint > breakpoint_ptr
virtual ~base_breakpoint()
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
This file contains the settings handling of the widget library.
step_in_breakpoint(formula_debugger &fdb)
virtual ~end_breakpoint()
virtual ~step_out_breakpoint()
void set_value(const variant &value)
const variant & value() const
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 ...
static lg::log_domain log_formula_debugger("scripting/formula/debug")
virtual bool is_break_now() const
virtual bool is_break_now() const
next_breakpoint(formula_debugger &fdb)
bool is_one_time_only() const
const std::string & str() const
const std::string & name() const
Standard logging facilities (interface).
base_breakpoint(formula_debugger &fdb, const std::string &name, bool one_time_only)
virtual bool is_break_now() const
std::string::const_iterator iterator
step_out_breakpoint(formula_debugger &fdb)
static game_display * get_singleton()
end_breakpoint(formula_debugger &fdb)