Skip to content

Commit e6c8f8c

Browse files
authored
cpu/drcbearm64.cpp: Add disassembled UML comments to logged native assembly language. (#13472)
1 parent b71012d commit e6c8f8c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/devices/cpu/drcbearm64.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ class drcbe_arm64 : public drcbe_interface
574574

575575
drc_hash_table m_hash;
576576
drc_map_variables m_map;
577-
FILE * m_log_asmjit;
577+
FILE *m_log_asmjit;
578578

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

1563+
// must remain in scope until output
1564+
std::string dasm;
1565+
1566+
// add a comment
1567+
if (logger.file())
1568+
{
1569+
dasm = inst.disasm(&m_drcuml);
1570+
a.setInlineComment(dasm.c_str());
1571+
}
1572+
15631573
// generate code
15641574
(this->*s_opcode_table[inst.opcode()])(a, inst);
15651575
}

0 commit comments

Comments
 (0)