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

Unified Diff: runtime/vm/service.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/message_handler.cc ('k') | runtime/vm/timeline_analysis.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index fe24ad50bccec872c066d1292279f343b1873a33..8b603ef73977f0cdd78d4caeae4b2c3d478a50f2 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -914,9 +914,12 @@ void Service::SendEvent(const char* stream_id,
if (FLAG_trace_service) {
OS::PrintErr(
- "vm-service: Pushing ServiceEvent(isolate='%s', kind='%s',"
+ "vm-service: Pushing ServiceEvent(isolate='%s', "
+ "isolateId='" ISOLATE_SERVICE_ID_FORMAT_STRING
+ "', kind='%s',"
" len=%" Pd ") to stream %s\n",
- isolate->name(), event_type, bytes_length, stream_id);
+ isolate->name(), static_cast<int64_t>(isolate->main_port()), event_type,
+ bytes_length, stream_id);
}
bool result;
@@ -982,42 +985,40 @@ void Service::SendEventWithData(const char* stream_id,
}
static void ReportPauseOnConsole(ServiceEvent* event) {
- const char* name = event->isolate()->debugger_name();
+ const char* name = event->isolate()->name();
+ const int64_t main_port = static_cast<int64_t>(event->isolate()->main_port());
switch (event->kind()) {
case ServiceEvent::kPauseStart:
- OS::PrintErr(
- "vm-service: isolate '%s' has no debugger attached and is paused at "
- "start.",
- name);
+ OS::PrintErr("vm-service: isolate(%" Pd64
+ ") '%s' has no debugger attached and is paused at start.",
+ main_port, name);
break;
case ServiceEvent::kPauseExit:
- OS::PrintErr(
- "vm-service: isolate '%s' has no debugger attached and is paused at "
- "exit.",
- name);
+ OS::PrintErr("vm-service: isolate(%" Pd64
+ ") '%s' has no debugger attached and is paused at exit.",
+ main_port, name);
break;
case ServiceEvent::kPauseException:
OS::PrintErr(
- "vm-service: isolate '%s' has no debugger attached and is paused due "
- "to exception.",
- name);
+ "vm-service: isolate (%" Pd64
+ ") '%s' has no debugger attached and is paused due to exception.",
+ main_port, name);
break;
case ServiceEvent::kPauseInterrupted:
OS::PrintErr(
- "vm-service: isolate '%s' has no debugger attached and is paused due "
- "to interrupt.",
- name);
+ "vm-service: isolate (%" Pd64
+ ") '%s' has no debugger attached and is paused due to interrupt.",
+ main_port, name);
break;
case ServiceEvent::kPauseBreakpoint:
- OS::PrintErr(
- "vm-service: isolate '%s' has no debugger attached and is paused.",
- name);
+ OS::PrintErr("vm-service: isolate (%" Pd64
+ ") '%s' has no debugger attached and is paused.",
+ main_port, name);
break;
case ServiceEvent::kPausePostRequest:
- OS::PrintErr(
- "vm-service: isolate '%s' has no debugger attached and is paused "
- "post reload.",
- name);
+ OS::PrintErr("vm-service: isolate (%" Pd64
+ ") '%s' has no debugger attached and is paused post reload.",
+ main_port, name);
break;
default:
UNREACHABLE();
@@ -1094,14 +1095,19 @@ void Service::PostEvent(Isolate* isolate,
list_values[1] = &json_cobj;
if (FLAG_trace_service) {
- const char* isolate_name = "<no current isolate>";
if (isolate != NULL) {
- isolate_name = isolate->name();
+ OS::PrintErr(
+ "vm-service: Pushing ServiceEvent(isolate='%s', "
+ "isolateId='" ISOLATE_SERVICE_ID_FORMAT_STRING
+ "', kind='%s') to stream %s\n",
+ isolate->name(), static_cast<int64_t>(isolate->main_port()), kind,
+ stream_id);
+ } else {
+ OS::PrintErr(
+ "vm-service: Pushing ServiceEvent(isolate='<no current isolate>', "
+ "kind='%s') to stream %s\n",
+ kind, stream_id);
}
- OS::PrintErr(
- "vm-service: Pushing ServiceEvent(isolate='%s', kind='%s') "
- "to stream %s\n",
- isolate_name, kind, stream_id);
}
Dart_PostCObject(ServiceIsolate::Port(), &list_cobj);
@@ -4018,7 +4024,7 @@ static const MethodParameter* set_name_params[] = {
static bool SetName(Thread* thread, JSONStream* js) {
Isolate* isolate = thread->isolate();
- isolate->set_debugger_name(js->LookupParam("name"));
+ isolate->set_name(js->LookupParam("name"));
if (Service::isolate_stream.enabled()) {
ServiceEvent event(isolate, ServiceEvent::kIsolateUpdate);
Service::HandleEvent(&event);
« no previous file with comments | « runtime/vm/message_handler.cc ('k') | runtime/vm/timeline_analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698