Home | History | Annotate | Download | only in src

Lines Matching defs:debug

37 #include "debug.h"
51 #include "../include/v8-debug.h"
59 Debug::Debug(Isolate* isolate)
73 Debug::~Debug() {
97 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext();
152 // There is always a possible break point at a debug break slot.
175 if (Debug::IsBreakStub(code)) {
181 if (Debug::IsSourceBreakStub(code)) {
299 // If there is not already a real break point here patch code with debug
315 // If there are no more break points here remove the debug break.
335 // Patch code with debug break.
352 // Patch code removing debug break.
433 // called. If the executing code has a debug break at the location change
435 // executed in place of the debug break call.
444 #ifdef DEBUG
459 // because caller of this function (Debug::PrepareStep) is expected to
462 // this function (Debug::PrepareStep) which should flood target function
483 // Check whether there is a debug break at the current position.
490 return Debug::IsDebugBreak(rinfo()->target_address());
505 // Patch the code to invoke the builtin debug break function matching the
507 Handle<Code> dbgbrk_code(Debug::FindDebugBreak(target_code, mode));
534 // Clear out all the debug break code. This is ONLY supposed to be used when
554 #ifdef DEBUG
564 void Debug::ThreadInit() {
583 char* Debug::ArchiveDebug(char* storage) {
594 char* Debug::RestoreDebug(char* storage) {
605 int Debug::ArchiveSpacePerThread() {
615 Object** Debug::SetUpFrameDropperFrame(StackFrame* bottom_js_frame,
633 const int Debug::kFrameDropperFrameSize = 4;
716 void Debug::SetUp(bool create_heap_objects) {
719 // Get code to handle debug break on return.
723 // Get code to handle debug break in debug break slots.
731 void Debug::HandleWeakDebugInfo(v8::Isolate* isolate,
734 Debug* debug = reinterpret_cast<Isolate*>(isolate)->debug();
739 // Debug::FindSharedFunctionInfoInScript.
742 debug->RemoveDebugInfo(node->debug_info());
743 #ifdef DEBUG
744 node = debug->debug_info_list_;
755 // Globalize the request debug info object and make it weak.
760 Debug::HandleWeakDebugInfo);
770 bool Debug::CompileDebuggerScript(Isolate* isolate, int index) {
840 bool Debug::Load() {
890 !CompileDebuggerScript(isolate_, Natives::GetIndex("debug"));
914 void Debug::Unload() {
931 void Debug::PreemptionWhileInDebugger() {
933 Debug::set_interrupts_pending(PREEMPT);
937 void Debug::Iterate(ObjectVisitor* v) {
943 Object* Debug::Break(Arguments args) {
969 // Get the debug info (create it if it does not exist).
1022 // Notify the debug event listeners.
1071 // Debug break slot stub does not return normally, instead it manually
1093 return isolate->debug()->Break(args);
1100 Handle<Object> Debug::CheckBreakPoints(Handle<Object> break_point_objects) {
1136 bool Debug::CheckBreakPoint(Handle<Object> break_point_object) {
1143 // Get the function IsBreakPointTriggered (defined in debug-debugger.js).
1153 Handle<Object> break_id = factory->NewNumberFromInt(Debug::break_id());
1175 // Check whether the function has debug information.
1176 bool Debug::HasDebugInfo(Handle<SharedFunctionInfo> shared) {
1181 // Return the debug info for this function. EnsureDebugInfo must be called
1182 // prior to ensure the debug info has been generated for shared.
1183 Handle<DebugInfo> Debug::GetDebugInfo(Handle<SharedFunctionInfo> shared) {
1189 void Debug::SetBreakPoint(Handle<JSFunction> function,
1196 // Make sure the function is compiled and has set up the debug info.
1199 // Return if retrieving debug info failed.
1219 bool Debug::SetBreakPointForScript(Handle<Script> script,
1231 // Make sure the function has set up the debug info.
1234 // Return if retrieving debug info failed.
1264 void Debug::ClearBreakPoint(Handle<Object> break_point_object) {
1282 // If there are no more break points left remove the debug info for this
1295 void Debug::ClearAllBreakPoints() {
1298 // Remove all debug break code.
1304 // Remove all debug info.
1311 void Debug::FloodWithOneShot(Handle<JSFunction> function) {
1314 // Make sure the function is compiled and has set up the debug info.
1317 // Return if we failed to retrieve the debug info.
1330 void Debug::FloodBoundFunctionWithOneShot(Handle<JSFunction> function) {
1338 Debug::FloodWithOneShot(bindee_function);
1343 void Debug::FloodHandlerWithOneShot() {
1361 void Debug::ChangeBreakOnException(ExceptionBreakType type, bool enable) {
1370 bool Debug::IsBreakOnException(ExceptionBreakType type) {
1379 void Debug::PrepareStep(StepAction step_action,
1386 ASSERT(Debug::InDebugger());
1398 // Get the frame where the execution has stopped and skip the debug frame if
1399 // any. The debug frame will only be present if execution was stopped due to
1401 // debug frame is not present.
1430 // Get the debug info (create it if it does not exist).
1434 // Return if ensuring debug info failed.
1565 Debug::FloodBoundFunctionWithOneShot(js_function);
1584 // propagated on the next Debug::Break.
1597 // Check whether the current debug break should be reported to the debugger. It
1603 bool Debug::StepNextContinue(BreakLocationIterator* break_location_iterator,
1631 // Check whether the code object at the specified address is a debug break code
1633 bool Debug::IsDebugBreak(Address addr) {
1641 bool Debug::IsSourceBreakStub(Code* code) {
1649 bool Debug::IsBreakStub(Code* code) {
1655 // Find the builtin to use for invoking the debug break
1656 Handle<Code> Debug::FindDebugBreak(Handle<Code> code, RelocInfo::Mode mode) {
1659 // Find the builtin debug break function matching the calling convention
1709 Handle<Object> Debug::GetSourceBreakLocations(
1750 void Debug::NewBreak(StackFrame::Id break_frame_id) {
1756 void Debug::SetBreak(StackFrame::Id break_frame_id, int break_id) {
1763 void Debug::HandleStepIn(Handle<JSFunction> function,
1785 Debug::FloodBoundFunctionWithOneShot(function);
1799 Debug::FloodWithOneShot(js_function);
1802 Debug::FloodBoundFunctionWithOneShot(js_function);
1806 Debug::FloodWithOneShot(function);
1813 void Debug::ClearStepping() {
1828 void Debug::ClearOneShot() {
1845 void Debug::ActivateStepIn(StackFrame* frame) {
1851 void Debug::ClearStepIn() {
1856 void Debug::ActivateStepOut(StackFrame* frame) {
1862 void Debug::ClearStepOut() {
1867 void Debug::ClearStepNext() {
1875 // have debug break slots and deoptimization information. Deoptimization
1880 // of mapping from already compiled full code without debug break slots
1881 // to full code with debug break slots depends on the generated code is
1897 #if DEBUG
1973 // generated for debug slots and constant pools.
1979 // Check if the pc in the new code with debug break
2021 // debug break slots.
2055 void Debug::PrepareForBreakPoints() {
2077 // debug break slots.
2098 // debug break slots and are not active or inlined into an active
2149 // Nothing to do. Function code already had debug break slots.
2160 // Make sure that the shared full code is compiled with debug
2163 // Try to compile the full code with debug break slots. If it
2194 Object* Debug::FindSharedFunctionInfoInScript(Handle<Script> script,
2302 // Ensures the debug information is present for shared.
2303 bool Debug::EnsureDebugInfo(Handle<SharedFunctionInfo> shared,
2307 // Return if we already have the debug info for shared.
2322 // Create the debug info object.
2325 // Add debug info to the list.
2334 void Debug::RemoveDebugInfo(Handle<DebugInfo> debug_info) {
2336 // Run through the debug info objects to find this one and remove it.
2351 // If there are no more debug info objects there are not more break
2365 void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) {
2370 // Get the executing function in which the debug break occurred.
2374 // Return if we failed to retrieve the debug info.
2380 #ifdef DEBUG
2387 // either a DebugBreakXXX or to the debug break return entry code if the
2391 // Check if the location is at JS exit or debug break slot.
2423 // Address of where the debug break slot starts.
2429 // We now know that there is still a debug break call at the target address,
2450 bool Debug::IsBreakAtReturn(JavaScriptFrame* frame) {
2462 // Get the executing function in which the debug break occurred.
2466 // Return if we failed to retrieve the debug info.
2471 #ifdef DEBUG
2493 void Debug::FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
2505 const int Debug::FramePaddingLayout::kInitialSize = 1;
2509 const int Debug::FramePaddingLayout::kPaddingValue = kInitialSize + 1;
2512 bool Debug::IsDebugGlobal(GlobalObject* global) {
2517 void Debug::ClearMirrorCache() {
2520 ASSERT(isolate_->context() == *Debug::debug_context());
2531 Handle<JSObject>(Debug::debug_context()->global_object()),
2536 void Debug::CreateScriptCache() {
2544 heap->CollectAllGarbage(Heap::kNoGCFlags, "Debug::CreateScriptCache");
2546 "Debug::CreateScriptCache");
2565 void Debug::DestroyScriptCache() {
2574 void Debug::AddScriptToScriptCache(Handle<Script> script) {
2581 Handle<FixedArray> Debug::GetLoadedScripts() {
2597 "Debug::GetLoadedScripts");
2604 void Debug::AfterGarbageCollection() {
2642 ASSERT(isolate_->context() == *isolate_->debug()->debug_context());
2657 Handle<JSObject>(isolate_->debug()->debug_context()->global_object()),
2668 isolate_->debug()->break_id());
2749 Debug* debug = isolate_->debug();
2752 if (debug->InDebugger()) return;
2758 if (!(debug->break_on_uncaught_exception() ||
2759 debug->break_on_exception())) return;
2762 if (!debug->break_on_exception()) return;
2770 debug->ClearStepping();
2784 // Process debug event.
2795 ASSERT(isolate_->context() == *isolate_->debug()->debug_context());
2801 ASSERT(isolate_->context() == *isolate_->debug
2816 // Process debug event.
2827 if (isolate_->debug()->InDebugger()) return;
2843 // Process debug event.
2854 Debug* debug = isolate_->debug();
2857 debug->AddScriptToScriptCache(script);
2866 bool in_debugger = debug->InDebugger();
2875 // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js).
2881 debug->debug_context()->global_object()->GetPropertyNoExceptionThrown(
2916 // Process debug event.
2927 if (isolate_->debug()->InDebugger()) return;
2944 // Process debug event.
2956 // Clear any pending debug break if this is a real break.
2958 isolate_->debug()->clear_interrupt_pending(DEBUGBREAK);
2974 // Notify registered debug event listener. This can be either a C or
2976 // here, if it's only a debug command -- they will be processed later.
2980 // Process pending debug commands.
2999 v8::Debug::ClientData* client_data) {
3011 v8::Debug::ClientData* client_data) {
3013 v8::Debug::EventCallback2 callback =
3014 FUNCTION_CAST<v8::Debug::EventCallback2>(
3032 // Invoke the JavaScript debug event listener.
3043 // Silently ignore exceptions from debug event listeners.
3050 return isolate_->debug()->debug_context();
3055 Debug* debug = isolate_->debug();
3058 debug->ClearAllBreakPoints();
3062 debug->Unload();
3077 if (!isolate_->debug()->Load()) return;
3103 // The debug command interrupt flag might have been set when the command was
3106 ASSERT(isolate_->debug()->InDebugger());
3109 // Notify the debugger that a debug event has occurred unless auto continue is
3178 // Invoke JavaScript to process the debug request.
3234 // Return from debug event processing if either the VM is put into the
3262 // If there is a new debug event listener register it together with its data
3278 void Debugger::SetMessageHandler(v8::Debug::MessageHandler2 handler) {
3286 if (isolate_->debug()->InDebugger()) {
3307 void Debugger::SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler,
3315 v8::Debug::DebugMessageDispatchHandler handler, bool provide_locker) {
3326 // Calls the registered debug message handler. This callback is part of the
3342 v8::Debug::ClientData* client_data) {
3352 // Set the debug command break flag to have the command processed.
3353 if (!isolate_->debug()->InDebugger()) {
3376 void Debugger::EnqueueDebugCommand(v8::Debug::ClientData* client_data) {
3380 // Set the debug command break flag to have the command processed.
3381 if (!isolate_->debug()->InDebugger()) {
3419 Handle<Object>(isolate_->debug()->debug_context_->global_proxy(),
3428 static void StubMessageHandler2(const v8::Debug::Message& message) {
3443 v8::Debug::DebugBreak();
3471 v8::Debug::DebugMessageDispatchHandler handler;
3484 prev_(isolate_->debug()->debugger_entry()),
3488 Debug* debug = isolate_->debug();
3489 ASSERT(prev_ != NULL || !debug->is_interrupt_pending(PREEMPT));
3490 ASSERT(prev_ != NULL || !debug->is_interrupt_pending(DEBUGBREAK));
3493 debug->set_debugger_entry(this);
3496 break_id_ = debug->break_id();
3497 break_frame_id_ = debug->break_frame_id();
3502 debug->NewBreak(it_.frame()->id());
3504 debug->NewBreak(StackFrame::NO_ID);
3508 load_failed_ = !debug->Load();
3512 isolate_->set_context(*debug->debug_context());
3518 Debug* debug = isolate_->debug();
3521 debug->SetBreak(break_frame_id_, break_id_);
3527 // JavaScript. This can happen if the v8::Debug::Call is used in which
3530 // Try to avoid any pending debug break breaking in the clear mirror
3533 debug->set_interrupts_pending(DEBUGBREAK);
3536 debug->ClearMirrorCache();
3539 // Request preemption and debug break when leaving the last debugger entry
3541 if (debug->is_interrupt_pending(PREEMPT)) {
3544 debug->clear_interrupt_pending(PREEMPT);
3547 if (debug->is_interrupt_pending(DEBUGBREAK)) {
3548 debug->clear_interrupt_pending(DEBUGBREAK);
3565 debug->set_debugger_entry(prev_);
3584 v8::Debug::ClientData* client_data) {
3597 v8::Debug::ClientData* client_data)
3647 // Call toJSONProtocol on the debug event object.
3675 v8::Debug::ClientData* MessageImpl::GetClientData() const {
3684 v8::Debug::ClientData* client_data)
3717 v8::Debug::ClientData* EventDetailsImpl::GetClientData() const {
3728 v8::Debug::ClientData* data)
3746 v8::Debug::ClientData* data) {