36 if(expr.
id() == ID_string_constant)
46 std::string result =
from_expr(ns,
id, expr);
50 exprt new_expr = expr;
64 xmlt value_xml{
"full_lhs_value"};
72 lhs_object.has_value() ? lhs_object->identifier() :
irep_idt();
77 if(bv_type && constant)
79 const auto width = bv_type->get_width();
85 const auto binary_representation =
97 dest=
xmlt(
"goto_trace");
101 for(
const auto &step : goto_trace.
steps)
107 xml_location=
xml(source_location);
117 xml_failure.
set_attribute(
"thread", std::to_string(step.thread_nr));
118 xml_failure.
set_attribute(
"step_nr", std::to_string(step.step_nr));
122 if(!xml_location.
name.empty())
130 auto lhs_object = step.get_lhs_object();
132 lhs_object.has_value() ? lhs_object->identifier() :
irep_idt();
135 if(!xml_location.
name.empty())
142 lhs_object.has_value() &&
143 !ns.
lookup(lhs_object->identifier(), symbol))
145 std::string type_string =
158 std::string full_lhs_string;
160 if(step.full_lhs.is_not_nil())
167 xml_assignment.
set_attribute(
"thread", std::to_string(step.thread_nr));
168 xml_assignment.
set_attribute(
"step_nr", std::to_string(step.step_nr));
172 step.assignment_type ==
182 printf_formatter(
id2string(step.format_string), step.io_args);
183 std::string text = printf_formatter.
as_string();
189 xml_output.
set_attribute(
"thread", std::to_string(step.thread_nr));
190 xml_output.
set_attribute(
"step_nr", std::to_string(step.step_nr));
192 if(!xml_location.
name.empty())
195 for(
const auto &arg : step.io_args)
210 xml_input.
set_attribute(
"thread", std::to_string(step.thread_nr));
211 xml_input.
set_attribute(
"step_nr", std::to_string(step.step_nr));
213 for(
const auto &arg : step.io_args)
220 if(!xml_location.
name.empty())
227 std::string tag =
"function_call";
231 xml_call_return.
set_attribute(
"thread", std::to_string(step.thread_nr));
232 xml_call_return.
set_attribute(
"step_nr", std::to_string(step.step_nr));
241 if(!xml_location.
name.empty())
248 std::string tag =
"function_return";
252 xml_call_return.
set_attribute(
"thread", std::to_string(step.thread_nr));
253 xml_call_return.
set_attribute(
"step_nr", std::to_string(step.step_nr));
262 if(!xml_location.
name.empty())
283 xmlt &xml_location_only =
300 previous_source_location=source_location;
Pre-defined bitvector types.
Base class for all expressions.
typet & type()
Return the type of the expression.
Step of the trace of a GOTO program.
std::optional< symbol_exprt > get_lhs_object() const
const irep_idt & id() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
const irep_idt & get_file() const
array_exprt to_array_expr() const
convert string into array constant
irep_idt base_name
Base (non-scoped) name.
source_locationt location
Source code location of definition of symbol.
irep_idt name
The unique identifier.
const irep_idt & display_name() const
Return language specific display name if present.
irep_idt mode
Language mode.
void set_attribute_bool(const std::string &attribute, bool value)
xmlt & new_element(const std::string &key)
void set_attribute(const std::string &attribute, unsigned value)
static bool is_printable_xml(const std::string &s)
Determine whether s does not contain any characters that cannot be escaped in XML 1....
auto type_try_dynamic_cast(TType &base) -> typename detail::expr_try_dynamic_cast_return_typet< T, TType >::type
Try to cast a reference to a generic typet to a specific derived class.
auto expr_try_dynamic_cast(TExpr &base) -> typename detail::expr_try_dynamic_cast_return_typet< T, TExpr >::type
Try to cast a reference to a generic exprt to a specific derived class.
const std::string & id2string(const irep_idt &d)
std::string from_expr(const namespacet &ns, const irep_idt &identifier, const exprt &expr)
std::string from_type(const namespacet &ns, const irep_idt &identifier, const typet &type)
const std::string integer2binary(const mp_integer &n, std::size_t width)
xmlt xml(const irep_idt &property_id, const property_infot &property_info)
const string_constantt & to_string_constant(const exprt &expr)
std::string default_step_name(const default_step_kindt &step_type)
Turns a default_step_kindt into a string that can be used in the trace.
std::optional< default_trace_stept > default_step(const goto_trace_stept &step, const source_locationt &previous_source_location)
Utilities for printing location info steps in the trace in a format agnostic way.
xmlt full_lhs_value(const goto_trace_stept &step, const namespacet &ns)
static std::string get_printable_xml(const namespacet &ns, const irep_idt &id, const exprt &expr)
Given an expression expr, produce a string representation that is printable in XML 1....
static void replace_string_constants_rec(exprt &expr)
Rewrite all string constants to their array counterparts.
void convert(const namespacet &ns, const goto_tracet &goto_trace, xmlt &dest)