martomo / SublimeTextXdebug

Xdebug debugger client for Sublime Text
MIT License
564 stars 89 forks source link

intermittent blank screen after 'start debugging (launch browser)' #82

Open ckee opened 10 years ago

ckee commented 10 years ago

I'm running Sublime Text 2 Version 2.0.2, Build 2221 under Windows 7 64-bit, using wampserver 2.2e, which contains Apache 2.2.22 and php 5.4.3.

Xdebug Client works, mostly. The xdebug log shows successful xdebug connections, and setting features and what looks like built-in breakpoints, and I can use The Xdebug Client interface from within Sublime.

But from time to time, when I start the debugger, a blank screen displays. I can usually fix this by rebooting, but perhaps you have suggestions.

Thanks, and thanks for your work on Xdebug Client.

ckee commented 10 years ago

Here's the debug log from a typical attempted debug session that displays only a blank page: Log opened at 2014-06-01 22:15:56 I: Connecting to configured address/port: 127.0.0.1:9001. I: Connected to client. :-) -> <![CDATA[Xdebug]]><![CDATA[Derick Rethans]]><![CDATA[http://xdebug.org]]><![CDATA[Copyright (c) 2002-2012 by Derick Rethans]]>

<- feature_set -i 1 -v 1 -n show_hidden ->

<- feature_set -i 2 -v 32 -n max_children ->

<- feature_set -i 3 -v 1024 -n max_data ->

<- feature_set -i 4 -v 1 -n max_depth ->

<- breakpoint_set -i 5 -n 70 -t line -f file%3A//C%3A%5CUsers%5Cckee-cw.OMO1%5CProjects%5Cadid%5Csites%5Call%5Cmodules%5Cadid%5Cadid_prefix%5Cadid_prefix_form.inc ->

<- breakpoint_set -i 6 -x "Fatal error" -t exception ->

<- breakpoint_set -i 7 -x "Catchable fatal error" -t exception ->

<- breakpoint_set -i 8 -x "Warning" -t exception ->

<- breakpoint_set -i 9 -x "Parse error" -t exception ->

<- breakpoint_set -i 10 -x "Notice" -t exception ->

<- breakpoint_set -i 11 -x "Strict standards" -t exception ->

<- breakpoint_set -i 12 -x "Deprecated" -t exception ->

<- breakpoint_set -i 13 -x "Xdebug" -t exception ->

<- breakpoint_set -i 14 -x "Unknown error" -t exception ->

<- run -i 15 ->

Log closed at 2014-06-01 22:15:58

martomo commented 10 years ago

@ckee Can you please be more specific, what exactly do you mean with a 'blank screen', perhaps 'Xdebug Context' view?

ckee commented 10 years ago

By blank screen, I mean that the browser page for the debugged application is blank. Testing this morning, putting together answers to your questions I did not see that symptom, only timeouts. The debugging session worked for a time, and then connections began to time out:

