From e6c8f8ccf0954b71321333df1a7e7face18edc88 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 13 Mar 2025 23:41:05 +1100 Subject: [PATCH] cpu/drcbearm64.cpp: Add disassembled UML comments to logged native assembly language. (#13472) --- src/devices/cpu/drcbearm64.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/devices/cpu/drcbearm64.cpp b/src/devices/cpu/drcbearm64.cpp index 00b73d206bd..4c45a93e698 100644 --- a/src/devices/cpu/drcbearm64.cpp +++ b/src/devices/cpu/drcbearm64.cpp @@ -574,7 +574,7 @@ private: 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; @@ -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); }