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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 3004563003: Refactor Isolate name format, storage and log (Closed)
Patch Set: Make Dart_DebugName unique again Created 3 years, 4 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_stats.cc ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 76119d6baa2df088bcd7e262f1a3ff03c0051f2d..04c5f313cc3429fefae25ab46a6d6b0c3e8c8d5c 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1096,9 +1096,9 @@ static char* BuildIsolateName(const char* script_uri, const char* main) {
}
char* chars = NULL;
- intptr_t len = OS::SNPrint(NULL, 0, "%s$%s", script_uri, main) + 1;
+ intptr_t len = OS::SNPrint(NULL, 0, "%s:%s()", script_uri, main) + 1;
chars = reinterpret_cast<char*>(malloc(len));
- OS::SNPrint(chars, len, "%s$%s", script_uri, main);
+ OS::SNPrint(chars, len, "%s:%s()", script_uri, main);
return chars;
}
@@ -1235,7 +1235,9 @@ DART_EXPORT void* Dart_IsolateData(Dart_Isolate isolate) {
DART_EXPORT Dart_Handle Dart_DebugName() {
DARTSCOPE(Thread::Current());
Isolate* I = T->isolate();
- return Api::NewHandle(T, String::New(I->name()));
+ return Api::NewHandle(
+ T, String::NewFormatted("(%" Pd64 ") '%s'",
+ static_cast<int64_t>(I->main_port()), I->name()));
}
DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate) {
« no previous file with comments | « runtime/vm/compiler_stats.cc ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698