| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 static void OnBeforeCompile(Handle<Script> script); | 351 static void OnBeforeCompile(Handle<Script> script); |
| 352 static void OnAfterCompile(Handle<Script> script, | 352 static void OnAfterCompile(Handle<Script> script, |
| 353 Handle<JSFunction> fun); | 353 Handle<JSFunction> fun); |
| 354 static void OnNewFunction(Handle<JSFunction> fun); | 354 static void OnNewFunction(Handle<JSFunction> fun); |
| 355 static void ProcessDebugEvent(v8::DebugEvent event, | 355 static void ProcessDebugEvent(v8::DebugEvent event, |
| 356 Handle<Object> event_data); | 356 Handle<Object> event_data); |
| 357 static void SetMessageHandler(v8::DebugMessageHandler handler, void* data); | 357 static void SetMessageHandler(v8::DebugMessageHandler handler, void* data); |
| 358 static void SendMessage(Vector<uint16_t> message); | 358 static void SendMessage(Vector<uint16_t> message); |
| 359 static void ProcessCommand(Vector<const uint16_t> command); | 359 static void ProcessCommand(Vector<const uint16_t> command); |
| 360 static void UpdateActiveDebugger(); | 360 static void UpdateActiveDebugger(); |
| 361 static Handle<Object> Call(Handle<JSFunction> fun, |
| 362 Handle<Object> data, |
| 363 bool* pending_exception); |
| 364 |
| 361 inline static bool EventActive(v8::DebugEvent event) { | 365 inline static bool EventActive(v8::DebugEvent event) { |
| 362 // Currently argument event is not used. | 366 // Currently argument event is not used. |
| 363 return !Debugger::compiling_natives_ && Debugger::debugger_active_; | 367 return !Debugger::compiling_natives_ && Debugger::debugger_active_; |
| 364 } | 368 } |
| 365 | 369 |
| 366 static void set_debugger_active(bool debugger_active) { | 370 static void set_debugger_active(bool debugger_active) { |
| 367 Debugger::debugger_active_ = debugger_active; | 371 Debugger::debugger_active_ = debugger_active; |
| 368 } | 372 } |
| 369 static bool debugger_active() { return Debugger::debugger_active_; } | 373 static bool debugger_active() { return Debugger::debugger_active_; } |
| 370 static void set_compiling_natives(bool compiling_natives) { | 374 static void set_compiling_natives(bool compiling_natives) { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 ~EnterDebugger() { | 501 ~EnterDebugger() { |
| 498 if (set_) { | 502 if (set_) { |
| 499 // Restore to the previous break state. | 503 // Restore to the previous break state. |
| 500 Top::set_break(break_frame_id_, break_id_); | 504 Top::set_break(break_frame_id_, break_id_); |
| 501 } | 505 } |
| 502 } | 506 } |
| 503 | 507 |
| 504 // Check whether the debugger could be entered. | 508 // Check whether the debugger could be entered. |
| 505 inline bool FailedToEnter() { return load_failed_; } | 509 inline bool FailedToEnter() { return load_failed_; } |
| 506 | 510 |
| 511 // Check whether there are any JavaScript frames on the stack. |
| 512 inline bool HasJavaScriptFrames() { return set_; } |
| 513 |
| 507 private: | 514 private: |
| 508 JavaScriptFrameIterator it_; | 515 JavaScriptFrameIterator it_; |
| 509 const bool set_; // Was the break actually set? | 516 const bool set_; // Was the break actually set? |
| 510 StackFrame::Id break_frame_id_; // Previous break frame id. | 517 StackFrame::Id break_frame_id_; // Previous break frame id. |
| 511 int break_id_; // Previous break id. | 518 int break_id_; // Previous break id. |
| 512 bool load_failed_; // Did the debugger fail to load? | 519 bool load_failed_; // Did the debugger fail to load? |
| 513 SaveContext save_; // Saves previous context. | 520 SaveContext save_; // Saves previous context. |
| 514 }; | 521 }; |
| 515 | 522 |
| 516 | 523 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 } | 577 } |
| 571 private: | 578 private: |
| 572 Debug::AddressId id_; | 579 Debug::AddressId id_; |
| 573 int reg_; | 580 int reg_; |
| 574 }; | 581 }; |
| 575 | 582 |
| 576 | 583 |
| 577 } } // namespace v8::internal | 584 } } // namespace v8::internal |
| 578 | 585 |
| 579 #endif // V8_V8_DEBUG_H_ | 586 #endif // V8_V8_DEBUG_H_ |
| OLD | NEW |