OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 Handle<String> source = ReadFile(str); | 567 Handle<String> source = ReadFile(str); |
568 if (source.IsEmpty()) { | 568 if (source.IsEmpty()) { |
569 printf("Error reading '%s'\n", str); | 569 printf("Error reading '%s'\n", str); |
570 return 1; | 570 return 1; |
571 } | 571 } |
572 if (!ExecuteString(source, file_name, false, true)) | 572 if (!ExecuteString(source, file_name, false, true)) |
573 return 1; | 573 return 1; |
574 } | 574 } |
575 } | 575 } |
576 | 576 |
| 577 // Run the remote debugger if requested. |
| 578 if (i::FLAG_remote_debugger) { |
| 579 RunRemoteDebugger(i::FLAG_debugger_port); |
| 580 return 0; |
| 581 } |
| 582 |
577 // Start the debugger agent if requested. | 583 // Start the debugger agent if requested. |
578 if (i::FLAG_debugger_agent) { | 584 if (i::FLAG_debugger_agent) { |
579 v8::Debug::EnableAgent(i::FLAG_debugger_port); | 585 v8::Debug::EnableAgent(i::FLAG_debugger_port); |
580 } | 586 } |
581 | 587 |
582 // Start the in-process debugger if requested. | 588 // Start the in-process debugger if requested. |
583 if (i::FLAG_debugger && !i::FLAG_debugger_agent) | 589 if (i::FLAG_debugger && !i::FLAG_debugger_agent) { |
584 v8::Debug::SetDebugEventListener(HandleDebugEvent); | 590 v8::Debug::SetDebugEventListener(HandleDebugEvent); |
| 591 } |
585 } | 592 } |
586 | |
587 if (run_shell) | 593 if (run_shell) |
588 RunShell(); | 594 RunShell(); |
589 for (int i = 0; i < threads.length(); i++) { | 595 for (int i = 0; i < threads.length(); i++) { |
590 i::Thread *thread = threads[i]; | 596 i::Thread *thread = threads[i]; |
591 thread->Join(); | 597 thread->Join(); |
592 delete thread; | 598 delete thread; |
593 } | 599 } |
594 OnExit(); | 600 OnExit(); |
595 return 0; | 601 return 0; |
596 } | 602 } |
597 | 603 |
598 | 604 |
599 } // namespace v8 | 605 } // namespace v8 |
600 | 606 |
601 | 607 |
602 int main(int argc, char* argv[]) { | 608 int main(int argc, char* argv[]) { |
603 return v8::Shell::Main(argc, argv); | 609 return v8::Shell::Main(argc, argv); |
604 } | 610 } |
OLD | NEW |