diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart index 5c94d0c5b4b..2e6995271c6 100644 --- a/runtime/observatory/lib/src/service/object.dart +++ b/runtime/observatory/lib/src/service/object.dart @@ -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); diff --git a/runtime/observatory/tests/service/service.status b/runtime/observatory/tests/service/service.status index 6cd7d0dffbf..d2a9b867bb3 100644 --- a/runtime/observatory/tests/service/service.status +++ b/runtime/observatory/tests/service/service.status @@ -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 diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h index cc6612ea8cd..0d493100639 100644 --- a/runtime/platform/globals.h +++ b/runtime/platform/globals.h @@ -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 diff --git a/runtime/vm/disassembler.cc b/runtime/vm/disassembler.cc index 80e1ff6e63a..1a924508b97 100644 --- a/runtime/vm/disassembler.cc +++ b/runtime/vm/disassembler.cc @@ -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(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); }