mirror of
https://github.com/open-goal/jak-project
synced 2026-08-10 03:06:18 -04:00
[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:
@@ -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
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user