Interface for extracting values from GDB (building on gdb_apit) More...
#include <analyze_symbol.h>
symbols: map its value address to its symbol_exprt (via the values map) and then call analyze_symbol on it. lhs symbol from collected assignments [lhs:=rhs] store a new symbol (with the rhs as value) there. name. name. name. point assuming it points to a dynamic allocation of ‘n’ elements each of size member_size. symbol_name to its symbol expression and then process outstanding assignments that this extraction introduced. array and fill its operands with the results of calling get_expr_value on index expressions into expr. expr 1) For integers, booleans, and enums: call gdb_apit::get_value directly 2) For chars: return the zero_expr 3) For structs, arrays, and pointers: call their dedicated functions. pointer_value, check it has a symbol and return the associated symbol expression. expr. pointer_value to decide if it point to a struct or a union (or array) address is stored the value of symbol. Interface for extracting values from GDB (building on gdb_apit)
Definition at line 32 of file analyze_symbol.h.
Definition at line 58 of file analyze_symbol.h.
Definition at line 57 of file analyze_symbol.h.
Definition at line 24 of file analyze_symbol.cpp.
Create assignment lhs := value (see analyze_symbol)
Definition at line 228 of file analyze_symbol.cpp.
Assign the gdb-extracted value for symbol_name to its symbol expression and then process outstanding assignments that this extraction introduced.
Definition at line 154 of file analyze_symbol.cpp.
For each input symbol in symbols: map its value address to its symbol_exprt (via the values map) and then call analyze_symbol on it.
Definition at line 115 of file analyze_symbol.cpp.
Definition at line 60 of file analyze_symbol.h.
Search for a memory scope allocated under name.
Definition at line 76 of file analyze_symbol.cpp.
Search for a memory scope allocated under name.
Definition at line 67 of file analyze_symbol.cpp.
Iterate over array and fill its operands with the results of calling get_expr_value on index expressions into expr.
expr filled with values from gdb Definition at line 586 of file analyze_symbol.cpp.
If memory_location is found among values then return the symbol expression associated with it.
Otherwise we add the appropriate values mapping: 1) call gdb_apit::get_memory on the expr 2) allocate new symbol and assign it with the memory string from 1) 3) fill values (mapping memory_location to the new symbol)
memory_location Definition at line 234 of file analyze_symbol.cpp.
Case analysis on the typet of expr 1) For integers, booleans, and enums: call gdb_apit::get_value directly 2) For chars: return the zero_expr 3) For structs, arrays, and pointers: call their dedicated functions.
expr Definition at line 610 of file analyze_symbol.cpp.
Extract a stringified value from and c-converted expr.
Definition at line 760 of file analyze_symbol.cpp.
Build the pointee string for address point assuming it points to a dynamic allocation of ‘n’ elements each of size member_size.
E.g.:
int p = (int)malloc(sizeof(int)*4); int *q = &(p[2]);
get_malloc_pointee(get_memory(q), sizeof(int)) -> "p+8"
Definition at line 95 of file analyze_symbol.cpp.
Search for the size of the allocated memory for name.
name's allocation (1 otherwise) Definition at line 86 of file analyze_symbol.cpp.
Similar to get_char_pointer_value.
Doesn't re-call gdb_apit::get_memory, calls get_expr_value on dereferenced expr (the result of which is assigned to a new symbol).
memory_location Definition at line 367 of file analyze_symbol.cpp.
Extract the function name from pointer_value, check it has a symbol and return the associated symbol expression.
pointer_value Definition at line 346 of file analyze_symbol.cpp.
Call get_subexpression_at_offset to get the correct member expression.
pointer_value points to Definition at line 280 of file analyze_symbol.cpp.
Call gdb_apit::get_memory on expr then split based on the points-to type being char type or not.
These have dedicated functions.
Definition at line 497 of file analyze_symbol.cpp.
Get memory snapshot as C code.
Definition at line 180 of file analyze_symbol.cpp.
Get memory snapshot as symbol table Build a new symbol_tablet and for each lhs symbol from collected assignments [lhs:=rhs] store a new symbol (with the rhs as value) there.
Get memory snapshot as symbol table.
Also, type symbols are copied from symbol_table.
Definition at line 195 of file analyze_symbol.cpp.
For each of the members of the struct: call get_expr_value.
Definition at line 693 of file analyze_symbol.cpp.
Wrapper for call get_offset_pointer_bits.
Definition at line 108 of file analyze_symbol.cpp.
For each of the members of the struct: call get_expr_value.
Definition at line 729 of file analyze_symbol.cpp.
Definition at line 156 of file analyze_symbol.h.
Analyzes the pointer_value to decide if it point to a struct or a union (or array)
Definition at line 471 of file analyze_symbol.cpp.
Call add_assignment for each pair in outstanding_assignments.
Definition at line 751 of file analyze_symbol.cpp.
Definition at line 68 of file analyze_symbol.h.
Definition at line 64 of file analyze_symbol.h.
Definition at line 81 of file analyze_symbol.h.
Sequence of assignments collected during analyze_symbols.
Definition at line 84 of file analyze_symbol.h.
Definition at line 80 of file analyze_symbol.h.
Keep track of the dynamically allocated memory.
Definition at line 151 of file analyze_symbol.h.
Definition at line 74 of file analyze_symbol.h.
Keep track of the memory location for the analyzed symbols.
Definition at line 154 of file analyze_symbol.h.
Definition at line 79 of file analyze_symbol.h.
Mapping pointer expression for which get_non_char_pointer_value returned nil expression to memory location (from gdb_apit).
Definition at line 88 of file analyze_symbol.h.
External symbol table – extracted from read_goto_binary We only expect to analyse symbols located there.
Definition at line 78 of file analyze_symbol.h.
Storing pairs <address, symbol> such that at address is stored the value of symbol.
Definition at line 92 of file analyze_symbol.h.