| 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 "vm/debugger.h" | 5 #include "vm/debugger.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 Breakpoint* bpt = sbpt->breakpoints(); | 473 Breakpoint* bpt = sbpt->breakpoints(); |
| 474 while (bpt != NULL) { | 474 while (bpt != NULL) { |
| 475 jsarr->AddValue(bpt); | 475 jsarr->AddValue(bpt); |
| 476 bpt = bpt->next(); | 476 bpt = bpt->next(); |
| 477 } | 477 } |
| 478 sbpt = sbpt->next_; | 478 sbpt = sbpt->next_; |
| 479 } | 479 } |
| 480 } | 480 } |
| 481 | 481 |
| 482 | 482 |
| 483 void Debugger::PrintSettingsToJSONObject(JSONObject* jsobj) const { |
| 484 // This won't cut it when we support filtering by class, etc. |
| 485 switch (GetExceptionPauseInfo()) { |
| 486 case kNoPauseOnExceptions: |
| 487 jsobj->AddProperty("_exceptions", "none"); |
| 488 break; |
| 489 case kPauseOnAllExceptions: |
| 490 jsobj->AddProperty("_exceptions", "all"); |
| 491 break; |
| 492 case kPauseOnUnhandledExceptions: |
| 493 jsobj->AddProperty("_exceptions", "unhandled"); |
| 494 break; |
| 495 default: |
| 496 UNREACHABLE(); |
| 497 } |
| 498 } |
| 499 |
| 500 |
| 483 RawString* ActivationFrame::QualifiedFunctionName() { | 501 RawString* ActivationFrame::QualifiedFunctionName() { |
| 484 return String::New(Debugger::QualifiedFunctionName(function())); | 502 return String::New(Debugger::QualifiedFunctionName(function())); |
| 485 } | 503 } |
| 486 | 504 |
| 487 | 505 |
| 488 RawString* ActivationFrame::SourceUrl() { | 506 RawString* ActivationFrame::SourceUrl() { |
| 489 const Script& script = Script::Handle(SourceScript()); | 507 const Script& script = Script::Handle(SourceScript()); |
| 490 return script.url(); | 508 return script.url(); |
| 491 } | 509 } |
| 492 | 510 |
| (...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1500 | 1518 |
| 1501 | 1519 |
| 1502 void Debugger::SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info) { | 1520 void Debugger::SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info) { |
| 1503 ASSERT((pause_info == kNoPauseOnExceptions) || | 1521 ASSERT((pause_info == kNoPauseOnExceptions) || |
| 1504 (pause_info == kPauseOnUnhandledExceptions) || | 1522 (pause_info == kPauseOnUnhandledExceptions) || |
| 1505 (pause_info == kPauseOnAllExceptions)); | 1523 (pause_info == kPauseOnAllExceptions)); |
| 1506 exc_pause_info_ = pause_info; | 1524 exc_pause_info_ = pause_info; |
| 1507 } | 1525 } |
| 1508 | 1526 |
| 1509 | 1527 |
| 1510 Dart_ExceptionPauseInfo Debugger::GetExceptionPauseInfo() { | 1528 Dart_ExceptionPauseInfo Debugger::GetExceptionPauseInfo() const { |
| 1511 return exc_pause_info_; | 1529 return exc_pause_info_; |
| 1512 } | 1530 } |
| 1513 | 1531 |
| 1514 | 1532 |
| 1515 bool Debugger::ShouldPauseOnException(DebuggerStackTrace* stack_trace, | 1533 bool Debugger::ShouldPauseOnException(DebuggerStackTrace* stack_trace, |
| 1516 const Instance& exc) { | 1534 const Instance& exc) { |
| 1517 if (exc_pause_info_ == kNoPauseOnExceptions) { | 1535 if (exc_pause_info_ == kNoPauseOnExceptions) { |
| 1518 return false; | 1536 return false; |
| 1519 } | 1537 } |
| 1520 if (exc_pause_info_ == kPauseOnAllExceptions) { | 1538 if (exc_pause_info_ == kPauseOnAllExceptions) { |
| (...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2952 } | 2970 } |
| 2953 | 2971 |
| 2954 | 2972 |
| 2955 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2973 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2956 ASSERT(bpt->next() == NULL); | 2974 ASSERT(bpt->next() == NULL); |
| 2957 bpt->set_next(code_breakpoints_); | 2975 bpt->set_next(code_breakpoints_); |
| 2958 code_breakpoints_ = bpt; | 2976 code_breakpoints_ = bpt; |
| 2959 } | 2977 } |
| 2960 | 2978 |
| 2961 } // namespace dart | 2979 } // namespace dart |
| OLD | NEW |