| Index: runtime/vm/debugger_api_impl.cc
|
| diff --git a/runtime/vm/debugger_api_impl.cc b/runtime/vm/debugger_api_impl.cc
|
| index 18fb194ddeb042eac8fb9b66e7bec463beb39aee..f0c5532e992845acd7a8922df38101e0a5174538 100644
|
| --- a/runtime/vm/debugger_api_impl.cc
|
| +++ b/runtime/vm/debugger_api_impl.cc
|
| @@ -76,16 +76,15 @@ DART_EXPORT Dart_Handle Dart_GetCachedObject(intptr_t obj_id) {
|
| Isolate* I = T->isolate();
|
| CHECK_DEBUGGER(I);
|
| if (!I->debugger()->IsValidObjectId(obj_id)) {
|
| - return Api::NewError("%s: object id %" Pd " is invalid",
|
| - CURRENT_FUNC, obj_id);
|
| + return Api::NewError("%s: object id %" Pd " is invalid", CURRENT_FUNC,
|
| + obj_id);
|
| }
|
| return Api::NewHandle(T, I->debugger()->GetCachedObject(obj_id));
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_StackTraceLength(
|
| - Dart_StackTrace trace,
|
| - intptr_t* length) {
|
| +DART_EXPORT Dart_Handle Dart_StackTraceLength(Dart_StackTrace trace,
|
| + intptr_t* length) {
|
| DARTSCOPE(Thread::Current());
|
| CHECK_NOT_NULL(length);
|
| CHECK_AND_CAST(DebuggerStackTrace, stack_trace, trace);
|
| @@ -94,10 +93,9 @@ DART_EXPORT Dart_Handle Dart_StackTraceLength(
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_GetActivationFrame(
|
| - Dart_StackTrace trace,
|
| - int frame_index,
|
| - Dart_ActivationFrame* frame) {
|
| +DART_EXPORT Dart_Handle Dart_GetActivationFrame(Dart_StackTrace trace,
|
| + int frame_index,
|
| + Dart_ActivationFrame* frame) {
|
| DARTSCOPE(Thread::Current());
|
| CHECK_NOT_NULL(frame);
|
| CHECK_AND_CAST(DebuggerStackTrace, stack_trace, trace);
|
| @@ -105,8 +103,8 @@ DART_EXPORT Dart_Handle Dart_GetActivationFrame(
|
| return Api::NewError("argument 'frame_index' is out of range for %s",
|
| CURRENT_FUNC);
|
| }
|
| - *frame = reinterpret_cast<Dart_ActivationFrame>(
|
| - stack_trace->FrameAt(frame_index));
|
| + *frame =
|
| + reinterpret_cast<Dart_ActivationFrame>(stack_trace->FrameAt(frame_index));
|
| return Api::Success();
|
| }
|
|
|
| @@ -141,8 +139,7 @@ static void DebuggerEventHandler(ServiceEvent* event) {
|
| event->kind() == ServiceEvent::kBreakpointResolved) {
|
| Breakpoint* bpt = event->breakpoint();
|
| ASSERT(bpt != NULL);
|
| - if (bp_resolved_handler != NULL &&
|
| - bpt->bpt_location()->IsResolved() &&
|
| + if (bp_resolved_handler != NULL && bpt->bpt_location()->IsResolved() &&
|
| !bpt->IsSingleShot()) {
|
| Dart_CodeLocation location;
|
| Zone* zone = thread->zone();
|
| @@ -159,10 +156,9 @@ static void DebuggerEventHandler(ServiceEvent* event) {
|
| // Ignore.
|
| } else if (event->kind() == ServiceEvent::kPauseException) {
|
| if (exc_thrown_handler != NULL) {
|
| - Dart_Handle exception =
|
| - Api::NewHandle(thread, event->exception()->raw());
|
| + Dart_Handle exception = Api::NewHandle(thread, event->exception()->raw());
|
| Dart_StackTrace trace =
|
| - reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace());
|
| + reinterpret_cast<Dart_StackTrace>(isolate->debugger()->StackTrace());
|
| (*exc_thrown_handler)(isolate_id, exception, trace);
|
| }
|
| } else if (event->kind() == ServiceEvent::kIsolateStart) {
|
| @@ -191,14 +187,14 @@ DART_EXPORT void Dart_SetPausedEventHandler(Dart_PausedEventHandler handler) {
|
|
|
|
|
| DART_EXPORT void Dart_SetBreakpointResolvedHandler(
|
| - Dart_BreakpointResolvedHandler handler) {
|
| + Dart_BreakpointResolvedHandler handler) {
|
| bp_resolved_handler = handler;
|
| Debugger::SetEventHandler(DebuggerEventHandler);
|
| }
|
|
|
|
|
| DART_EXPORT void Dart_SetExceptionThrownHandler(
|
| - Dart_ExceptionThrownHandler handler) {
|
| + Dart_ExceptionThrownHandler handler) {
|
| exc_thrown_handler = handler;
|
| Debugger::SetEventHandler(DebuggerEventHandler);
|
| }
|
| @@ -210,8 +206,8 @@ DART_EXPORT void Dart_SetIsolateEventHandler(Dart_IsolateEventHandler handler) {
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_SetExceptionPauseInfo(
|
| - Dart_ExceptionPauseInfo pause_info) {
|
| +DART_EXPORT Dart_Handle
|
| +Dart_SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info) {
|
| DARTSCOPE(Thread::Current());
|
| Isolate* I = T->isolate();
|
| CHECK_DEBUGGER(I);
|
| @@ -235,8 +231,8 @@ DART_EXPORT Dart_Handle Dart_GetStackTrace(Dart_StackTrace* trace) {
|
| Isolate* I = T->isolate();
|
| CHECK_DEBUGGER(I);
|
| CHECK_NOT_NULL(trace);
|
| - *trace = reinterpret_cast<Dart_StackTrace>(
|
| - I->debugger()->CurrentStackTrace());
|
| + *trace =
|
| + reinterpret_cast<Dart_StackTrace>(I->debugger()->CurrentStackTrace());
|
| return Api::Success();
|
| }
|
|
|
| @@ -256,22 +252,23 @@ DART_EXPORT Dart_Handle Dart_GetStackTraceFromError(Dart_Handle handle,
|
| } else {
|
| Isolate* I = T->isolate();
|
| *trace = reinterpret_cast<Dart_StackTrace>(
|
| - I->debugger()->StackTraceFrom(dart_stacktrace));
|
| + I->debugger()->StackTraceFrom(dart_stacktrace));
|
| }
|
| return Api::Success();
|
| } else {
|
| - return Api::NewError("Can only get stacktraces from error handles or "
|
| - "instances of Error.");
|
| + return Api::NewError(
|
| + "Can only get stacktraces from error handles or "
|
| + "instances of Error.");
|
| }
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_ActivationFrameInfo(
|
| - Dart_ActivationFrame activation_frame,
|
| - Dart_Handle* function_name,
|
| - Dart_Handle* script_url,
|
| - intptr_t* line_number,
|
| - intptr_t* column_number) {
|
| +DART_EXPORT Dart_Handle
|
| +Dart_ActivationFrameInfo(Dart_ActivationFrame activation_frame,
|
| + Dart_Handle* function_name,
|
| + Dart_Handle* script_url,
|
| + intptr_t* line_number,
|
| + intptr_t* column_number) {
|
| DARTSCOPE(Thread::Current());
|
| CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
|
| if (function_name != NULL) {
|
| @@ -290,11 +287,11 @@ DART_EXPORT Dart_Handle Dart_ActivationFrameInfo(
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_ActivationFrameGetLocation(
|
| - Dart_ActivationFrame activation_frame,
|
| - Dart_Handle* function_name,
|
| - Dart_Handle* function,
|
| - Dart_CodeLocation* location) {
|
| +DART_EXPORT Dart_Handle
|
| +Dart_ActivationFrameGetLocation(Dart_ActivationFrame activation_frame,
|
| + Dart_Handle* function_name,
|
| + Dart_Handle* function,
|
| + Dart_CodeLocation* location) {
|
| // TODO(hausner): Implement a way to recognize when there
|
| // is no source code for the code in the frame.
|
| DARTSCOPE(Thread::Current());
|
| @@ -315,9 +312,9 @@ DART_EXPORT Dart_Handle Dart_ActivationFrameGetLocation(
|
| return Api::Success();
|
| }
|
|
|
| -DART_EXPORT Dart_Handle Dart_ActivationFrameGetFramePointer(
|
| - Dart_ActivationFrame activation_frame,
|
| - uintptr_t* frame_pointer) {
|
| +DART_EXPORT Dart_Handle
|
| +Dart_ActivationFrameGetFramePointer(Dart_ActivationFrame activation_frame,
|
| + uintptr_t* frame_pointer) {
|
| DARTSCOPE(Thread::Current());
|
| CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
|
|
|
| @@ -340,25 +337,23 @@ DART_EXPORT Dart_Handle Dart_GetFunctionOrigin(Dart_Handle function_in) {
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_GetLocalVariables(
|
| - Dart_ActivationFrame activation_frame) {
|
| +DART_EXPORT Dart_Handle
|
| +Dart_GetLocalVariables(Dart_ActivationFrame activation_frame) {
|
| DARTSCOPE(Thread::Current());
|
| CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
|
| return Api::NewHandle(T, frame->GetLocalVariables());
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_SetBreakpoint(
|
| - Dart_Handle script_url_in,
|
| - intptr_t line_number) {
|
| +DART_EXPORT Dart_Handle Dart_SetBreakpoint(Dart_Handle script_url_in,
|
| + intptr_t line_number) {
|
| DARTSCOPE(Thread::Current());
|
| Isolate* I = T->isolate();
|
| CHECK_DEBUGGER(I);
|
| UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
|
|
|
| Debugger* debugger = I->debugger();
|
| - Breakpoint* bpt =
|
| - debugger->SetBreakpointAtLine(script_url, line_number);
|
| + Breakpoint* bpt = debugger->SetBreakpointAtLine(script_url, line_number);
|
| if (bpt == NULL) {
|
| return Api::NewError("%s: could not set breakpoint at line %" Pd " in '%s'",
|
| CURRENT_FUNC, line_number, script_url.ToCString());
|
| @@ -376,7 +371,7 @@ DART_EXPORT Dart_Handle Dart_GetBreakpointURL(intptr_t bp_id) {
|
| Breakpoint* bpt = debugger->GetBreakpointById(bp_id);
|
| if (bpt == NULL) {
|
| return Api::NewError("%s: breakpoint with id %" Pd " does not exist",
|
| - CURRENT_FUNC, bp_id);
|
| + CURRENT_FUNC, bp_id);
|
| }
|
| return Api::NewHandle(T, bpt->bpt_location()->url());
|
| }
|
| @@ -401,10 +396,10 @@ DART_EXPORT Dart_Handle Dart_GetBreakpointLine(intptr_t bp_id) {
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry(
|
| - Dart_Handle library_in,
|
| - Dart_Handle class_name_in,
|
| - Dart_Handle function_name_in) {
|
| +DART_EXPORT Dart_Handle
|
| +Dart_SetBreakpointAtEntry(Dart_Handle library_in,
|
| + Dart_Handle class_name_in,
|
| + Dart_Handle function_name_in) {
|
| DARTSCOPE(Thread::Current());
|
| Isolate* I = T->isolate();
|
| CHECK_DEBUGGER(I);
|
| @@ -415,8 +410,7 @@ DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry(
|
| // Ensure that the library is loaded.
|
| if (!library.Loaded()) {
|
| return Api::NewError(
|
| - "%s expects library argument 'library_in' to be loaded.",
|
| - CURRENT_FUNC);
|
| + "%s expects library argument 'library_in' to be loaded.", CURRENT_FUNC);
|
| }
|
|
|
| // Resolve the breakpoint target function.
|
| @@ -425,11 +419,9 @@ DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry(
|
| debugger->ResolveFunction(library, class_name, function_name));
|
| if (bp_target.IsNull()) {
|
| const bool toplevel = class_name.Length() == 0;
|
| - return Api::NewError("%s: could not find function '%s%s%s'",
|
| - CURRENT_FUNC,
|
| + return Api::NewError("%s: could not find function '%s%s%s'", CURRENT_FUNC,
|
| toplevel ? "" : class_name.ToCString(),
|
| - toplevel ? "" : ".",
|
| - function_name.ToCString());
|
| + toplevel ? "" : ".", function_name.ToCString());
|
| }
|
|
|
| Breakpoint* bpt = debugger->SetBreakpointAtEntry(bp_target, false);
|
| @@ -442,10 +434,9 @@ DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry(
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(
|
| - Dart_Handle library_in,
|
| - Dart_Handle class_name_in,
|
| - Dart_Handle function_name_in) {
|
| +DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(Dart_Handle library_in,
|
| + Dart_Handle class_name_in,
|
| + Dart_Handle function_name_in) {
|
| DARTSCOPE(Thread::Current());
|
| Isolate* I = T->isolate();
|
| CHECK_DEBUGGER(I);
|
| @@ -456,8 +447,7 @@ DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(
|
| // Ensure that the library is loaded.
|
| if (!library.Loaded()) {
|
| return Api::NewError(
|
| - "%s expects library argument 'library_in' to be loaded.",
|
| - CURRENT_FUNC);
|
| + "%s expects library argument 'library_in' to be loaded.", CURRENT_FUNC);
|
| }
|
|
|
| // Resolve the breakpoint target function.
|
| @@ -466,15 +456,13 @@ DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry(
|
| debugger->ResolveFunction(library, class_name, function_name));
|
| if (bp_target.IsNull()) {
|
| const bool toplevel = class_name.Length() == 0;
|
| - return Api::NewError("%s: could not find function '%s%s%s'",
|
| - CURRENT_FUNC,
|
| + return Api::NewError("%s: could not find function '%s%s%s'", CURRENT_FUNC,
|
| toplevel ? "" : class_name.ToCString(),
|
| - toplevel ? "" : ".",
|
| - function_name.ToCString());
|
| + toplevel ? "" : ".", function_name.ToCString());
|
| }
|
|
|
| - const Error& error = Error::Handle(Z,
|
| - debugger->OneTimeBreakAtEntry(bp_target));
|
| + const Error& error =
|
| + Error::Handle(Z, debugger->OneTimeBreakAtEntry(bp_target));
|
| if (!error.IsNull()) {
|
| return Api::NewHandle(T, error.raw());
|
| }
|
| @@ -545,11 +533,10 @@ DART_EXPORT Dart_Handle Dart_GetLibraryFields(intptr_t library_id) {
|
| DARTSCOPE(Thread::Current());
|
| Isolate* I = T->isolate();
|
| CHECK_DEBUGGER(I);
|
| - const Library& lib =
|
| - Library::Handle(Z, Library::GetLibrary(library_id));
|
| + const Library& lib = Library::Handle(Z, Library::GetLibrary(library_id));
|
| if (lib.IsNull()) {
|
| - return Api::NewError("%s: %" Pd " is not a valid library id",
|
| - CURRENT_FUNC, library_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
|
| + library_id);
|
| }
|
| return Api::NewHandle(T, I->debugger()->GetLibraryFields(lib));
|
| }
|
| @@ -562,16 +549,16 @@ DART_EXPORT Dart_Handle Dart_GetGlobalVariables(intptr_t library_id) {
|
|
|
| const Library& lib = Library::Handle(Z, Library::GetLibrary(library_id));
|
| if (lib.IsNull()) {
|
| - return Api::NewError("%s: %" Pd " is not a valid library id",
|
| - CURRENT_FUNC, library_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
|
| + library_id);
|
| }
|
| return Api::NewHandle(T, I->debugger()->GetGlobalFields(lib));
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_ActivationFrameEvaluate(
|
| - Dart_ActivationFrame activation_frame,
|
| - Dart_Handle expr_in) {
|
| +DART_EXPORT Dart_Handle
|
| +Dart_ActivationFrameEvaluate(Dart_ActivationFrame activation_frame,
|
| + Dart_Handle expr_in) {
|
| DARTSCOPE(Thread::Current());
|
| CHECK_DEBUGGER(T->isolate());
|
| CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
|
| @@ -595,26 +582,22 @@ DART_EXPORT Dart_Handle Dart_EvaluateExpr(Dart_Handle target_in,
|
| // Type extends Instance, must check first.
|
| if (target.IsType()) {
|
| const Class& cls = Class::Handle(Z, Type::Cast(target).type_class());
|
| - return Api::NewHandle(T, cls.Evaluate(expr,
|
| - Array::empty_array(),
|
| - Array::empty_array()));
|
| + return Api::NewHandle(
|
| + T, cls.Evaluate(expr, Array::empty_array(), Array::empty_array()));
|
| } else if (target.IsInstance()) {
|
| const Instance& inst = Instance::Cast(target);
|
| const Class& receiver_cls = Class::Handle(Z, inst.clazz());
|
| - return Api::NewHandle(T, inst.Evaluate(receiver_cls,
|
| - expr,
|
| - Array::empty_array(),
|
| - Array::empty_array()));
|
| + return Api::NewHandle(
|
| + T, inst.Evaluate(receiver_cls, expr, Array::empty_array(),
|
| + Array::empty_array()));
|
| } else if (target.IsLibrary()) {
|
| const Library& lib = Library::Cast(target);
|
| - return Api::NewHandle(T, lib.Evaluate(expr,
|
| - Array::empty_array(),
|
| - Array::empty_array()));
|
| + return Api::NewHandle(
|
| + T, lib.Evaluate(expr, Array::empty_array(), Array::empty_array()));
|
| } else if (target.IsClass()) {
|
| const Class& cls = Class::Cast(target);
|
| - return Api::NewHandle(T, cls.Evaluate(expr,
|
| - Array::empty_array(),
|
| - Array::empty_array()));
|
| + return Api::NewHandle(
|
| + T, cls.Evaluate(expr, Array::empty_array(), Array::empty_array()));
|
| }
|
| return Api::NewError("%s: unsupported target type", CURRENT_FUNC);
|
| }
|
| @@ -641,8 +624,8 @@ DART_EXPORT Dart_Handle Dart_GetClassFromId(intptr_t class_id) {
|
| DARTSCOPE(Thread::Current());
|
| Isolate* I = T->isolate();
|
| if (!I->class_table()->IsValidIndex(class_id)) {
|
| - return Api::NewError("%s: %" Pd " is not a valid class id",
|
| - CURRENT_FUNC, class_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid class id", CURRENT_FUNC,
|
| + class_id);
|
| }
|
| return Api::NewHandle(T, I->class_table()->At(class_id));
|
| }
|
| @@ -694,11 +677,10 @@ DART_EXPORT Dart_Handle Dart_GetSupertype(Dart_Handle type_in) {
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_GetClosureInfo(
|
| - Dart_Handle closure,
|
| - Dart_Handle* name,
|
| - Dart_Handle* signature,
|
| - Dart_CodeLocation* location) {
|
| +DART_EXPORT Dart_Handle Dart_GetClosureInfo(Dart_Handle closure,
|
| + Dart_Handle* name,
|
| + Dart_Handle* signature,
|
| + Dart_CodeLocation* location) {
|
| DARTSCOPE(Thread::Current());
|
| UNWRAP_AND_CHECK_PARAM(Instance, instance, closure);
|
| CHECK_NOT_NULL(location);
|
| @@ -737,18 +719,17 @@ DART_EXPORT Dart_Handle Dart_GetClosureInfo(
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_GetClassInfo(
|
| - intptr_t cls_id,
|
| - Dart_Handle* class_name,
|
| - intptr_t* library_id,
|
| - intptr_t* super_class_id,
|
| - Dart_Handle* static_fields) {
|
| +DART_EXPORT Dart_Handle Dart_GetClassInfo(intptr_t cls_id,
|
| + Dart_Handle* class_name,
|
| + intptr_t* library_id,
|
| + intptr_t* super_class_id,
|
| + Dart_Handle* static_fields) {
|
| DARTSCOPE(Thread::Current());
|
| Isolate* I = T->isolate();
|
| CHECK_DEBUGGER(I);
|
| if (!I->class_table()->IsValidIndex(cls_id)) {
|
| - return Api::NewError("%s: %" Pd " is not a valid class id",
|
| - CURRENT_FUNC, cls_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid class id", CURRENT_FUNC,
|
| + cls_id);
|
| }
|
| Class& cls = Class::Handle(Z, I->class_table()->At(cls_id));
|
| if (class_name != NULL) {
|
| @@ -766,21 +747,19 @@ DART_EXPORT Dart_Handle Dart_GetClassInfo(
|
| }
|
| }
|
| if (static_fields != NULL) {
|
| - *static_fields =
|
| - Api::NewHandle(T, I->debugger()->GetStaticFields(cls));
|
| + *static_fields = Api::NewHandle(T, I->debugger()->GetStaticFields(cls));
|
| }
|
| return Api::Success();
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_ScriptGetSource(
|
| - intptr_t library_id,
|
| - Dart_Handle script_url_in) {
|
| +DART_EXPORT Dart_Handle Dart_ScriptGetSource(intptr_t library_id,
|
| + Dart_Handle script_url_in) {
|
| DARTSCOPE(Thread::Current());
|
| const Library& lib = Library::Handle(Library::GetLibrary(library_id));
|
| if (lib.IsNull()) {
|
| - return Api::NewError("%s: %" Pd " is not a valid library id",
|
| - CURRENT_FUNC, library_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
|
| + library_id);
|
| }
|
| UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
|
| const Script& script = Script::Handle(lib.LookupScript(script_url));
|
| @@ -793,14 +772,13 @@ DART_EXPORT Dart_Handle Dart_ScriptGetSource(
|
| }
|
|
|
|
|
| -DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo(
|
| - intptr_t library_id,
|
| - Dart_Handle script_url_in) {
|
| +DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo(intptr_t library_id,
|
| + Dart_Handle script_url_in) {
|
| DARTSCOPE(Thread::Current());
|
| const Library& lib = Library::Handle(Library::GetLibrary(library_id));
|
| if (lib.IsNull()) {
|
| - return Api::NewError("%s: %" Pd " is not a valid library id",
|
| - CURRENT_FUNC, library_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
|
| + library_id);
|
| }
|
| UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
|
| const Script& script = Script::Handle(lib.LookupScript(script_url));
|
| @@ -822,11 +800,11 @@ DART_EXPORT Dart_Handle Dart_GenerateScriptSource(Dart_Handle library_url_in,
|
| UNWRAP_AND_CHECK_PARAM(String, library_url, library_url_in);
|
| UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
|
|
|
| - const Library& library = Library::Handle(Z,
|
| - Library::LookupLibrary(T, library_url));
|
| + const Library& library =
|
| + Library::Handle(Z, Library::LookupLibrary(T, library_url));
|
| if (library.IsNull()) {
|
| - return Api::NewError("%s: library '%s' not found",
|
| - CURRENT_FUNC, library_url.ToCString());
|
| + return Api::NewError("%s: library '%s' not found", CURRENT_FUNC,
|
| + library_url.ToCString());
|
| }
|
|
|
| const Script& script = Script::Handle(Z, library.LookupScript(script_url));
|
| @@ -844,11 +822,11 @@ DART_EXPORT Dart_Handle Dart_GetScriptURLs(Dart_Handle library_url_in) {
|
| DARTSCOPE(Thread::Current());
|
| UNWRAP_AND_CHECK_PARAM(String, library_url, library_url_in);
|
|
|
| - const Library& library = Library::Handle(Z,
|
| - Library::LookupLibrary(T, library_url));
|
| + const Library& library =
|
| + Library::Handle(Z, Library::LookupLibrary(T, library_url));
|
| if (library.IsNull()) {
|
| - return Api::NewError("%s: library '%s' not found",
|
| - CURRENT_FUNC, library_url.ToCString());
|
| + return Api::NewError("%s: library '%s' not found", CURRENT_FUNC,
|
| + library_url.ToCString());
|
| }
|
| const Array& loaded_scripts = Array::Handle(Z, library.LoadedScripts());
|
| ASSERT(!loaded_scripts.IsNull());
|
| @@ -874,7 +852,7 @@ DART_EXPORT Dart_Handle Dart_GetLibraryIds() {
|
| int num_libs = libs.Length();
|
|
|
| // Create new list and populate with the url of loaded libraries.
|
| - Library &lib = Library::Handle();
|
| + Library& lib = Library::Handle();
|
| const Array& library_id_list = Array::Handle(Z, Array::New(num_libs));
|
| for (int i = 0; i < num_libs; i++) {
|
| lib ^= libs.At(i);
|
| @@ -890,8 +868,8 @@ DART_EXPORT Dart_Handle Dart_GetLibraryFromId(intptr_t library_id) {
|
| DARTSCOPE(Thread::Current());
|
| const Library& lib = Library::Handle(Z, Library::GetLibrary(library_id));
|
| if (lib.IsNull()) {
|
| - return Api::NewError("%s: %" Pd " is not a valid library id",
|
| - CURRENT_FUNC, library_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
|
| + library_id);
|
| }
|
| return Api::NewHandle(T, lib.raw());
|
| }
|
| @@ -916,8 +894,8 @@ DART_EXPORT Dart_Handle Dart_GetLibraryImports(intptr_t library_id) {
|
| DARTSCOPE(Thread::Current());
|
| const Library& lib = Library::Handle(Library::GetLibrary(library_id));
|
| if (lib.IsNull()) {
|
| - return Api::NewError("%s: %" Pd " is not a valid library id",
|
| - CURRENT_FUNC, library_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
|
| + library_id);
|
| }
|
| const GrowableObjectArray& import_list =
|
| GrowableObjectArray::Handle(GrowableObjectArray::New(8));
|
| @@ -953,8 +931,8 @@ DART_EXPORT Dart_Handle Dart_GetLibraryURL(intptr_t library_id) {
|
| DARTSCOPE(Thread::Current());
|
| const Library& lib = Library::Handle(Z, Library::GetLibrary(library_id));
|
| if (lib.IsNull()) {
|
| - return Api::NewError("%s: %" Pd " is not a valid library id",
|
| - CURRENT_FUNC, library_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
|
| + library_id);
|
| }
|
| return Api::NewHandle(T, lib.url());
|
| }
|
| @@ -966,8 +944,8 @@ DART_EXPORT Dart_Handle Dart_GetLibraryDebuggable(intptr_t library_id,
|
| CHECK_NOT_NULL(is_debuggable);
|
| const Library& lib = Library::Handle(Library::GetLibrary(library_id));
|
| if (lib.IsNull()) {
|
| - return Api::NewError("%s: %" Pd " is not a valid library id",
|
| - CURRENT_FUNC, library_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
|
| + library_id);
|
| }
|
| *is_debuggable = lib.IsDebuggable();
|
| return Api::Success();
|
| @@ -979,8 +957,8 @@ DART_EXPORT Dart_Handle Dart_SetLibraryDebuggable(intptr_t library_id,
|
| DARTSCOPE(Thread::Current());
|
| const Library& lib = Library::Handle(Z, Library::GetLibrary(library_id));
|
| if (lib.IsNull()) {
|
| - return Api::NewError("%s: %" Pd " is not a valid library id",
|
| - CURRENT_FUNC, library_id);
|
| + return Api::NewError("%s: %" Pd " is not a valid library id", CURRENT_FUNC,
|
| + library_id);
|
| }
|
| lib.set_debuggable(is_debuggable);
|
| return Api::Success();
|
|
|