Skip to content

Commit 8a43210

Browse files
Add stub for shadow memory instrumentation implementation
The actual implementation will be added incrementally in future PRs.
1 parent 50fd205 commit 8a43210

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

src/goto-symex/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ SRC = auto_objects.cpp \
1414
postcondition.cpp \
1515
precondition.cpp \
1616
renaming_level.cpp \
17+
shadow_memory.cpp \
1718
show_program.cpp \
1819
show_vcc.cpp \
1920
slice.cpp \

src/goto-symex/shadow_memory.cpp

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
/*******************************************************************\
2+
3+
Module: Symex Shadow Memory Instrumentation
4+
5+
Author: Peter Schrammel
6+
7+
\*******************************************************************/
8+
9+
/// \file
10+
/// Symex Shadow Memory Instrumentation
11+
12+
#include "shadow_memory.h"
13+
14+
#include <util/fresh_symbol.h>
15+
16+
#include <langapi/language_util.h>
17+
18+
#include "goto_symex_state.h"
19+
20+
void shadow_memoryt::initialize_shadow_memory(
21+
goto_symex_statet &state,
22+
const exprt &expr,
23+
const shadow_memory_field_definitionst::field_definitiont &fields)
24+
{
25+
// To be implemented
26+
}
27+
28+
symbol_exprt shadow_memoryt::add_field(
29+
goto_symex_statet &state,
30+
const exprt &expr,
31+
const irep_idt &field_name,
32+
const typet &field_type)
33+
{
34+
// To be completed
35+
36+
symbolt &new_symbol = get_fresh_aux_symbol(
37+
field_type,
38+
id2string(state.source.function_id),
39+
SHADOW_MEMORY_PREFIX + from_expr(expr) + "__" + id2string(field_name),
40+
state.source.pc->source_location(),
41+
ID_C,
42+
state.symbol_table);
43+
44+
// Call some function on ns to silence the compiler in the meanwhile.
45+
ns.get_symbol_table();
46+
47+
return new_symbol.symbol_expr();
48+
}
49+
50+
void shadow_memoryt::symex_set_field(
51+
goto_symex_statet &state,
52+
const exprt::operandst &arguments)
53+
{
54+
// To be implemented
55+
}
56+
57+
void shadow_memoryt::symex_get_field(
58+
goto_symex_statet &state,
59+
const exprt &lhs,
60+
const exprt::operandst &arguments)
61+
{
62+
// To be implemented
63+
}
64+
65+
void shadow_memoryt::symex_field_static_init(
66+
goto_symex_statet &state,
67+
const ssa_exprt &lhs)
68+
{
69+
// To be implemented
70+
}
71+
72+
void shadow_memoryt::symex_field_static_init_string_constant(
73+
goto_symex_statet &state,
74+
const ssa_exprt &expr,
75+
const exprt &rhs)
76+
{
77+
// To be implemented
78+
}
79+
80+
void shadow_memoryt::symex_field_local_init(
81+
goto_symex_statet &state,
82+
const ssa_exprt &expr)
83+
{
84+
// To be implemented
85+
}
86+
87+
void shadow_memoryt::symex_field_dynamic_init(
88+
goto_symex_statet &state,
89+
const exprt &expr,
90+
const side_effect_exprt &code)
91+
{
92+
// To be implemented
93+
}
94+
95+
shadow_memory_field_definitionst shadow_memoryt::gather_field_declarations(
96+
abstract_goto_modelt &goto_model,
97+
message_handlert &message_handler)
98+
{
99+
// To be implemented
100+
101+
return shadow_memory_field_definitionst();
102+
}
103+
104+
void shadow_memoryt::convert_field_declaration(
105+
const code_function_callt &code_function_call,
106+
shadow_memory_field_definitionst::field_definitiont &fields)
107+
{
108+
// To be implemented
109+
}

0 commit comments

Comments
 (0)