[Decompiler] Test framework for decompiler regression tests and gcommon tests (#200)

* test framework for pre-expression compact stuff

* check ordering

* more tests

* final tests gcommon
This commit is contained in:
water111
2021-01-18 13:33:32 -05:00
committed by GitHub
parent e8ad91a454
commit 40d328f4eb
13 changed files with 1116 additions and 16 deletions
@@ -1065,4 +1065,13 @@ std::string LinkedObjectFile::get_goal_string_by_label(const DecompilerLabel& la
assert(0 == (label.offset % 4));
return get_goal_string(label.target_segment, (label.offset / 4) - 1, false);
}
const DecompilerLabel& LinkedObjectFile::get_label_by_name(const std::string& name) const {
for (auto& label : labels) {
if (label.name == name) {
return label;
}
}
throw std::runtime_error("Can't find label " + name);
}
} // namespace decompiler
+1
View File
@@ -62,6 +62,7 @@ class LinkedObjectFile {
std::string print_asm_function_disassembly(const std::string& my_name);
u32 read_data_word(const DecompilerLabel& label);
const DecompilerLabel& get_label_by_name(const std::string& name) const;
std::string get_goal_string_by_label(const DecompilerLabel& label) const;
std::string get_goal_string(int seg, int word_idx, bool with_quotes = true) const;
bool is_string(int seg, int byte_idx) const;