| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_DEBUG_H_ | 5 #ifndef V8_DEBUG_H_ |
| 6 #define V8_DEBUG_H_ | 6 #define V8_DEBUG_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 357 |
| 358 // This class contains the debugger support. The main purpose is to handle | 358 // This class contains the debugger support. The main purpose is to handle |
| 359 // setting break points in the code. | 359 // setting break points in the code. |
| 360 // | 360 // |
| 361 // This class controls the debug info for all functions which currently have | 361 // This class controls the debug info for all functions which currently have |
| 362 // active breakpoints in them. This debug info is held in the heap root object | 362 // active breakpoints in them. This debug info is held in the heap root object |
| 363 // debug_info which is a FixedArray. Each entry in this list is of class | 363 // debug_info which is a FixedArray. Each entry in this list is of class |
| 364 // DebugInfo. | 364 // DebugInfo. |
| 365 class Debug { | 365 class Debug { |
| 366 public: | 366 public: |
| 367 enum AfterCompileFlags { |
| 368 NO_AFTER_COMPILE_FLAGS, |
| 369 SEND_WHEN_DEBUGGING |
| 370 }; |
| 371 |
| 367 // Debug event triggers. | 372 // Debug event triggers. |
| 368 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); | 373 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); |
| 369 void OnException(Handle<Object> exception, bool uncaught); | 374 void OnException(Handle<Object> exception, bool uncaught); |
| 370 void OnCompileError(Handle<Script> script); | |
| 371 void OnBeforeCompile(Handle<Script> script); | 375 void OnBeforeCompile(Handle<Script> script); |
| 372 void OnAfterCompile(Handle<Script> script); | 376 void OnAfterCompile(Handle<Script> script, |
| 377 AfterCompileFlags after_compile_flags); |
| 373 void OnScriptCollected(int id); | 378 void OnScriptCollected(int id); |
| 374 | 379 |
| 375 // API facing. | 380 // API facing. |
| 376 void SetEventListener(Handle<Object> callback, Handle<Object> data); | 381 void SetEventListener(Handle<Object> callback, Handle<Object> data); |
| 377 void SetMessageHandler(v8::Debug::MessageHandler handler); | 382 void SetMessageHandler(v8::Debug::MessageHandler handler); |
| 378 void EnqueueCommandMessage(Vector<const uint16_t> command, | 383 void EnqueueCommandMessage(Vector<const uint16_t> command, |
| 379 v8::Debug::ClientData* client_data = NULL); | 384 v8::Debug::ClientData* client_data = NULL); |
| 380 // Enqueue a debugger command to the command queue for event listeners. | 385 // Enqueue a debugger command to the command queue for event listeners. |
| 381 void EnqueueDebugCommand(v8::Debug::ClientData* client_data = NULL); | 386 void EnqueueDebugCommand(v8::Debug::ClientData* client_data = NULL); |
| 382 MUST_USE_RESULT MaybeHandle<Object> Call(Handle<JSFunction> fun, | 387 MUST_USE_RESULT MaybeHandle<Object> Call(Handle<JSFunction> fun, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 int argc, | 541 int argc, |
| 537 Handle<Object> argv[]); | 542 Handle<Object> argv[]); |
| 538 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); | 543 MUST_USE_RESULT MaybeHandle<Object> MakeExecutionState(); |
| 539 MUST_USE_RESULT MaybeHandle<Object> MakeBreakEvent( | 544 MUST_USE_RESULT MaybeHandle<Object> MakeBreakEvent( |
| 540 Handle<Object> break_points_hit); | 545 Handle<Object> break_points_hit); |
| 541 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( | 546 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( |
| 542 Handle<Object> exception, | 547 Handle<Object> exception, |
| 543 bool uncaught, | 548 bool uncaught, |
| 544 Handle<Object> promise); | 549 Handle<Object> promise); |
| 545 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( | 550 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( |
| 546 Handle<Script> script, v8::DebugEvent type); | 551 Handle<Script> script, bool before); |
| 547 MUST_USE_RESULT MaybeHandle<Object> MakeScriptCollectedEvent(int id); | 552 MUST_USE_RESULT MaybeHandle<Object> MakeScriptCollectedEvent(int id); |
| 548 | 553 |
| 549 // Mirror cache handling. | 554 // Mirror cache handling. |
| 550 void ClearMirrorCache(); | 555 void ClearMirrorCache(); |
| 551 | 556 |
| 552 // Returns a promise if it does not have a reject handler. | 557 // Returns a promise if it does not have a reject handler. |
| 553 Handle<Object> GetPromiseForUncaughtException(); | 558 Handle<Object> GetPromiseForUncaughtException(); |
| 554 | 559 |
| 555 void CallEventCallback(v8::DebugEvent event, | 560 void CallEventCallback(v8::DebugEvent event, |
| 556 Handle<Object> exec_state, | 561 Handle<Object> exec_state, |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 // several frames above. | 769 // several frames above. |
| 765 // There is no calling conventions here, because it never actually gets | 770 // There is no calling conventions here, because it never actually gets |
| 766 // called, it only gets returned to. | 771 // called, it only gets returned to. |
| 767 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); | 772 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); |
| 768 }; | 773 }; |
| 769 | 774 |
| 770 | 775 |
| 771 } } // namespace v8::internal | 776 } } // namespace v8::internal |
| 772 | 777 |
| 773 #endif // V8_DEBUG_H_ | 778 #endif // V8_DEBUG_H_ |
| OLD | NEW |