Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 | 6 |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/compiler.h" | 8 #include "vm/compiler.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_state.h" | 10 #include "vm/dart_api_state.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 #define CHECK_NOT_NULL(param) \ | 46 #define CHECK_NOT_NULL(param) \ |
| 47 if (param == NULL) { \ | 47 if (param == NULL) { \ |
| 48 return Api::NewError("%s expects argument '%s' to be non-null.", \ | 48 return Api::NewError("%s expects argument '%s' to be non-null.", \ |
| 49 CURRENT_FUNC, #param); \ | 49 CURRENT_FUNC, #param); \ |
| 50 } | 50 } |
| 51 | 51 |
| 52 | 52 |
| 53 DART_EXPORT intptr_t Dart_CacheObject(Dart_Handle object_in) { | 53 DART_EXPORT intptr_t Dart_CacheObject(Dart_Handle object_in) { |
| 54 Isolate* isolate = Isolate::Current(); | 54 Isolate* isolate = Isolate::Current(); |
| 55 DARTSCOPE(isolate); | 55 DARTSCOPE(isolate); |
| 56 ASSERT(isolate->debugger() != NULL); | |
| 56 const Object& obj = Object::Handle(Api::UnwrapHandle(object_in)); | 57 const Object& obj = Object::Handle(Api::UnwrapHandle(object_in)); |
| 57 if (obj.IsApiError()) { | 58 if (obj.IsApiError()) { |
| 58 return -1; | 59 return -1; |
| 59 } | 60 } |
| 60 return isolate->debugger()->CacheObject(obj); | 61 return isolate->debugger()->CacheObject(obj); |
| 61 } | 62 } |
| 62 | 63 |
| 63 | 64 |
| 64 DART_EXPORT Dart_Handle Dart_GetCachedObject(intptr_t obj_id) { | 65 DART_EXPORT Dart_Handle Dart_GetCachedObject(intptr_t obj_id) { |
| 65 Isolate* isolate = Isolate::Current(); | 66 Isolate* isolate = Isolate::Current(); |
| 66 DARTSCOPE(isolate); | 67 DARTSCOPE(isolate); |
| 68 ASSERT(isolate->debugger() != NULL); | |
| 67 if (!isolate->debugger()->IsValidObjectId(obj_id)) { | 69 if (!isolate->debugger()->IsValidObjectId(obj_id)) { |
| 68 return Api::NewError("%s: object id %" Pd " is invalid", | 70 return Api::NewError("%s: object id %" Pd " is invalid", |
| 69 CURRENT_FUNC, obj_id); | 71 CURRENT_FUNC, obj_id); |
| 70 } | 72 } |
| 71 return Api::NewHandle(isolate, isolate->debugger()->GetCachedObject(obj_id)); | 73 return Api::NewHandle(isolate, isolate->debugger()->GetCachedObject(obj_id)); |
| 72 } | 74 } |
| 73 | 75 |
| 74 | 76 |
| 75 DART_EXPORT Dart_Handle Dart_StackTraceLength( | 77 DART_EXPORT Dart_Handle Dart_StackTraceLength( |
| 76 Dart_StackTrace trace, | 78 Dart_StackTrace trace, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 DART_EXPORT void Dart_SetIsolateEventHandler(Dart_IsolateEventHandler handler) { | 194 DART_EXPORT void Dart_SetIsolateEventHandler(Dart_IsolateEventHandler handler) { |
| 193 isolate_event_handler = handler; | 195 isolate_event_handler = handler; |
| 194 Debugger::SetEventHandler(DebuggerEventHandler); | 196 Debugger::SetEventHandler(DebuggerEventHandler); |
| 195 } | 197 } |
| 196 | 198 |
| 197 | 199 |
| 198 DART_EXPORT Dart_Handle Dart_SetExceptionPauseInfo( | 200 DART_EXPORT Dart_Handle Dart_SetExceptionPauseInfo( |
| 199 Dart_ExceptionPauseInfo pause_info) { | 201 Dart_ExceptionPauseInfo pause_info) { |
| 200 Isolate* isolate = Isolate::Current(); | 202 Isolate* isolate = Isolate::Current(); |
| 201 DARTSCOPE(isolate); | 203 DARTSCOPE(isolate); |
| 204 ASSERT(isolate->debugger() != NULL); | |
| 202 isolate->debugger()->SetExceptionPauseInfo(pause_info); | 205 isolate->debugger()->SetExceptionPauseInfo(pause_info); |
| 203 return Api::Success(); | 206 return Api::Success(); |
| 204 } | 207 } |
| 205 | 208 |
| 206 | 209 |
| 207 DART_EXPORT Dart_ExceptionPauseInfo Dart_GetExceptionPauseInfo() { | 210 DART_EXPORT Dart_ExceptionPauseInfo Dart_GetExceptionPauseInfo() { |
| 208 Isolate* isolate = Isolate::Current(); | 211 Isolate* isolate = Isolate::Current(); |
| 209 DARTSCOPE(isolate); | 212 DARTSCOPE(isolate); |
| 213 ASSERT(isolate->debugger() != NULL); | |
| 210 return isolate->debugger()->GetExceptionPauseInfo(); | 214 return isolate->debugger()->GetExceptionPauseInfo(); |
| 211 } | 215 } |
| 212 | 216 |
| 213 | 217 |
| 214 DART_EXPORT Dart_Handle Dart_GetStackTrace(Dart_StackTrace* trace) { | 218 DART_EXPORT Dart_Handle Dart_GetStackTrace(Dart_StackTrace* trace) { |
| 215 Isolate* isolate = Isolate::Current(); | 219 Isolate* isolate = Isolate::Current(); |
| 216 DARTSCOPE(isolate); | 220 DARTSCOPE(isolate); |
| 217 CHECK_NOT_NULL(trace); | 221 CHECK_NOT_NULL(trace); |
| 222 ASSERT(isolate->debugger() != NULL); | |
| 218 *trace = reinterpret_cast<Dart_StackTrace>( | 223 *trace = reinterpret_cast<Dart_StackTrace>( |
| 219 isolate->debugger()->CurrentStackTrace()); | 224 isolate->debugger()->CurrentStackTrace()); |
| 220 return Api::Success(); | 225 return Api::Success(); |
| 221 } | 226 } |
| 222 | 227 |
| 223 | 228 |
| 224 DART_EXPORT Dart_Handle Dart_GetStackTraceFromError(Dart_Handle handle, | 229 DART_EXPORT Dart_Handle Dart_GetStackTraceFromError(Dart_Handle handle, |
| 225 Dart_StackTrace* trace) { | 230 Dart_StackTrace* trace) { |
| 226 Isolate* isolate = Isolate::Current(); | 231 Isolate* isolate = Isolate::Current(); |
| 227 DARTSCOPE(isolate); | 232 DARTSCOPE(isolate); |
| 228 CHECK_NOT_NULL(trace); | 233 CHECK_NOT_NULL(trace); |
| 234 ASSERT(isolate->debugger() != NULL); | |
| 229 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle)); | 235 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle)); |
| 230 if (obj.IsUnhandledException()) { | 236 if (obj.IsUnhandledException()) { |
| 231 const UnhandledException& error = UnhandledException::Cast(obj); | 237 const UnhandledException& error = UnhandledException::Cast(obj); |
| 232 Stacktrace& dart_stacktrace = Stacktrace::Handle(isolate); | 238 Stacktrace& dart_stacktrace = Stacktrace::Handle(isolate); |
| 233 dart_stacktrace ^= error.stacktrace(); | 239 dart_stacktrace ^= error.stacktrace(); |
| 234 if (dart_stacktrace.IsNull()) { | 240 if (dart_stacktrace.IsNull()) { |
| 235 *trace = NULL; | 241 *trace = NULL; |
| 236 } else { | 242 } else { |
| 237 *trace = reinterpret_cast<Dart_StackTrace>( | 243 *trace = reinterpret_cast<Dart_StackTrace>( |
| 238 isolate->debugger()->StackTraceFrom(dart_stacktrace)); | 244 isolate->debugger()->StackTraceFrom(dart_stacktrace)); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 CHECK_AND_CAST(ActivationFrame, frame, activation_frame); | 336 CHECK_AND_CAST(ActivationFrame, frame, activation_frame); |
| 331 return Api::NewHandle(isolate, frame->GetLocalVariables()); | 337 return Api::NewHandle(isolate, frame->GetLocalVariables()); |
| 332 } | 338 } |
| 333 | 339 |
| 334 | 340 |
| 335 DART_EXPORT Dart_Handle Dart_SetBreakpoint( | 341 DART_EXPORT Dart_Handle Dart_SetBreakpoint( |
| 336 Dart_Handle script_url_in, | 342 Dart_Handle script_url_in, |
| 337 intptr_t line_number) { | 343 intptr_t line_number) { |
| 338 Isolate* isolate = Isolate::Current(); | 344 Isolate* isolate = Isolate::Current(); |
| 339 DARTSCOPE(isolate); | 345 DARTSCOPE(isolate); |
| 346 ASSERT(isolate->debugger() != NULL); | |
| 340 UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in); | 347 UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in); |
| 341 | 348 |
| 342 Debugger* debugger = isolate->debugger(); | 349 Debugger* debugger = isolate->debugger(); |
| 343 ASSERT(debugger != NULL); | 350 ASSERT(debugger != NULL); |
| 344 Breakpoint* bpt = | 351 Breakpoint* bpt = |
| 345 debugger->SetBreakpointAtLine(script_url, line_number); | 352 debugger->SetBreakpointAtLine(script_url, line_number); |
| 346 if (bpt == NULL) { | 353 if (bpt == NULL) { |
| 347 return Api::NewError("%s: could not set breakpoint at line %" Pd " in '%s'", | 354 return Api::NewError("%s: could not set breakpoint at line %" Pd " in '%s'", |
| 348 CURRENT_FUNC, line_number, script_url.ToCString()); | 355 CURRENT_FUNC, line_number, script_url.ToCString()); |
| 349 } | 356 } |
| 350 return Dart_NewInteger(bpt->id()); | 357 return Dart_NewInteger(bpt->id()); |
| 351 } | 358 } |
| 352 | 359 |
| 353 | 360 |
| 354 DART_EXPORT Dart_Handle Dart_GetBreakpointURL(intptr_t bp_id) { | 361 DART_EXPORT Dart_Handle Dart_GetBreakpointURL(intptr_t bp_id) { |
| 355 Isolate* isolate = Isolate::Current(); | 362 Isolate* isolate = Isolate::Current(); |
| 356 DARTSCOPE(isolate); | 363 DARTSCOPE(isolate); |
| 364 ASSERT(isolate->debugger() != NULL); | |
| 357 Debugger* debugger = isolate->debugger(); | 365 Debugger* debugger = isolate->debugger(); |
| 358 ASSERT(debugger != NULL); | 366 ASSERT(debugger != NULL); |
|
Ivan Posva
2015/06/16 16:31:15
Where is the difference to this line?
ditto at ot
| |
| 359 | 367 |
| 360 Breakpoint* bpt = debugger->GetBreakpointById(bp_id); | 368 Breakpoint* bpt = debugger->GetBreakpointById(bp_id); |
| 361 if (bpt == NULL) { | 369 if (bpt == NULL) { |
| 362 return Api::NewError("%s: breakpoint with id %" Pd " does not exist", | 370 return Api::NewError("%s: breakpoint with id %" Pd " does not exist", |
| 363 CURRENT_FUNC, bp_id); | 371 CURRENT_FUNC, bp_id); |
| 364 } | 372 } |
| 365 return Api::NewHandle(isolate, bpt->bpt_location()->url()); | 373 return Api::NewHandle(isolate, bpt->bpt_location()->url()); |
| 366 } | 374 } |
| 367 | 375 |
| 368 | 376 |
| 369 DART_EXPORT Dart_Handle Dart_GetBreakpointLine(intptr_t bp_id) { | 377 DART_EXPORT Dart_Handle Dart_GetBreakpointLine(intptr_t bp_id) { |
| 370 Isolate* isolate = Isolate::Current(); | 378 Isolate* isolate = Isolate::Current(); |
| 371 DARTSCOPE(isolate); | 379 DARTSCOPE(isolate); |
| 380 ASSERT(isolate->debugger() != NULL); | |
| 372 Debugger* debugger = isolate->debugger(); | 381 Debugger* debugger = isolate->debugger(); |
| 373 ASSERT(debugger != NULL); | 382 ASSERT(debugger != NULL); |
| 374 | 383 |
| 375 Breakpoint* bpt = debugger->GetBreakpointById(bp_id); | 384 Breakpoint* bpt = debugger->GetBreakpointById(bp_id); |
| 376 if (bpt == NULL) { | 385 if (bpt == NULL) { |
| 377 return Api::NewError("%s: breakpoint with id %" Pd " does not exist", | 386 return Api::NewError("%s: breakpoint with id %" Pd " does not exist", |
| 378 CURRENT_FUNC, bp_id); | 387 CURRENT_FUNC, bp_id); |
| 379 } | 388 } |
| 380 return Dart_NewInteger(bpt->bpt_location()->LineNumber()); | 389 return Dart_NewInteger(bpt->bpt_location()->LineNumber()); |
| 381 } | 390 } |
| 382 | 391 |
| 383 | 392 |
| 384 DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry( | 393 DART_EXPORT Dart_Handle Dart_SetBreakpointAtEntry( |
| 385 Dart_Handle library_in, | 394 Dart_Handle library_in, |
| 386 Dart_Handle class_name_in, | 395 Dart_Handle class_name_in, |
| 387 Dart_Handle function_name_in) { | 396 Dart_Handle function_name_in) { |
| 388 Isolate* isolate = Isolate::Current(); | 397 Isolate* isolate = Isolate::Current(); |
| 389 DARTSCOPE(isolate); | 398 DARTSCOPE(isolate); |
| 399 ASSERT(isolate->debugger() != NULL); | |
| 390 UNWRAP_AND_CHECK_PARAM(Library, library, library_in); | 400 UNWRAP_AND_CHECK_PARAM(Library, library, library_in); |
| 391 UNWRAP_AND_CHECK_PARAM(String, class_name, class_name_in); | 401 UNWRAP_AND_CHECK_PARAM(String, class_name, class_name_in); |
| 392 UNWRAP_AND_CHECK_PARAM(String, function_name, function_name_in); | 402 UNWRAP_AND_CHECK_PARAM(String, function_name, function_name_in); |
| 393 | 403 |
| 394 // Ensure that the library is loaded. | 404 // Ensure that the library is loaded. |
| 395 if (!library.Loaded()) { | 405 if (!library.Loaded()) { |
| 396 return Api::NewError( | 406 return Api::NewError( |
| 397 "%s expects library argument 'library_in' to be loaded.", | 407 "%s expects library argument 'library_in' to be loaded.", |
| 398 CURRENT_FUNC); | 408 CURRENT_FUNC); |
| 399 } | 409 } |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 420 return Dart_NewInteger(bpt->id()); | 430 return Dart_NewInteger(bpt->id()); |
| 421 } | 431 } |
| 422 | 432 |
| 423 | 433 |
| 424 DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry( | 434 DART_EXPORT Dart_Handle Dart_OneTimeBreakAtEntry( |
| 425 Dart_Handle library_in, | 435 Dart_Handle library_in, |
| 426 Dart_Handle class_name_in, | 436 Dart_Handle class_name_in, |
| 427 Dart_Handle function_name_in) { | 437 Dart_Handle function_name_in) { |
| 428 Isolate* isolate = Isolate::Current(); | 438 Isolate* isolate = Isolate::Current(); |
| 429 DARTSCOPE(isolate); | 439 DARTSCOPE(isolate); |
| 440 ASSERT(isolate->debugger() != NULL); | |
| 430 UNWRAP_AND_CHECK_PARAM(Library, library, library_in); | 441 UNWRAP_AND_CHECK_PARAM(Library, library, library_in); |
| 431 UNWRAP_AND_CHECK_PARAM(String, class_name, class_name_in); | 442 UNWRAP_AND_CHECK_PARAM(String, class_name, class_name_in); |
| 432 UNWRAP_AND_CHECK_PARAM(String, function_name, function_name_in); | 443 UNWRAP_AND_CHECK_PARAM(String, function_name, function_name_in); |
| 433 | 444 |
| 434 // Ensure that the library is loaded. | 445 // Ensure that the library is loaded. |
| 435 if (!library.Loaded()) { | 446 if (!library.Loaded()) { |
| 436 return Api::NewError( | 447 return Api::NewError( |
| 437 "%s expects library argument 'library_in' to be loaded.", | 448 "%s expects library argument 'library_in' to be loaded.", |
| 438 CURRENT_FUNC); | 449 CURRENT_FUNC); |
| 439 } | 450 } |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 456 if (!error.IsNull()) { | 467 if (!error.IsNull()) { |
| 457 return Api::NewHandle(isolate, error.raw()); | 468 return Api::NewHandle(isolate, error.raw()); |
| 458 } | 469 } |
| 459 return Api::Success(); | 470 return Api::Success(); |
| 460 } | 471 } |
| 461 | 472 |
| 462 | 473 |
| 463 DART_EXPORT Dart_Handle Dart_RemoveBreakpoint(intptr_t bp_id) { | 474 DART_EXPORT Dart_Handle Dart_RemoveBreakpoint(intptr_t bp_id) { |
| 464 Isolate* isolate = Isolate::Current(); | 475 Isolate* isolate = Isolate::Current(); |
| 465 DARTSCOPE(isolate); | 476 DARTSCOPE(isolate); |
| 466 Debugger* debugger = isolate->debugger(); | 477 ASSERT(isolate->debugger() != NULL); |
| 467 ASSERT(debugger != NULL); | |
| 468 | |
| 469 isolate->debugger()->RemoveBreakpoint(bp_id); | 478 isolate->debugger()->RemoveBreakpoint(bp_id); |
| 470 return Api::Success(); | 479 return Api::Success(); |
| 471 } | 480 } |
| 472 | 481 |
| 473 | 482 |
| 474 DART_EXPORT Dart_Handle Dart_SetStepOver() { | 483 DART_EXPORT Dart_Handle Dart_SetStepOver() { |
| 475 Isolate* isolate = Isolate::Current(); | 484 Isolate* isolate = Isolate::Current(); |
| 476 DARTSCOPE(isolate); | 485 DARTSCOPE(isolate); |
| 486 ASSERT(isolate->debugger() != NULL); | |
| 477 isolate->debugger()->SetStepOver(); | 487 isolate->debugger()->SetStepOver(); |
| 478 return Api::Success(); | 488 return Api::Success(); |
| 479 } | 489 } |
| 480 | 490 |
| 481 | 491 |
| 482 DART_EXPORT Dart_Handle Dart_SetStepInto() { | 492 DART_EXPORT Dart_Handle Dart_SetStepInto() { |
| 483 Isolate* isolate = Isolate::Current(); | 493 Isolate* isolate = Isolate::Current(); |
| 484 DARTSCOPE(isolate); | 494 DARTSCOPE(isolate); |
| 495 ASSERT(isolate->debugger() != NULL); | |
| 485 isolate->debugger()->SetSingleStep(); | 496 isolate->debugger()->SetSingleStep(); |
| 486 return Api::Success(); | 497 return Api::Success(); |
| 487 } | 498 } |
| 488 | 499 |
| 489 | 500 |
| 490 DART_EXPORT Dart_Handle Dart_SetStepOut() { | 501 DART_EXPORT Dart_Handle Dart_SetStepOut() { |
| 491 Isolate* isolate = Isolate::Current(); | 502 Isolate* isolate = Isolate::Current(); |
| 492 DARTSCOPE(isolate); | 503 DARTSCOPE(isolate); |
| 504 ASSERT(isolate->debugger() != NULL); | |
| 493 isolate->debugger()->SetStepOut(); | 505 isolate->debugger()->SetStepOut(); |
| 494 return Api::Success(); | 506 return Api::Success(); |
| 495 } | 507 } |
| 496 | 508 |
| 497 | 509 |
| 498 DART_EXPORT Dart_Handle Dart_GetInstanceFields(Dart_Handle object_in) { | 510 DART_EXPORT Dart_Handle Dart_GetInstanceFields(Dart_Handle object_in) { |
| 499 Isolate* isolate = Isolate::Current(); | 511 Isolate* isolate = Isolate::Current(); |
| 500 DARTSCOPE(isolate); | 512 DARTSCOPE(isolate); |
| 513 ASSERT(isolate->debugger() != NULL); | |
| 501 UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in); | 514 UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in); |
| 502 return Api::NewHandle(isolate, isolate->debugger()->GetInstanceFields(obj)); | 515 return Api::NewHandle(isolate, isolate->debugger()->GetInstanceFields(obj)); |
| 503 } | 516 } |
| 504 | 517 |
| 505 | 518 |
| 506 DART_EXPORT Dart_Handle Dart_GetStaticFields(Dart_Handle target) { | 519 DART_EXPORT Dart_Handle Dart_GetStaticFields(Dart_Handle target) { |
| 507 Isolate* isolate = Isolate::Current(); | 520 Isolate* isolate = Isolate::Current(); |
| 508 DARTSCOPE(isolate); | 521 DARTSCOPE(isolate); |
| 522 ASSERT(isolate->debugger() != NULL); | |
| 509 const Type& type_obj = Api::UnwrapTypeHandle(isolate, target); | 523 const Type& type_obj = Api::UnwrapTypeHandle(isolate, target); |
| 510 if (type_obj.IsNull()) { | 524 if (type_obj.IsNull()) { |
| 511 return Api::NewError("%s expects argument 'target' to be a type", | 525 return Api::NewError("%s expects argument 'target' to be a type", |
| 512 CURRENT_FUNC); | 526 CURRENT_FUNC); |
| 513 } | 527 } |
| 514 const Class& cls = Class::Handle(isolate, type_obj.type_class()); | 528 const Class& cls = Class::Handle(isolate, type_obj.type_class()); |
| 515 return Api::NewHandle(isolate, isolate->debugger()->GetStaticFields(cls)); | 529 return Api::NewHandle(isolate, isolate->debugger()->GetStaticFields(cls)); |
| 516 } | 530 } |
| 517 | 531 |
| 518 | 532 |
| 519 DART_EXPORT Dart_Handle Dart_GetLibraryFields(intptr_t library_id) { | 533 DART_EXPORT Dart_Handle Dart_GetLibraryFields(intptr_t library_id) { |
| 520 Isolate* isolate = Isolate::Current(); | 534 Isolate* isolate = Isolate::Current(); |
| 521 DARTSCOPE(isolate); | 535 DARTSCOPE(isolate); |
| 536 ASSERT(isolate->debugger() != NULL); | |
| 522 const Library& lib = | 537 const Library& lib = |
| 523 Library::Handle(isolate, Library::GetLibrary(library_id)); | 538 Library::Handle(isolate, Library::GetLibrary(library_id)); |
| 524 if (lib.IsNull()) { | 539 if (lib.IsNull()) { |
| 525 return Api::NewError("%s: %" Pd " is not a valid library id", | 540 return Api::NewError("%s: %" Pd " is not a valid library id", |
| 526 CURRENT_FUNC, library_id); | 541 CURRENT_FUNC, library_id); |
| 527 } | 542 } |
| 528 return Api::NewHandle(isolate, isolate->debugger()->GetLibraryFields(lib)); | 543 return Api::NewHandle(isolate, isolate->debugger()->GetLibraryFields(lib)); |
| 529 } | 544 } |
| 530 | 545 |
| 531 | 546 |
| 532 DART_EXPORT Dart_Handle Dart_GetGlobalVariables(intptr_t library_id) { | 547 DART_EXPORT Dart_Handle Dart_GetGlobalVariables(intptr_t library_id) { |
| 533 Isolate* isolate = Isolate::Current(); | 548 Isolate* isolate = Isolate::Current(); |
| 534 ASSERT(isolate != NULL); | 549 ASSERT(isolate != NULL); |
| 535 DARTSCOPE(isolate); | 550 DARTSCOPE(isolate); |
| 551 ASSERT(isolate->debugger() != NULL); | |
| 536 const Library& lib = Library::Handle(Library::GetLibrary(library_id)); | 552 const Library& lib = Library::Handle(Library::GetLibrary(library_id)); |
| 537 if (lib.IsNull()) { | 553 if (lib.IsNull()) { |
| 538 return Api::NewError("%s: %" Pd " is not a valid library id", | 554 return Api::NewError("%s: %" Pd " is not a valid library id", |
| 539 CURRENT_FUNC, library_id); | 555 CURRENT_FUNC, library_id); |
| 540 } | 556 } |
| 541 return Api::NewHandle(isolate, isolate->debugger()->GetGlobalFields(lib)); | 557 return Api::NewHandle(isolate, isolate->debugger()->GetGlobalFields(lib)); |
| 542 } | 558 } |
| 543 | 559 |
| 544 | 560 |
| 545 DART_EXPORT Dart_Handle Dart_ActivationFrameEvaluate( | 561 DART_EXPORT Dart_Handle Dart_ActivationFrameEvaluate( |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 713 | 729 |
| 714 | 730 |
| 715 DART_EXPORT Dart_Handle Dart_GetClassInfo( | 731 DART_EXPORT Dart_Handle Dart_GetClassInfo( |
| 716 intptr_t cls_id, | 732 intptr_t cls_id, |
| 717 Dart_Handle* class_name, | 733 Dart_Handle* class_name, |
| 718 intptr_t* library_id, | 734 intptr_t* library_id, |
| 719 intptr_t* super_class_id, | 735 intptr_t* super_class_id, |
| 720 Dart_Handle* static_fields) { | 736 Dart_Handle* static_fields) { |
| 721 Isolate* isolate = Isolate::Current(); | 737 Isolate* isolate = Isolate::Current(); |
| 722 DARTSCOPE(isolate); | 738 DARTSCOPE(isolate); |
| 739 ASSERT(isolate->debugger() != NULL); | |
| 723 if (!isolate->class_table()->IsValidIndex(cls_id)) { | 740 if (!isolate->class_table()->IsValidIndex(cls_id)) { |
| 724 return Api::NewError("%s: %" Pd " is not a valid class id", | 741 return Api::NewError("%s: %" Pd " is not a valid class id", |
| 725 CURRENT_FUNC, cls_id); | 742 CURRENT_FUNC, cls_id); |
| 726 } | 743 } |
| 727 Class& cls = Class::Handle(isolate, isolate->class_table()->At(cls_id)); | 744 Class& cls = Class::Handle(isolate, isolate->class_table()->At(cls_id)); |
| 728 if (class_name != NULL) { | 745 if (class_name != NULL) { |
| 729 *class_name = Api::NewHandle(isolate, cls.Name()); | 746 *class_name = Api::NewHandle(isolate, cls.Name()); |
| 730 } | 747 } |
| 731 if (library_id != NULL) { | 748 if (library_id != NULL) { |
| 732 const Library& lib = Library::Handle(isolate, cls.library()); | 749 const Library& lib = Library::Handle(isolate, cls.library()); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 976 | 993 |
| 977 | 994 |
| 978 DART_EXPORT Dart_Isolate Dart_GetIsolate(Dart_IsolateId isolate_id) { | 995 DART_EXPORT Dart_Isolate Dart_GetIsolate(Dart_IsolateId isolate_id) { |
| 979 Isolate* isolate = PortMap::GetIsolate(isolate_id); | 996 Isolate* isolate = PortMap::GetIsolate(isolate_id); |
| 980 return Api::CastIsolate(isolate); | 997 return Api::CastIsolate(isolate); |
| 981 } | 998 } |
| 982 | 999 |
| 983 | 1000 |
| 984 DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) { | 1001 DART_EXPORT Dart_IsolateId Dart_GetIsolateId(Dart_Isolate dart_isolate) { |
| 985 Isolate* isolate = reinterpret_cast<Isolate*>(dart_isolate); | 1002 Isolate* isolate = reinterpret_cast<Isolate*>(dart_isolate); |
| 1003 ASSERT(isolate->debugger() != NULL); | |
| 986 return isolate->debugger()->GetIsolateId(); | 1004 return isolate->debugger()->GetIsolateId(); |
| 987 } | 1005 } |
| 988 | 1006 |
| 989 } // namespace dart | 1007 } // namespace dart |
| OLD | NEW |