From bad358209af4abcc85a23e4091564e61b99cf0e1 Mon Sep 17 00:00:00 2001 From: Oxore Date: Sat, 20 May 2023 14:48:30 +0300 Subject: Make `xrefs_to` for both args if they are in the code boundaries --- main.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 1741a34..6beac4e 100644 --- a/main.cpp +++ b/main.cpp @@ -256,17 +256,20 @@ static void RenderDisassembly( ((s.abs_marks ? (node->ref_kinds & kRefAbsMask) : 0) | (s.rel_marks ? (node->ref_kinds & kRefRelMask) : 0)); node->op.FPrint(output, ref_kinds, node->offset, ref1_addr, ref2_addr); + if (s.xrefs_to && ref1) { + char ref_addr_str[12]{}; + snprintf(ref_addr_str, sizeof(ref_addr_str), ".L%08x", ref1_addr); + fprintf(output, " | %s", ref_addr_str); + } + if (s.xrefs_to && ref2) { + char ref_addr_str[12]{}; + snprintf(ref_addr_str, sizeof(ref_addr_str), ".L%08x", ref2_addr); + fprintf(output, " | %s", ref_addr_str); + } } else { node->op.FPrint(output); } } - if (node->ref_kinds && s.xrefs_to) { - char ref_addr_str[12]{}; - const uint32_t ref_addr = - (node->ref_kinds & kRef1Mask) ? node->ref1_addr : node->ref2_addr; - snprintf(ref_addr_str, sizeof(ref_addr_str), " .L%08x", ref_addr); - fprintf(output, " |%s", ref_addr_str); - } if (s.raw_data_comment) { char raw_data_comment[100]{}; RenderRawDataComment(raw_data_comment, sizeof(raw_data_comment) - 1, node->offset, node->size, code); -- cgit v1.2.3