Eclipse Debug problem
#1
Hi,

I have tried many times follow the guide: http://wiki.xbmc.org/index.php?title=HOW...th_Eclipse
But I still haven't been able to debug my add-on scripts.

I already modified like this and also copy all of this source "pysrc" to:
"XBMC\system\python\Lib\pysrc\"

Quote:
Code:
def _NormFile(filename):
    filename = xbmc.translatePath(filename)
    try:
...
The other three procedures are:
def _NormFile(filename):
def NormFileToServer(filename):
def NormFileToClient(filename):
of course you need the import directive at the top of the file:
import xbmc

Then I put these code in the start of my add-on script "default.py"

Code:
REMOTE_DBG = True

# append pydev remote debugger
if REMOTE_DBG:
    # Make pydev debugger works for auto reload.
    # Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc
    try:
        import pysrc.pydevd as pydevd
    # stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console
        pydevd.settrace('localhost', stdoutToServer=True, stderrToServer=True)
    except ImportError:
        sys.stderr.write("Error: " +
            "You must add org.python.pydev.debug.pysrc to your PYTHONPATH.")
        sys.exit(1)

But when I started the debug server and run XBMC along with my script. Then, I got an error and cannot run my script, also the debug mode.

My whole "default.py" looks like this:

Code:
import os
import sys
from traceback import print_exc

REMOTE_DBG = True

# append pydev remote debugger
if REMOTE_DBG:
    # Make pydev debugger works for auto reload.
    # Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc
    try:
        import pysrc.pydevd as pydevd
    # stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console
        pydevd.settrace('localhost', stdoutToServer=True, stderrToServer=True)
    except ImportError:
        sys.stderr.write("Error: " +
            "You must add org.python.pydev.debug.pysrc to your PYTHONPATH.")
        sys.exit(1)

#Find path in the addon folder
RESOURCES_PATH = os.path.join( os.getcwd() , "resources" )
sys.path.append( os.path.join( RESOURCES_PATH, "lib" ) )

#import GUI library from lib
import GUI_Dialog
#Calling method to display GUI
GUI_Dialog.GUIDialog()

#clear modules
sys.modules.clear()

When I commented the "remote debug" codes, I can run my add-on script normally (there is no problem with my add-on script).

Is anyone have the same problem or solution for this? Please help Sad
I just cannot start debug mode for my script, don't know if I am missing something. I use python24 and "org.python.pydev.debug_2.4.0.2012020116"
Reply
#2
Any helps?
Reply
#3
I have the same issue at the same point.


The instructions refer to Python 1.5.5, is that really the version that is still used?
Quote:Identify where PyDev remote debugger Python files are

Python source files should be in you Eclipse installation directory:

C:\...\eclipse\plugins\org.python.pydev.debug_1.5.5.2010030420\pysrc\

In our case we use PyDev 1.5.5. Look for org.python.pydev.debug (not core)

My Eclipse directory has:
Quote:C:\eclipse\plugins\org.python.pydev_2.6.0.2012062818\pysrc

I am attempting with Eclipse 4.2 and Python 2.7, will that combination work?
Or do I need to install Python 2.6 to match the above?

