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 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 // Note: if this class has been parsed and finalized already, | 1949 // Note: if this class has been parsed and finalized already, |
1950 // we need to check the functions of this class even if | 1950 // we need to check the functions of this class even if |
1951 // it is defined in a differenct 'script'. There could | 1951 // it is defined in a differenct 'script'. There could |
1952 // be mixin functions from the given script in this class. | 1952 // be mixin functions from the given script in this class. |
1953 // However, if this class is not parsed yet (not finalized), | 1953 // However, if this class is not parsed yet (not finalized), |
1954 // we can ignore it and avoid the side effect of parsing it. | 1954 // we can ignore it and avoid the side effect of parsing it. |
1955 if ((cls.script() != script.raw()) && !cls.is_finalized()) { | 1955 if ((cls.script() != script.raw()) && !cls.is_finalized()) { |
1956 continue; | 1956 continue; |
1957 } | 1957 } |
1958 // Parse class definition if not done yet. | 1958 // Parse class definition if not done yet. |
1959 error = cls.EnsureIsFinalized(isolate_); | 1959 error = cls.EnsureIsFinalized(Thread::Current()); |
1960 if (!error.IsNull()) { | 1960 if (!error.IsNull()) { |
1961 // Ignore functions in this class. | 1961 // Ignore functions in this class. |
1962 // TODO(hausner): Should we propagate this error? How? | 1962 // TODO(hausner): Should we propagate this error? How? |
1963 // EnsureIsFinalized only returns an error object if there | 1963 // EnsureIsFinalized only returns an error object if there |
1964 // is no longjump base on the stack. | 1964 // is no longjump base on the stack. |
1965 continue; | 1965 continue; |
1966 } | 1966 } |
1967 functions = cls.functions(); | 1967 functions = cls.functions(); |
1968 if (!functions.IsNull()) { | 1968 if (!functions.IsNull()) { |
1969 const intptr_t num_functions = functions.Length(); | 1969 const intptr_t num_functions = functions.Length(); |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2769 | 2769 |
2770 void Debugger::Initialize(Isolate* isolate) { | 2770 void Debugger::Initialize(Isolate* isolate) { |
2771 if (initialized_) { | 2771 if (initialized_) { |
2772 return; | 2772 return; |
2773 } | 2773 } |
2774 isolate_ = isolate; | 2774 isolate_ = isolate; |
2775 | 2775 |
2776 // Use the isolate's control port as the isolate_id for debugging. | 2776 // Use the isolate's control port as the isolate_id for debugging. |
2777 // This port will be used as a unique ID to represent the isolate in the | 2777 // This port will be used as a unique ID to represent the isolate in the |
2778 // debugger wire protocol messages. | 2778 // debugger wire protocol messages. |
2779 isolate_id_ = isolate->main_port(); | 2779 isolate_id_ = isolate_->main_port(); |
2780 initialized_ = true; | 2780 initialized_ = true; |
2781 } | 2781 } |
2782 | 2782 |
2783 | 2783 |
2784 void Debugger::NotifyIsolateCreated() { | 2784 void Debugger::NotifyIsolateCreated() { |
2785 // Signal isolate creation event. | 2785 // Signal isolate creation event. |
2786 if (!ServiceIsolate::IsServiceIsolateDescendant(isolate_)) { | 2786 if (!ServiceIsolate::IsServiceIsolateDescendant(isolate_)) { |
2787 SignalIsolateEvent(DebuggerEvent::kIsolateCreated); | 2787 SignalIsolateEvent(DebuggerEvent::kIsolateCreated); |
2788 } | 2788 } |
2789 } | 2789 } |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3221 } | 3221 } |
3222 | 3222 |
3223 | 3223 |
3224 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 3224 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
3225 ASSERT(bpt->next() == NULL); | 3225 ASSERT(bpt->next() == NULL); |
3226 bpt->set_next(code_breakpoints_); | 3226 bpt->set_next(code_breakpoints_); |
3227 code_breakpoints_ = bpt; | 3227 code_breakpoints_ = bpt; |
3228 } | 3228 } |
3229 | 3229 |
3230 } // namespace dart | 3230 } // namespace dart |
OLD | NEW |