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

Unified Diff: runtime/bin/dbg_message.cc

Issue 13975018: More cleanups in debugger API and wire protocol (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | « no previous file | runtime/include/dart_debugger_api.h » ('j') | runtime/include/dart_debugger_api.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dbg_message.cc
===================================================================
--- runtime/bin/dbg_message.cc (revision 21365)
+++ runtime/bin/dbg_message.cc (working copy)
@@ -398,24 +398,15 @@
Dart_ActivationFrame frame;
res = Dart_GetActivationFrame(trace, 0, &frame);
ASSERT_NOT_ERROR(res);
- Dart_Handle script_url;
- intptr_t token_number = 0;
- intptr_t line_number = 0;
- intptr_t library_id = 0;
- // TODO(hausner): Remove this call and line_number once Editor no
- // longer depends on line number info.
- res = Dart_ActivationFrameInfo(frame, NULL, NULL, &line_number, NULL);
+ Dart_CodeLocation location;
+ res = Dart_ActivationFrameGetLocation(frame, NULL, &location);
ASSERT_NOT_ERROR(res);
- res = Dart_ActivationFrameGetLocation(
- frame, &script_url, &library_id, &token_number);
- ASSERT_NOT_ERROR(res);
- if (!Dart_IsNull(script_url)) {
- ASSERT(Dart_IsString(script_url));
+ if (!Dart_IsNull(location.script_url)) {
+ ASSERT(Dart_IsString(location.script_url));
msg->Printf("%s\"location\": { \"url\":", prefix);
- FormatEncodedString(msg, script_url);
- msg->Printf(",\"libraryId\":%"Pd",", library_id);
- msg->Printf("\"tokenOffset\":%"Pd",", token_number);
- msg->Printf("\"lineNumber\":%"Pd"}", line_number);
+ FormatEncodedString(msg, location.script_url);
+ msg->Printf(",\"libraryId\":%d,", location.library_id);
+ msg->Printf("\"tokenOffset\":%d}", location.token_pos);
}
}
@@ -430,33 +421,19 @@
res = Dart_GetActivationFrame(trace, i, &frame);
ASSERT_NOT_ERROR(res);
Dart_Handle func_name;
- Dart_Handle script_url;
- intptr_t line_number = 0;
- intptr_t token_number = 0;
- intptr_t library_id = 0;
- res = Dart_ActivationFrameInfo(
- frame, &func_name, NULL, &line_number, &library_id);
+ Dart_CodeLocation location;
+ res = Dart_ActivationFrameGetLocation(frame, &func_name, &location);
ASSERT_NOT_ERROR(res);
-
ASSERT(Dart_IsString(func_name));
msg->Printf("%s{\"functionName\":", (i > 0) ? "," : "");
FormatEncodedString(msg, func_name);
- // TODO(hausner): Remove this libraryId field when Editor
- // no longer depends on it.
- msg->Printf(",\"libraryId\": %"Pd",", library_id);
-
- res = Dart_ActivationFrameGetLocation(
- frame, &script_url, NULL, &token_number);
- ASSERT_NOT_ERROR(res);
- if (!Dart_IsNull(script_url)) {
- ASSERT(Dart_IsString(script_url));
+ if (!Dart_IsNull(location.script_url)) {
+ ASSERT(Dart_IsString(location.script_url));
msg->Printf("\"location\": { \"url\":");
- FormatEncodedString(msg, script_url);
- msg->Printf(",\"libraryId\": %"Pd",", library_id);
- msg->Printf("\"tokenOffset\":%"Pd",", token_number);
- msg->Printf("\"lineNumber\":%"Pd"},", line_number);
+ FormatEncodedString(msg, location.script_url);
+ msg->Printf(",\"libraryId\":%d,", location.library_id);
+ msg->Printf("\"tokenOffset\":%d},", location.token_pos);
}
-
Dart_Handle locals = Dart_GetLocalVariables(frame);
ASSERT_NOT_ERROR(locals);
msg->Printf("\"locals\":");
« no previous file with comments | « no previous file | runtime/include/dart_debugger_api.h » ('j') | runtime/include/dart_debugger_api.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698