This is what the xbmc.log has:
Quote:09:32:18 T:3988 NOTICE: -->Python Interpreter Initialized<--
09:32:18 T:3988 DEBUG: XBPyThread:Tonguerocess - The source file to load is C:\Documents and Settings\fishburn\Application Data\XBMC\addons\script.mythbox\default.py
09:32:18 T:3988 DEBUG: XBPyThread:Tonguerocess - Setting the Python path to C:\Documents and Settings\fishburn\Application Data\XBMC\addons\script.mythbox;C:\Documents and Settings\fishburn\Application Data\XBMC\addons\script.module.simplejson\lib;C:\Documents and Settings\fishburn\Application Data\XBMC\addons\script.module.beautifulsoup\lib;C:\Program Files\XBMC\addons\script.module.pil\lib;C:\Documents and Settings\fishburn\Application Data\XBMC\addons\script.common.plugin.cache\lib;C:\Documents and Settings\fishburn\Application Data\XBMC\addons\script.module.simple.downloader\lib;C:\Documents and Settings\fishburn\Application Data\XBMC\addons\script.module.parsedom\lib;C:\Program Files\XBMC\addons\script.module.pysqlite\lib;C:\Program Files\XBMC\system\python\DLLs;C:\Program Files\XBMC\system\python\Lib;C:\Program Files\XBMC\python26.zip;C:\Program Files\XBMC\system\python\lib\plat-win;C:\Program Files\XBMC\system\python\lib\lib-tk;C:\Program Files\XBMC;C:\Program Files\XBMC\system\python;C:\Program Files\XBMC\system\python\lib\site-packages;
09:32:18 T:3988 DEBUG: XBPyThread:Tonguerocess - Entering source directory C:\Documents and Settings\fishburn\Application Data\XBMC\addons\script.mythbox
09:32:18 T:3988 DEBUG: Instantiating addon using automatically obtained id of "script.mythbox" dependent on version 2.0 of the xbmc.python api
09:32:20 T:920 DEBUG: SDLKeyboard: scancode: 38, sym: 0134, unicode: 0000, modifier: 100
09:32:20 T:920 DEBUG: CApplication::OnKey: alt-leftalt (4f0d4) pressed, action is
09:32:20 T:920 DEBUG: D3DERR_DEVICELOST
09:32:21 T:920 DEBUG: CWinEventsWin32::WndProcWindow is inactive
09:32:22 T:2640 DEBUG: Thread Jobworker 2640 terminating (autodelete)
09:32:29 T:3988 ERROR: pydev debugger: warning: psyco not available for speedups (the debugger will still work correctly, but a bit slower)
09:32:30 T:3988 INFO: -->Python script returned the following error<--
09:32:30 T:3988 ERROR: Error Type: <class 'socket.error'>
09:32:30 T:3988 ERROR: Error Contents: [Errno 10061] No connection could be made because the target machine actively refused it
09:32:30 T:3988 ERROR: Traceback (most recent call last):
File "C:\Documents and Settings\fishburn\Application Data\XBMC\addons\script.mythbox\default.py", line 32, in <module>
pydevd.settrace('localhost', stdoutToServer=True, stderrToServer=True)
File "C:\Program Files\XBMC\system\python\Lib\pysrc\pydevd.py", line 1240, in settrace
_locked_settrace(host, stdoutToServer, stderrToServer, port, suspend, trace_only_current_thread)
File "C:\Program Files\XBMC\system\python\Lib\pysrc\pydevd.py", line 1265, in _locked_settrace
debugger.connect(host, port)
File "C:\Program Files\XBMC\system\python\Lib\pysrc\pydevd.py", line 294, in connect
s = StartClient(host, port)
File "C:\Program Files\XBMC\system\python\Lib\pysrc\pydevd_comm.py", line 362, in StartClient
s.connect((host, port))
File "<string>", line 1, in connect
error: [Errno 10061] No connection could be made because the target machine actively refused it
09:32:30 T:3988 INFO: -->End of Python script error report<--
09:32:30 T:920 DEBUG: ------ Window Init (DialogKaiToast.xml) ------
09:32:30 T:3988 INFO: Python script stopped
09:32:30 T:3988 DEBUG: Thread XBPyThread 3988 terminating
09:32:30 T:920 DEBUG: waiting for python thread 4 to stop
09:32:30 T:920 DEBUG: python thread 4 destructed
09:32:44 T:920 DEBUG: SECTION:UnloadDelayed(DLL: special://xbmcbin/system/ImageLib.dll)
09:32:44 T:920 INFO: XCURL:Big GrinllLibCurlGlobal::CheckIdle - Closing session to http://feeds.feedburner.com (easy=034F0048, multi=01728070)
09:33:10 T:920 DEBUG: CWinEventsWin32::WndProcWindow is inactive
09:37:21 T:3044 DEBUG: Previous line repeats 7 times.
09:37:21 T:3044 DEBUG: Thread CRemoteControl 3044 terminating
09:47:23 T:920 DEBUG: CWinEventsWin32::WndProcWindow is inactive
09:47:24 T:920 DEBUG: CWinEventsWin32::WndProc: window move event
09:47:24 T:920 DEBUG: CWinEventsWin32::WndProc: window resize event
09:47:24 T:920 DEBUG: CWinEventsWin32::WndProcWindow is active

It would be great to see some screen shots (or even a zipped up eclipse directory) of the project properties of a working Eclipse project for this.

Thanks for any input.
Dave
Reply
#4
Sorry to bump this, but I'm having similar issues trying to setup remote debugging, I'm surpised other people don't have this issue or is there a better way to debug addons for XBMC ?
Reply

Logout Mark Read Team Forum Stats Members Help
Eclipse Debug problem0