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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 Handle<String> file_name = v8::String::New(str); | 566 Handle<String> file_name = v8::String::New(str); |
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 if (i::FLAG_debugger) | 576 |
| 577 // Start the debugger agent if requested. |
| 578 if (i::FLAG_debugger_agent) { |
| 579 v8::Debug::EnableAgent(i::FLAG_debugger_port); |
| 580 } |
| 581 |
| 582 // Start the in-process debugger if requested. |
| 583 if (i::FLAG_debugger && !i::FLAG_debugger_agent) |
577 v8::Debug::SetDebugEventListener(HandleDebugEvent); | 584 v8::Debug::SetDebugEventListener(HandleDebugEvent); |
578 } | 585 } |
| 586 |
579 if (run_shell) | 587 if (run_shell) |
580 RunShell(); | 588 RunShell(); |
581 for (int i = 0; i < threads.length(); i++) { | 589 for (int i = 0; i < threads.length(); i++) { |
582 i::Thread *thread = threads[i]; | 590 i::Thread *thread = threads[i]; |
583 thread->Join(); | 591 thread->Join(); |
584 delete thread; | 592 delete thread; |
585 } | 593 } |
586 OnExit(); | 594 OnExit(); |
587 return 0; | 595 return 0; |
588 } | 596 } |
589 | 597 |
590 | 598 |
591 } // namespace v8 | 599 } // namespace v8 |
592 | 600 |
593 | 601 |
594 int main(int argc, char* argv[]) { | 602 int main(int argc, char* argv[]) { |
595 return v8::Shell::Main(argc, argv); | 603 return v8::Shell::Main(argc, argv); |
596 } | 604 } |
OLD | NEW |