| 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "include/dart_debugger_api.h" | 10 #include "include/dart_debugger_api.h" |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 // Start the debugger wire protocol handler if necessary. | 737 // Start the debugger wire protocol handler if necessary. |
| 738 if (start_debugger) { | 738 if (start_debugger) { |
| 739 ASSERT(debug_port >= 0); | 739 ASSERT(debug_port >= 0); |
| 740 bool print_msg = verbose_debug_seen || (debug_port == 0); | 740 bool print_msg = verbose_debug_seen || (debug_port == 0); |
| 741 debug_port = DebuggerConnectionHandler::StartHandler(debug_ip, debug_port); | 741 debug_port = DebuggerConnectionHandler::StartHandler(debug_ip, debug_port); |
| 742 if (print_msg) { | 742 if (print_msg) { |
| 743 Log::Print("Debugger listening on port %d\n", debug_port); | 743 Log::Print("Debugger listening on port %d\n", debug_port); |
| 744 } | 744 } |
| 745 } | 745 } |
| 746 | 746 |
| 747 // Start event handler. |
| 748 EventHandler::Start(); |
| 749 |
| 747 // Start the VM service isolate, if necessary. | 750 // Start the VM service isolate, if necessary. |
| 748 if (start_vm_service) { | 751 if (start_vm_service) { |
| 749 ASSERT(vm_service_server_port >= 0); | 752 ASSERT(vm_service_server_port >= 0); |
| 750 bool r = VmService::Start(vm_service_server_port); | 753 bool r = VmService::Start(vm_service_server_port); |
| 751 if (!r) { | 754 if (!r) { |
| 752 Log::PrintErr("Could not start VM Service isolate %s", | 755 Log::PrintErr("Could not start VM Service isolate %s", |
| 753 VmService::GetErrorMessage()); | 756 VmService::GetErrorMessage()); |
| 754 } | 757 } |
| 755 } | 758 } |
| 756 | 759 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 return DartErrorExit(result); | 856 return DartErrorExit(result); |
| 854 } | 857 } |
| 855 } | 858 } |
| 856 } | 859 } |
| 857 | 860 |
| 858 Dart_ExitScope(); | 861 Dart_ExitScope(); |
| 859 // Shutdown the isolate. | 862 // Shutdown the isolate. |
| 860 Dart_ShutdownIsolate(); | 863 Dart_ShutdownIsolate(); |
| 861 // Terminate process exit-code handler. | 864 // Terminate process exit-code handler. |
| 862 Process::TerminateExitCodeHandler(); | 865 Process::TerminateExitCodeHandler(); |
| 863 EventHandler::Stop(); | |
| 864 | 866 |
| 865 // Free copied argument strings if converted. | 867 // Free copied argument strings if converted. |
| 866 if (argv_converted) { | 868 if (argv_converted) { |
| 867 for (int i = 0; i < argc; i++) free(argv[i]); | 869 for (int i = 0; i < argc; i++) free(argv[i]); |
| 868 } | 870 } |
| 869 | 871 |
| 870 return Process::GlobalExitCode(); | 872 return Process::GlobalExitCode(); |
| 871 } | 873 } |
| 872 | 874 |
| 873 } // namespace bin | 875 } // namespace bin |
| 874 } // namespace dart | 876 } // namespace dart |
| 875 | 877 |
| 876 int main(int argc, char** argv) { | 878 int main(int argc, char** argv) { |
| 877 return dart::bin::main(argc, argv); | 879 return dart::bin::main(argc, argv); |
| 878 } | 880 } |
| OLD | NEW |