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

Unified Diff: runtime/platform/json.cc

Issue 59883019: Fix json message in debugger wire protocol (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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/bin/dbg_message.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/json.cc
===================================================================
--- runtime/platform/json.cc (revision 30289)
+++ runtime/platform/json.cc (working copy)
@@ -255,13 +255,22 @@
}
}
+
+#if defined (DEBUG)
#define CHECK_TOKEN(token) \
if (scanner_.CurrentToken() != token) { \
OS::Print("Malformed JSON: expected %s but got '%s'\n", \
#token, scanner_.TokenChars()); \
- } \
- ASSERT(scanner_.CurrentToken() == token);
+ intptr_t offset = scanner_.TokenChars() - this->json_object_; \
+ OS::Print("Malformed JSON: expected %s at offset %" Pd "of buffer:\n%s\n", \
+ #token, offset, this->json_object_); \
+ ASSERT(scanner_.CurrentToken() == token); \
+ }
+#else
+#define CHECK_TOKEN(token)
+#endif
+
void JSONReader::CheckArray() {
CHECK_TOKEN(JSONScanner::TokenLBrack);
scanner_.Scan();
« no previous file with comments | « runtime/bin/dbg_message.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698