Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Unified Diff: runtime/vm/object.cc

Issue 10826116: Revert "Use platform-independent format specifiers when disassembling code objects." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 5617c02a0f3f1ab66f9cc8b9ee640dcfef60070e..a8672e310dddec6ef7a3b1d1c84ddc0c6c5eab1d 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6601,17 +6601,16 @@ const char* PcDescriptors::ToCString() const {
if (Length() == 0) {
return "No pc descriptors\n";
}
- const char* kFormat =
- "0x%" PRIxPTR "\t%s\t%" PRIdPTR "\t%" PRIdPTR "\t%" PRIdPTR "\n";
+ const char* kFormat = "0x%x\t%s\t%ld\t%ld\t%ld\n";
// First compute the buffer size required.
- intptr_t len = 1; // Trailing '\0'.
+ intptr_t len = 0;
for (intptr_t i = 0; i < Length(); i++) {
len += OS::SNPrint(NULL, 0, kFormat,
PC(i), KindAsStr(i), NodeId(i), TryIndex(i), TokenIndex(i));
}
// Allocate the buffer.
char* buffer = reinterpret_cast<char*>(
- Isolate::Current()->current_zone()->Allocate(len));
+ Isolate::Current()->current_zone()->Allocate(len + 1));
// Layout the fields in the buffer.
intptr_t index = 0;
for (intptr_t i = 0; i < Length(); i++) {
@@ -6871,20 +6870,20 @@ const char* ExceptionHandlers::ToCString() const {
return "No exception handlers\n";
}
// First compute the buffer size required.
- const char* kFormat = "%" PRIdPTR " => 0x%" PRIxPTR "\n";
- intptr_t len = 1; // Trailing '\0'.
+ intptr_t len = 0;
for (intptr_t i = 0; i < Length(); i++) {
- len += OS::SNPrint(NULL, 0, kFormat, TryIndex(i), HandlerPC(i));
+ len += OS::SNPrint(NULL, 0, "%ld => 0x%x\n",
+ TryIndex(i), HandlerPC(i));
}
// Allocate the buffer.
char* buffer = reinterpret_cast<char*>(
- Isolate::Current()->current_zone()->Allocate(len));
+ Isolate::Current()->current_zone()->Allocate(len + 1));
// Layout the fields in the buffer.
intptr_t index = 0;
for (intptr_t i = 0; i < Length(); i++) {
index += OS::SNPrint((buffer + index),
(len - index),
- kFormat,
+ "%ld => 0x%x\n",
TryIndex(i),
HandlerPC(i));
}
« no previous file with comments | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698