diff options
| author | 2016-08-19 10:49:06 -0700 | |
|---|---|---|
| committer | 2016-08-19 16:46:56 -0700 | |
| commit | 372f3a374681ef11f003460e14249adb7bc8313d (patch) | |
| tree | b6d2bd95975a0ce1096dc2aa761f8e6b30e42b18 /compiler | |
| parent | 9c07ab332b8ebbcb1586c311bfcb75e19b8a35b4 (diff) | |
ART: Add thread offset printing hook to disassembler
To prepare separation of disassembler from libart, add a function
hook to the disassembler options for thread offset name printing.
Bug: 15436106
Change-Id: I9e9b7e565ae923952c64026f675ac527b560f51b
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/cfi_test.h | 10 | ||||
| -rw-r--r-- | compiler/optimizing/graph_visualizer.cc | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/compiler/cfi_test.h b/compiler/cfi_test.h index f8b7460935..c754e5588c 100644 --- a/compiler/cfi_test.h +++ b/compiler/cfi_test.h @@ -22,11 +22,13 @@ #include <sstream> #include "arch/instruction_set.h" +#include "base/enums.h" #include "debug/dwarf/dwarf_constants.h" #include "debug/dwarf/dwarf_test.h" #include "debug/dwarf/headers.h" #include "disassembler/disassembler.h" #include "gtest/gtest.h" +#include "thread.h" namespace art { @@ -57,7 +59,13 @@ class CFITest : public dwarf::DwarfTest { // Pretty-print assembly. const uint8_t* asm_base = actual_asm.data(); const uint8_t* asm_end = asm_base + actual_asm.size(); - auto* opts = new DisassemblerOptions(false, asm_base, asm_end, true); + auto* opts = new DisassemblerOptions(false, + asm_base, + asm_end, + true, + is64bit + ? &Thread::DumpThreadOffset<PointerSize::k64> + : &Thread::DumpThreadOffset<PointerSize::k32>); std::unique_ptr<Disassembler> disasm(Disassembler::Create(isa, opts)); std::stringstream stream; const uint8_t* base = actual_asm.data() + (isa == kThumb2 ? 1 : 0); diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index 89d80cc281..b3d5341de0 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -122,7 +122,10 @@ class HGraphVisualizerDisassembler { new DisassemblerOptions(/* absolute_addresses */ false, base_address, end_address, - /* can_read_literals */ true))); + /* can_read_literals */ true, + Is64BitInstructionSet(instruction_set) + ? &Thread::DumpThreadOffset<PointerSize::k64> + : &Thread::DumpThreadOffset<PointerSize::k32>))); } ~HGraphVisualizerDisassembler() { |