mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
Don't use %p when generating disassembly in vm service.
Evidentally it is platform dependent -- it seems to include the 0x prefix on mac but not on windows. I've switched to using %" Px " instead. This will fix bug 24038. BUG= R=johnmccutchan@google.com Review URL: https://codereview.chromium.org//1282993002 .
This commit is contained in:
parent
e9d2f739ad
commit
cc981c8246
4 changed files with 9 additions and 7 deletions
|
@ -3365,7 +3365,7 @@ class Code extends HeapObject {
|
|||
var pcOffset = 0;
|
||||
if (disassembly[i] != '') {
|
||||
// Not a code comment, extract address.
|
||||
address = int.parse(disassembly[i]);
|
||||
address = int.parse(disassembly[i], radix:16);
|
||||
pcOffset = address - startAddress;
|
||||
}
|
||||
var instruction = new CodeInstruction(address, pcOffset, machine, human);
|
||||
|
|
|
@ -6,10 +6,6 @@
|
|||
evaluate_activation_test/instance: RuntimeError # http://dartbug.com/20047
|
||||
evaluate_activation_test/scope: RuntimeError # http://dartbug.com/20047
|
||||
|
||||
# Unexpected number format: http://dartbug.com/24038
|
||||
[ $system == windows ]
|
||||
code_test: Skip
|
||||
|
||||
# Disable on simulators.
|
||||
[ $arch == simarm || $arch == simmips || $arch == simarm64]
|
||||
*: SkipSlow
|
||||
|
|
|
@ -306,6 +306,13 @@ typedef simd128_value_t fpu_register_t;
|
|||
#define Pu64 PRIu64
|
||||
#define Px64 PRIx64
|
||||
|
||||
// Zero-padded pointer
|
||||
#if defined(ARCH_IS_32_BIT)
|
||||
#define Pp "08" PRIxPTR
|
||||
#else
|
||||
#define Pp "016" PRIxPTR
|
||||
#endif
|
||||
|
||||
|
||||
// Suffixes for 64-bit integer literals.
|
||||
#ifdef _MSC_VER
|
||||
|
|
|
@ -46,12 +46,11 @@ void DisassembleToJSONStream::ConsumeInstruction(char* hex_buffer,
|
|||
char* human_buffer,
|
||||
intptr_t human_size,
|
||||
uword pc) {
|
||||
uint8_t* pc_ptr = reinterpret_cast<uint8_t*>(pc);
|
||||
// Instructions are represented as three consecutive values in a JSON array.
|
||||
// All three are strings. The first is the address of the instruction,
|
||||
// the second is the hex string of the code, and the final is a human
|
||||
// readable string.
|
||||
jsarr_.AddValueF("%p", pc_ptr);
|
||||
jsarr_.AddValueF("%" Pp "", pc);
|
||||
jsarr_.AddValue(hex_buffer);
|
||||
jsarr_.AddValue(human_buffer);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue