Skip to content

Commit be51cf9

Browse files
Add missing documentation in goto_trace.h
Add documentation to the main classes, functions and methods when their meaning is not obvious.
1 parent fc44963 commit be51cf9

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

src/goto-programs/goto_trace.h

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,32 @@ Date: July 2005
2424

2525
#include <goto-programs/goto_program.h>
2626

27-
/*! \brief TO_BE_DOCUMENTED
28-
* \ingroup gr_goto_symex
29-
*/
27+
/// Step of the trace of a GOTO program
28+
///
29+
/// A step is either:
30+
/// - an assignment
31+
/// - an assume statement
32+
/// - an assertion
33+
/// - a goto instruction
34+
/// - a constraint (unused)
35+
/// - a function call
36+
/// - a function return
37+
/// - a location (unused)
38+
/// - an output
39+
/// - an input
40+
/// - a declaration
41+
/// - a dead statement
42+
/// - a shared read (unused)
43+
/// - a shared write (unused)
44+
/// - a spawn satemement
45+
/// - a memory barrier
46+
/// - an atomic begin (unused)
47+
/// - an atomic end (unused)
48+
/// \ingroup gr_goto_symex
3049
class goto_trace_stept
3150
{
3251
public:
52+
/// Number of the step in the trace
3353
std::size_t step_nr;
3454

3555
bool is_assignment() const { return type==typet::ASSIGNMENT; }
@@ -145,9 +165,9 @@ class goto_trace_stept
145165
}
146166
};
147167

148-
/*! \brief TO_BE_DOCUMENTED
149-
* \ingroup gr_goto_symex
150-
*/
168+
/// Trace of a GOTO program.
169+
/// This is a wrapper for a list of steps.
170+
/// \ingroup gr_goto_symex
151171
class goto_tracet
152172
{
153173
public:
@@ -170,6 +190,7 @@ class goto_tracet
170190
other.steps.swap(steps);
171191
}
172192

193+
/// Add a step at the end of the trace
173194
void add_step(const goto_trace_stept &step)
174195
{
175196
steps.push_back(step);
@@ -186,14 +207,23 @@ class goto_tracet
186207
std::vector<irep_idt> get_all_property_ids() const;
187208
};
188209

210+
/// Options for printing the trace using show_goto_trace
189211
struct trace_optionst
190212
{
213+
/// Add rawLhs property to trace
191214
bool json_full_lhs;
215+
/// Represent plain trace values in hex
192216
bool hex_representation;
217+
/// Use prefix (`0b` or `0x`) for distinguishing the base of the
218+
/// representation.
193219
bool base_prefix;
220+
/// Show function calls in plain text trace
194221
bool show_function_calls;
222+
/// Show original code in plain text trace
195223
bool show_code;
224+
/// Give a compact trace
196225
bool compact_trace;
226+
/// Give a stack trace only
197227
bool stack_trace;
198228

199229
static const trace_optionst default_options;
@@ -222,6 +252,7 @@ struct trace_optionst
222252
};
223253
};
224254

255+
/// Output the trace on the given stream \p out
225256
void show_goto_trace(
226257
messaget::mstreamt &out,
227258
const namespacet &ns,

0 commit comments

Comments
 (0)