Log opened at 2014-06-16 12:32:22 I: Checking remote connect back address. I: Remote address found, connecting to 127.0.0.1:9001. E: Time-out connecting to client. :-( Log closed at 2014-06-16 12:32:22

But to your other questions:

I'm debugging locally.

Version 2.0.2, Build 2221.

Default settings (unmodified, I think):
{
    // For remote debugging to resolve the file locations
    // it is required to configure the path mapping
    // with the server path as key and local path as value.
    //
    // Make sure to use absolute path when defining server path,
    // because Xdebug debugger engine does not return symbolic links.
    //
    // Example:
    // "/absolute/path/to/file/on/server" : "/path/to/file/on/computer",
    // "/var/www/htdocs/example/" : "C:/git/websites/example/"
    "path_mapping": {

    },

    // Determine which URL to launch in the default web browser
    // when starting/stopping a session.
    "url": "",

    // An IDE key is used to identify with debugger engine
    // when Sublime Text will start or stop a debugging session.
    //
    // This package does not filter sessions by IDE key,
    // it will accept any IDE key, also ones that do not match this configured IDE key.
    // It is merely used when launching the default web browser with the configured URL.
    "ide_key": "sublime.xdebug",

    // Which port number Sublime Text should listen
    // to connect with debugger engine.
    "port": 9000,

    // Show super globals in context view.
    "super_globals": true,

    // Maximum amount of array children
    // and object's properties to return.
    "max_children": 32,

    // Maximum amount of
    // variable data to initially retrieve.
    "max_data": 1024,

    // Maximum amount of nested levels to retrieve
    // of array elements and object properties.
    "max_depth": 1,

    // Break at first line on session start, when debugger engine has connected.
    "break_on_start": false,

    // Break on exceptions, suspend execution
    // when the exception name matches an entry in this list value.
    "break_on_exception": [
        // E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR
        "Fatal error",
        // E_RECOVERABLE_ERROR (since PHP 5.2.0)
        "Catchable fatal error",
        // E_WARNING, E_CORE_WARNING, E_COMPILE_WARNING, E_USER_WARNING
        "Warning",
        // E_PARSE
        "Parse error",
        // E_NOTICE, E_USER_NOTICE
        "Notice",
        // E_STRICT
        "Strict standards",
        // E_DEPRECATED, E_USER_DEPRECATED (since PHP 5.3.0)
        "Deprecated",
        // 0
        "Xdebug",
        // default
        "Unknown error"
    ],

    // Always close debug windows and restore layout on session stop.
    "close_on_stop": false,

    // Do not show possible password values in context output.
    "hide_password": false,

    // Show in output parsed response instead of raw XML.
    "pretty_output": false,

    // Always launch browser on session start/stop.
    // Note: This will only work if you have the 'url' setting configured.
    "launch_browser": false,

    // When launching browser on session stop do not execute script.
    // By using parameter XDEBUG_SESSION_STOP_NO_EXEC instead of XDEBUG_SESSION_STOP.
    "browser_no_execute": false,

    // Do not use the debugging window layout.
    "disable_layout": false,

    // Window layout that is being used when debugging.
    "debug_layout" : {
        "cols": [0.0, 0.5, 1.0],
        "rows": [0.0, 0.7, 1.0],
        "cells": [[0, 0, 2, 1], [0, 1, 1, 2], [1, 1, 2, 2]]
    },

    // Group and index positions for debug views.
    "breakpoint_group": 2,
    "breakpoint_index": 1,
    "context_group": 1,
    "context_index": 0,
    "stack_group": 2,
    "stack_index": 0,
    "watch_group": 1,
    "watch_index": 1,

    // Custom gutter icons for indicating current line or enabled/disabled breakpoints.
    //
    // Do not use same icon for following values, because Sublime Text is unable
    // to use the same icon for different scopes, in case there are duplicate icons
    // detected it will fall back to the corresponding icon in the package.
    "breakpoint_enabled": "circle",
    "breakpoint_disabled": "dot",
    "breakpoint_current": "",
    "current_line": "bookmark",

    // Path to Python installation on your system.
    // Which is being used to load missing modules.
    //
    // It is recommended to configure your Python path for Sublime Text 2
    // especially on older UNIX systems, where some modules (xml.parsers.expat)
    // might be missing and could improve performance of package.
    //
    // Example:
    // "python_path" : "/usr/lib/python2.7"
    "python_path" : "",

    // Show detailed log information about communication
    // between debugger engine and Sublime Text.
    // Log can be found at Packages/User/Xdebug.log
    "debug": false
}

User settings:

{
    "url": "http://ad-id.local",
    "port": 9001
}

xdebug config:

; XDEBUG Extension

;zend_extension = "c:/wamp/bin/php/php5.4.3/zend_ext/php_xdebug-2.2.0-5.4-vc9.dll"
zend_extension = "c:/wamp/bin/php/php5.4.3/ext/php_xdebug-2.2.5-5.4-vc9.dll"

[xdebug]
xdebug.remote_enable = 1
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9001
xdebug.remote_handler = "dbgp"
xdebug.remote_mode = req
xdebug.remote_connect_back = 1
xdebug.remote_log = "c:/wamp/logs/xdebug.log"
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"

I don't see anything suspicious on the console:

reloading /C/Users/ckee-cw.OMO1/AppData/Roaming/Sublime Text 2/Packages/User/Preferences.sublime-settings
found 1 files for base name Default.sublime-theme
theme loaded
martomo commented 10 years ago

@ckee Are you using perhaps Doctrine or any other libraries in your code?

Try increasing the value of the max nesting level in your xdebug.ini.

xdebug.max_nesting_level = 300

Can you provide more information how you are running the script, command line or browser. Which browser and what Xdebug browser extension are you using to initialize the session?

ckee commented 10 years ago

Not Doctrine, but this is a Drupal application, so there are libraries.

Increasing the nesting value may have helped. I'll be able to conduct a more extensive test tomorrow.

Re running the script, I'm running from a browser. I usually start the session from within Sublime with the xdebug client 'start debugging (Launch Browser)' command. I've used both Chrome with xdebug helper 1.4.2, and Firefox with no xdebug extension. Up to date versions of both browsers.