Skip to content

cpu/drcbearm64.cpp: Add disassembled UML comments to logged assembly #13472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/devices/cpu/drcbearm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ class drcbe_arm64 : public drcbe_interface

drc_hash_table m_hash;
drc_map_variables m_map;
FILE * m_log_asmjit;
FILE *m_log_asmjit;

arm64_entry_point_func m_entry;
drccodeptr m_exit;
Expand Down Expand Up @@ -1560,6 +1560,16 @@ void drcbe_arm64::generate(drcuml_block &block, const instruction *instlist, uin
const instruction &inst = instlist[inum];
assert(inst.opcode() < std::size(s_opcode_table));

// must remain in scope until output
std::string dasm;

// add a comment
if (logger.file())
{
dasm = inst.disasm(&m_drcuml);
a.setInlineComment(dasm.c_str());
}

// generate code
(this->*s_opcode_table[inst.opcode()])(a, inst);
}
Expand Down
Loading