Commit 043acfaf authored by George Wort's avatar George Wort Committed by Commit Bot

[arm] Alter disasm-arm to print a fixed size address

Change-Id: I7079a0460fcb8f9b818c97125ab11f6168c3a28d
Reviewed-on: https://chromium-review.googlesource.com/c/1323731
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57351}
parent 74125939
......@@ -685,8 +685,9 @@ int Decoder::FormatOption(Instruction* instr, const char* format) {
return -1;
}
}
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%p",
static_cast<void*>(addr));
out_buffer_pos_ +=
SNPrintF(out_buffer_ + out_buffer_pos_, "0x%08" PRIxPTR,
reinterpret_cast<uintptr_t>(addr));
return 1;
}
case 'S':
......
......@@ -1511,12 +1511,13 @@ static void TestLoadLiteral(byte* buffer, Assembler* assm, bool* failure,
const char *expected_string_template =
(offset >= 0) ?
"e59f0%03x ldr r0, [pc, #+%d] (addr %p)" :
"e51f0%03x ldr r0, [pc, #%d] (addr %p)";
"e59f0%03x ldr r0, [pc, #+%d] (addr 0x%08" PRIxPTR ")" :
"e51f0%03x ldr r0, [pc, #%d] (addr 0x%08" PRIxPTR ")";
char expected_string[80];
snprintf(expected_string, sizeof(expected_string), expected_string_template,
abs(offset), offset,
progcounter + Instruction::kPcLoadDelta + offset);
abs(offset), offset,
reinterpret_cast<uintptr_t>(
progcounter + Instruction::kPcLoadDelta + offset));
if (!DisassembleAndCompare(progcounter, kRawString, expected_string)) {
*failure = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment