@@ -22,22 +22,21 @@ gdb_value_extractort::gdb_value_extractort(
22
22
symbol_table(symbol_table),
23
23
ns(symbol_table),
24
24
c_converter(ns, expr2c_configurationt::clean_configuration),
25
- allocate_objects(ID_C, source_locationt(), "" , this->symbol_table)
25
+ allocate_objects(ID_C, source_locationt(), irep_idt{} , this ->symbol_table)
26
26
{
27
27
}
28
28
29
- void gdb_value_extractort::analyze_symbols (
30
- const std::vector<std::string> &symbols)
29
+ void gdb_value_extractort::analyze_symbols (const std::vector<irep_idt> &symbols)
31
30
{
32
31
// record addresses of given symbols
33
32
for (const auto &id : symbols)
34
33
{
35
- const symbol_exprt symbol_expr (id, typet () );
34
+ const symbol_exprt & symbol_expr = ns. lookup (id). symbol_expr ( );
36
35
const address_of_exprt aoe (symbol_expr);
37
36
38
37
const std::string c_expr = c_converter.convert (aoe);
39
38
const pointer_valuet &value = gdb_api.get_memory (c_expr);
40
- CHECK_RETURN (value.pointee .empty () || (value. pointee == id ));
39
+ CHECK_RETURN (value.pointee .empty () || (id == value. pointee ));
41
40
42
41
values.insert ({value.address , symbol_expr});
43
42
}
@@ -143,12 +142,11 @@ exprt gdb_value_extractort::get_char_pointer_value(
143
142
std::string c_expr = c_converter.convert (expr);
144
143
pointer_valuet value = gdb_api.get_memory (c_expr);
145
144
CHECK_RETURN (value.string );
146
- std::string string = *value.string ;
147
145
148
- string_constantt init (string);
146
+ string_constantt init (*value. string );
149
147
CHECK_RETURN (to_array_type (init.type ()).is_complete ());
150
148
151
- symbol_exprt dummy (pointer_typet (init.type (), config. ansi_c . pointer_width ));
149
+ symbol_exprt dummy (" tmp " , pointer_type (init.type ()));
152
150
code_blockt assignments;
153
151
154
152
const symbol_exprt new_symbol =
@@ -184,7 +182,7 @@ exprt gdb_value_extractort::get_non_char_pointer_value(
184
182
185
183
const typet target_type = expr.type ().subtype ();
186
184
187
- symbol_exprt dummy (expr.type ());
185
+ symbol_exprt dummy (" tmp " , expr.type ());
188
186
code_blockt assignments;
189
187
190
188
const symbol_exprt new_symbol =
@@ -284,6 +282,7 @@ exprt gdb_value_extractort::get_expr_value(
284
282
PRECONDITION (expr.type () == zero_expr.type ());
285
283
286
284
const typet &type = expr.type ();
285
+ PRECONDITION (type.id () != ID_struct);
287
286
288
287
if (is_c_integral_type (type))
289
288
{
@@ -310,7 +309,7 @@ exprt gdb_value_extractort::get_expr_value(
310
309
return convert_member_name_to_enum_value (
311
310
get_gdb_value (expr), to_c_enum_type (type));
312
311
}
313
- else if (type.id () == ID_struct || type. id () == ID_struct_tag)
312
+ else if (type.id () == ID_struct_tag)
314
313
{
315
314
return get_struct_value (expr, zero_expr, location);
316
315
}
@@ -324,7 +323,7 @@ exprt gdb_value_extractort::get_expr_value(
324
323
325
324
return get_pointer_value (expr, zero_expr, location);
326
325
}
327
- UNREACHABLE ;
326
+ UNIMPLEMENTED ;
328
327
}
329
328
330
329
exprt gdb_value_extractort::get_struct_value (
0 commit comments