15 #include <unordered_set> 31 const std::string &filename,
40 const std::string &filename,
46 std::ifstream in(
widen(filename), std::ios::binary);
48 std::ifstream in(filename, std::ios::binary);
54 message.
error() <<
"Failed to open `" << filename <<
"'" 66 if(hdr[0]==0x7f && hdr[1]==
'G' && hdr[2]==
'B' && hdr[3]==
'F')
71 else if(hdr[0]==0x7f && hdr[1]==
'E' && hdr[2]==
'L' && hdr[3]==
'F')
89 "failed to find goto-cc section in ELF binary" <<
messaget::eom;
105 if(osx_fat_reader.
has_gb())
108 osx_fat_reader.
extract_gb(filename, tempname());
110 std::ifstream temp_in(tempname(), std::ios::binary);
122 message.
error() <<
"failed to find goto binary in Mach-O file" 137 std::ifstream in(
widen(filename), std::ios::binary);
139 std::ifstream in(filename, std::ios::binary);
155 if(hdr[0]==0x7f && hdr[1]==
'G' && hdr[2]==
'B' && hdr[3]==
'F')
159 else if(hdr[0]==0x7f && hdr[1]==
'E' && hdr[2]==
'L' && hdr[3]==
'F')
182 if(osx_fat_reader.
has_gb())
199 const std::string &file_name,
234 const std::string &file_name,
bool has_section(const std::string &name) const
std::wstring widen(const char *s)
bool is_goto_binary(const std::string &filename)
symbol_tablet symbol_table
Symbol table.
static mstreamt & eom(mstreamt &m)
std::string section_name(std::size_t index) const
bool read_goto_binary(const std::string &filename, goto_modelt &dest, message_handlert &message_handler)
void link_goto_model(goto_modelt &dest, goto_modelt &src, message_handlert &message_handler)
bool extract_gb(const std::string &source, const std::string &dest) const
std::streampos section_offset(std::size_t index) const
void swap(goto_functionst &other)
void set_from_symbol_table(const symbol_tablet &)
bool read_bin_goto_object(std::istream &in, const std::string &filename, symbol_tablet &symbol_table, goto_functionst &functions, message_handlert &message_handler)
reads a goto binary file back into a symbol and a function table
bool is_osx_fat_magic(char hdr[4])
std::size_t number_of_sections
goto_programt coverage_criteriont message_handlert & message_handler
void swap(symbol_tablet &other)
bool read_object_and_link(const std::string &file_name, goto_modelt &dest, message_handlert &message_handler)
reads an object file
goto_functionst goto_functions
GOTO functions.
mstreamt & statistics() const