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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
857 src_breakpoints_(NULL), | 857 src_breakpoints_(NULL), |
858 code_breakpoints_(NULL), | 858 code_breakpoints_(NULL), |
859 resume_action_(kContinue), | 859 resume_action_(kContinue), |
860 ignore_breakpoints_(false), | 860 ignore_breakpoints_(false), |
861 in_event_notification_(false), | 861 in_event_notification_(false), |
862 exc_pause_info_(kNoPauseOnExceptions) { | 862 exc_pause_info_(kNoPauseOnExceptions) { |
863 } | 863 } |
864 | 864 |
865 | 865 |
866 Debugger::~Debugger() { | 866 Debugger::~Debugger() { |
867 PortMap::ClosePort(isolate_id_); | |
868 isolate_id_ = ILLEGAL_ISOLATE_ID; | 867 isolate_id_ = ILLEGAL_ISOLATE_ID; |
869 ASSERT(!in_event_notification_); | 868 ASSERT(!in_event_notification_); |
870 ASSERT(src_breakpoints_ == NULL); | 869 ASSERT(src_breakpoints_ == NULL); |
871 ASSERT(code_breakpoints_ == NULL); | 870 ASSERT(code_breakpoints_ == NULL); |
872 ASSERT(stack_trace_ == NULL); | 871 ASSERT(stack_trace_ == NULL); |
873 ASSERT(obj_cache_ == NULL); | 872 ASSERT(obj_cache_ == NULL); |
874 } | 873 } |
875 | 874 |
876 | 875 |
877 void Debugger::Shutdown() { | 876 void Debugger::Shutdown() { |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1913 InstrumentForStepping(func_to_instrument); | 1912 InstrumentForStepping(func_to_instrument); |
1914 } | 1913 } |
1915 } | 1914 } |
1916 | 1915 |
1917 | 1916 |
1918 void Debugger::Initialize(Isolate* isolate) { | 1917 void Debugger::Initialize(Isolate* isolate) { |
1919 if (initialized_) { | 1918 if (initialized_) { |
1920 return; | 1919 return; |
1921 } | 1920 } |
1922 isolate_ = isolate; | 1921 isolate_ = isolate; |
1923 // Create a port here, we don't expect to receive any messages on this port. | 1922 // Use the isolate's control port as the isolate_id for debugging. |
1924 // This port will be used as a unique ID to represet the isolate in the | 1923 // This port will be used as a unique ID to represet the isolate in the |
1925 // debugger wire protocol messages. | 1924 // debugger wire protocol messages. |
1926 // NOTE: SetLive is never called on this port. | 1925 isolate_id_ = isolate->main_port(); |
1927 isolate_id_ = PortMap::CreatePort(isolate->message_handler()); | |
Ivan Posva
2013/10/27 14:33:17
Since the main port (aka control port) survives to
| |
1928 initialized_ = true; | 1926 initialized_ = true; |
1929 | 1927 |
1930 // Signal isolate creation event. | 1928 // Signal isolate creation event. |
1931 SignalIsolateEvent(Debugger::kIsolateCreated); | 1929 SignalIsolateEvent(Debugger::kIsolateCreated); |
1932 } | 1930 } |
1933 | 1931 |
1934 | 1932 |
1935 void Debugger::NotifyCompilation(const Function& func) { | 1933 void Debugger::NotifyCompilation(const Function& func) { |
1936 if (src_breakpoints_ == NULL) { | 1934 if (src_breakpoints_ == NULL) { |
1937 // Return with minimal overhead if there are no breakpoints. | 1935 // Return with minimal overhead if there are no breakpoints. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2104 } | 2102 } |
2105 | 2103 |
2106 | 2104 |
2107 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2105 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
2108 ASSERT(bpt->next() == NULL); | 2106 ASSERT(bpt->next() == NULL); |
2109 bpt->set_next(code_breakpoints_); | 2107 bpt->set_next(code_breakpoints_); |
2110 code_breakpoints_ = bpt; | 2108 code_breakpoints_ = bpt; |
2111 } | 2109 } |
2112 | 2110 |
2113 } // namespace dart | 2111 } // namespace dart |
OLD | NEW |