Lines Matching defs:debug
37 #include "debug.h"
51 #include "../include/v8-debug.h"
59 Debug::Debug(Isolate* isolate)
73 Debug::~Debug() {
96 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext();
151 // There is always a possible break point at a debug break slot.
175 if (Debug::IsBreakStub(code)) {
181 if (Debug::IsSourceBreakStub(code)) {
281 // If there is not already a real break point here patch code with debug
297 // If there are no more break points here remove the debug break.
317 // Patch code with debug break.
334 // Patch code removing debug break.
398 // called. If the executing code has a debug break at the location change
400 // executed in place of the debug break call.
409 #ifdef DEBUG
424 // because caller of this function (Debug::PrepareStep) is expected to
427 // this function (Debug::PrepareStep) which should flood target function
448 // Check whether there is a debug break at the current position.
455 return Debug::IsDebugBreak(rinfo()->target_address());
470 // Patch the code to invoke the builtin debug break function matching the
472 Handle<Code> dbgbrk_code(Debug::FindDebugBreak(target_code, mode));
499 // Clear out all the debug break code. This is ONLY supposed to be used when
519 #ifdef DEBUG
529 void Debug::ThreadInit() {
548 char* Debug::ArchiveDebug(char* storage) {
559 char* Debug::RestoreDebug(char* storage) {
569 int Debug::ArchiveSpacePerThread() {
579 Object** Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame,
597 const int Debug::kFrameDropperFrameSize = 4;
680 void Debug::SetUp(bool create_heap_objects) {
683 // Get code to handle debug break on return.
687 // Get code to handle debug break in debug break slots.
695 void Debug::HandleWeakDebugInfo(v8::Persistent<v8::Value> obj, void* data) {
696 Debug* debug = Isolate::Current()->debug();
704 debug->RemoveDebugInfo(node->debug_info());
705 #ifdef DEBUG
706 node = debug->debug_info_list_;
717 // Globalize the request debug info object and make it weak.
723 Debug::HandleWeakDebugInfo);
733 bool Debug::CompileDebuggerScript(int index) {
796 bool Debug::Load() {
843 !CompileDebuggerScript(Natives::GetIndex("debug"));
866 void Debug::Unload() {
883 void Debug::PreemptionWhileInDebugger() {
885 Debug::set_interrupts_pending(PREEMPT);
889 void Debug::Iterate(ObjectVisitor* v) {
895 Object* Debug::Break(Arguments args) {
921 // Get the debug info (create it if it does not exist).
972 // Notify the debug event listeners.
1023 // Debug break slot stub does not return normally, instead it manually
1045 return isolate->debug()->Break(args);
1052 Handle<Object> Debug::CheckBreakPoints(Handle<Object> break_point_objects) {
1088 bool Debug::CheckBreakPoint(Handle<Object> break_point_object) {
1095 // Get the function IsBreakPointTriggered (defined in debug-debugger.js).
1104 Handle<Object> break_id = factory->NewNumberFromInt(Debug::break_id());
1126 // Check whether the function has debug information.
1127 bool Debug::HasDebugInfo(Handle<SharedFunctionInfo> shared) {
1132 // Return the debug info for this function. EnsureDebugInfo must be called
1133 // prior to ensure the debug info has been generated for shared.
1134 Handle<DebugInfo> Debug::GetDebugInfo(Handle<SharedFunctionInfo> shared) {
1140 void Debug::SetBreakPoint(Handle<SharedFunctionInfo> shared,
1148 // Return if retrieving debug info failed.
1168 void Debug::ClearBreakPoint(Handle<Object> break_point_object) {
1190 // If there are no more break points left remove the debug info for this
1203 void Debug::ClearAllBreakPoints() {
1206 // Remove all debug break code.
1212 // Remove all debug info.
1219 void Debug::FloodWithOneShot(Handle<SharedFunctionInfo> shared) {
1221 // Make sure the function has set up the debug info.
1223 // Return if we failed to retrieve the debug info.
1236 void Debug::FloodBoundFunctionWithOneShot(Handle<JSFunction> function) {
1243 Debug::FloodWithOneShot(shared_info);
1248 void Debug::FloodHandlerWithOneShot() {
1269 void Debug::ChangeBreakOnException(ExceptionBreakType type, bool enable) {
1278 bool Debug::IsBreakOnException(ExceptionBreakType type) {
1287 void Debug::PrepareStep(StepAction step_action, int step_count) {
1292 ASSERT(Debug::InDebugger());
1304 // Get the frame where the execution has stopped and skip the debug frame if
1305 // any. The debug frame will only be present if execution was stopped due to
1307 // debug frame is not present.
1333 // Get the debug info (create it if it does not exist).
1337 // Return if ensuring debug info failed.
1468 Debug::FloodBoundFunctionWithOneShot(js_function);
1487 // propagated on the next Debug::Break.
1500 // Check whether the current debug break should be reported to the debugger. It
1506 bool Debug::StepNextContinue(BreakLocationIterator* break_location_iterator,
1534 // Check whether the code object at the specified address is a debug break code
1536 bool Debug::IsDebugBreak(Address addr) {
1544 bool Debug::IsSourceBreakStub(Code* code) {
1552 bool Debug::IsBreakStub(Code* code) {
1558 // Find the builtin to use for invoking the debug break
1559 Handle<Code> Debug::FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode) {
1562 // Find the builtin debug break function matching the calling convention
1609 Handle<Object> Debug::GetSourceBreakLocations(
1634 void Debug::NewBreak(StackFrame::Id break_frame_id) {
1640 void Debug::SetBreak(StackFrame::Id break_frame_id, int break_id) {
1647 void Debug::HandleStepIn(Handle<JSFunction> function,
1668 Debug::FloodBoundFunctionWithOneShot(function);
1683 Debug::FloodWithOneShot(shared_info);
1686 Debug::FloodWithOneShot(Handle<SharedFunctionInfo>(function->shared()));
1693 void Debug::ClearStepping() {
1707 void Debug::ClearOneShot() {
1724 void Debug::ActivateStepIn(StackFrame* frame) {
1730 void Debug::ClearStepIn() {
1735 void Debug::ActivateStepOut(StackFrame* frame) {
1741 void Debug::ClearStepOut() {
1746 void Debug::ClearStepNext() {
1754 // have debug break slots and deoptimization
1760 // already compiled full code without debug break slots to full code
1761 // with debug break slots depends on the generated code is otherwise
1777 #if DEBUG
1843 // Check if the pc in the new code with debug break
1856 // Passed a debug break slot in the full code with debug
1890 // debug break slots.
1925 void Debug::PrepareForBreakPoints() {
1940 // debug break slots.
1960 // debug break slots and are not active or inlined into an active
1993 // Nothing to do. Function code already had debug break slots.
2005 // Make sure that the shared full code is compiled with debug
2008 // Try to compile the full code with debug break slots. If it
2040 // Ensures the debug information is present for shared.
2041 bool Debug::EnsureDebugInfo(Handle<SharedFunctionInfo> shared) {
2042 // Return if we already have the debug info for shared.
2053 // Create the debug info object.
2056 // Add debug info to the list.
2068 void Debug::RemoveDebugInfo(Handle<DebugInfo> debug_info) {
2070 // Run through the debug info objects to find this one and remove it.
2085 // If there are no more debug info objects there are not more break
2099 void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) {
2104 // Get the executing function in which the debug break occurred.
2108 // Return if we failed to retrieve the debug info.
2114 #ifdef DEBUG
2121 // either a DebugBreakXXX or to the debug break return entry code if the
2125 // Check if the location is at JS exit or debug break slot.
2157 // Address of where the debug break slot starts.
2163 // We now know that there is still a debug break call at the target address,
2184 bool Debug::IsBreakAtReturn(JavaScriptFrame* frame) {
2196 // Get the executing function in which the debug break occurred.
2200 // Return if we failed to retrieve the debug info.
2205 #ifdef DEBUG
2227 void Debug::FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
2237 bool Debug::IsDebugGlobal(GlobalObject* global) {
2242 void Debug::ClearMirrorCache() {
2245 ASSERT(isolate_->context() == *Debug::debug_context());
2255 Handle<JSObject>(Debug::debug_context()->global()),
2260 void Debug::CreateScriptCache() {
2268 heap->CollectAllGarbage(Heap::kNoGCFlags, "Debug::CreateScriptCache");
2270 "Debug::CreateScriptCache");
2289 void Debug::DestroyScriptCache() {
2298 void Debug::AddScriptToScriptCache(Handle<Script> script) {
2305 Handle<FixedArray> Debug::GetLoadedScripts() {
2321 "Debug::GetLoadedScripts");
2328 void Debug::AfterGarbageCollection() {
2371 ASSERT(isolate_->context() == *isolate_->debug()->debug_context());
2385 Handle<JSObject>(isolate_->debug()->debug_context()->global()),
2396 isolate_->debug
2477 Debug* debug = isolate_->debug();
2480 if (debug->InDebugger()) return;
2486 if (!(debug->break_on_uncaught_exception() ||
2487 debug->break_on_exception())) return;
2490 if (!debug->break_on_exception()) return;
2498 debug->ClearStepping();
2512 // Process debug event.
2523 ASSERT(isolate_->context() == *isolate_->debug()->debug_context());
2529 ASSERT(isolate_->context() == *isolate_->debug()->debug_context());
2544 // Process debug event.
2555 if (isolate_->debug()->InDebugger()) return;
2571 // Process debug event.
2582 Debug* debug = isolate_->debug();
2585 debug->AddScriptToScriptCache(script);
2594 bool in_debugger = debug->InDebugger();
2603 // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js).
2607 Handle<Object>(debug->debug_context()->global()->
2641 // Process debug event.
2668 // Process debug event.
2680 // Clear any pending debug break if this is a real break.
2682 isolate_->debug()->clear_interrupt_pending(DEBUGBREAK);
2698 // Notify registered debug event listener. This can be either a C or
2700 // here, if it's only a debug command -- they will be processed later.
2704 // Process pending debug commands.
2723 v8::Debug::ClientData* client_data) {
2735 v8::Debug::ClientData* client_data) {
2737 v8::Debug::EventCallback2 callback =
2738 FUNCTION_CAST<v8::Debug::EventCallback2>(
2756 // Invoke the JavaScript debug event listener.
2767 // Silently ignore exceptions from debug event listeners.
2774 return isolate_->debug()->debug_context();
2779 Debug* debug = isolate_->debug();
2782 debug->ClearAllBreakPoints();
2786 debug->Unload();
2800 if (!isolate_->debug()->Load()) return;
2826 // The debug command interrupt flag might have been set when the command was
2829 ASSERT(isolate_->debug()->InDebugger());
2832 // Notify the debugger that a debug event has occurred unless auto continue is
2901 // Invoke JavaScript to process the debug request.
2956 // Return from debug event processing if either the VM is put into the
2984 // If there is a new debug event listener register it together with its data
3000 void Debugger::SetMessageHandler(v8::Debug::MessageHandler2 handler) {
3008 if (isolate_->debug()->InDebugger()) {
3029 void Debugger::SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler,
3037 v8::Debug::DebugMessageDispatchHandler handler, bool provide_locker) {
3048 // Calls the registered debug message handler. This callback is part of the
3064 v8::Debug::ClientData* client_data) {
3074 // Set the debug command break flag to have the command processed.
3075 if (!isolate_->debug()->InDebugger()) {
3098 void Debugger::EnqueueDebugCommand(v8::Debug::ClientData* client_data) {
3102 // Set the debug command break flag to have the command processed.
3103 if (!isolate_->debug()->InDebugger()) {
3140 Handle<Object>(isolate_->debug()->debug_context_->global_proxy()),
3148 static void StubMessageHandler2(const v8::Debug::Message& message) {
3164 v8::Debug::DebugBreak();
3198 v8::Debug::DebugMessageDispatchHandler handler;
3211 prev_(isolate_->debug()->debugger_entry()),
3215 Debug* debug = isolate_->debug();
3216 ASSERT(prev_ != NULL || !debug->is_interrupt_pending(PREEMPT));
3217 ASSERT(prev_ != NULL || !debug->is_interrupt_pending(DEBUGBREAK));
3220 debug->set_debugger_entry(this);
3223 break_id_ = debug->break_id();
3224 break_frame_id_ = debug->break_frame_id();
3229 debug->NewBreak(it_.frame()->id());
3231 debug->NewBreak(StackFrame::NO_ID);
3235 load_failed_ = !debug->Load();
3239 isolate_->set_context(*debug->debug_context());
3246 Debug* debug = isolate_->debug();
3249 debug->SetBreak(break_frame_id_, break_id_);
3255 // JavaScript. This can happen if the v8::Debug::Call is used in which
3258 // Try to avoid any pending debug break breaking in the clear mirror
3261 debug->set_interrupts_pending(DEBUGBREAK);
3264 debug->ClearMirrorCache();
3267 // Request preemption and debug break when leaving the last debugger entry
3269 if (debug->is_interrupt_pending(PREEMPT)) {
3272 debug->clear_interrupt_pending(PREEMPT);
3275 if (debug->is_interrupt_pending(DEBUGBREAK)) {
3276 debug->clear_interrupt_pending(DEBUGBREAK);
3293 debug->set_debugger_entry(prev_);
3312 v8::Debug::ClientData* client_data) {
3325 v8::Debug::ClientData* client_data)
3369 // Call toJSONProtocol on the debug event object.
3397 v8::Debug::ClientData* MessageImpl::GetClientData() const {
3406 v8::Debug::ClientData* client_data)
3439 v8::Debug::ClientData* EventDetailsImpl::GetClientData() const {
3450 v8::Debug::ClientData* data)
3468 v8::Debug::ClientData* data) {