Is the how to debug in Eclipse up to date?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
bossanova808 Online
Donor
Posts: 2,313
Joined: Sep 2009
Reputation: 36
Location: Melbourne, Australia
Post: #1
Hi Folks

I am just embarking on my XBMC plugin journey. I am trying to learn Eclipse, Python and XBMC Plugins at the same time. Good fun! I have some programming background (some PHP recently, and a good deal of Java, C, SQL back about 12 years ago...)...it doesn't look TOO crazy except for maybe digging up all the XBMC docs Smile

I have got the basics up and running and have a plugin going with some empty directory items. I am about to start pulling in some images (radar + overlay images) to combine them into a movie (or run as a slideshow, not sure yet what the best approach is).

Anyways I have Aptana Studio 3 (basically Eclipse) set up and everything seem to be in the right place. I followed this guide:
http://wiki.xbmc.org/index.php?title=HOW...on_install
...to set up remote debugging in Eclipse. This seems to be somewhat working, except:

It doesn't seem to pause by default, as indicated in that doc - the script just runs.

Stdout is going to the right place, the Aptana console, so I can print stuff as needed

...but, I am getting:

Code:
Traceback (most recent call last):
  File "C:\Program Files (x86)\XBMC\system\python\Lib\pysrc\pydevd.py", line 779, in trace_dispatch
    filename, base = GetFilenameAndBase(frame)
  File "C:\Program Files (x86)\XBMC\system\python\Lib\pysrc\pydevd_file_utils.py", line 225, in GetFilenameAndBase
    filename = xbmc.translatePath(filename)
UnboundLocalError: local variable 'filename' referenced before assignment
Traceback (most recent call last):
  File "C:\Program Files (x86)\XBMC\system\python\Lib\pysrc\pydevd.py", line 779, in trace_dispatch
    filename, base = GetFilenameAndBase(frame)
  File "C:\Program Files (x86)\XBMC\system\python\Lib\pysrc\pydevd_file_utils.py", line 225, in GetFilenameAndBase
    filename = xbmc.translatePath(filename)
UnboundLocalError: local variable 'filename' referenced before assignment
Traceback (most recent call last):
  File "C:\Program Files (x86)\XBMC\system\python\Lib\pysrc\pydevd.py", line 779, in trace_dispatch
    filename, base = GetFilenameAnd...

...I HAVE done the copy pysrc thing, and added the 4 lines of
Code:
filename = xbmc.translatePath(filename)

Is the doc up to date or have I screwed up somehow? Is it because I am using Aptana (which I chose at it was recommended on the PyDev page as an integrated option) - rather than straight Eclipse?

It doesn't seem to cause any functional issues but I'd prefer not to have it as I'm worried that (and the fact scripts aren't starting paused) means I have stuffed up...

Any help appreciated - I just need to get over the initial environment, set up and basic structure humps so I can start making something useful!

My XBMC stuff:
find quote
kruuth Offline
Senior Member
Posts: 230
Joined: May 2005
Reputation: 0
Post: #2
Maybe someone else can chime in here but I don't think it is....I'm getting unresolved imports on the XBMC stuff.
find quote
_Pierre_ Offline
Junior Member
Posts: 33
Joined: Nov 2009
Reputation: 0
Post: #3
eclipse debugging is working for me using that tutorial.
find quote
joshua.lyon Offline
Donor
Posts: 87
Joined: Dec 2009
Reputation: 1
Location: North Texas
Post: #4
kruuth Wrote:Maybe someone else can chime in here but I don't think it is....I'm getting unresolved imports on the XBMC stuff.
I've updated the wiki to indicate how to get around the unresolved imports messages (thanks to jfcarroll for the predefined completions plugin!).

http://wiki.xbmc.org/index.php?title=HOW...ptional.29
find quote
oyvfos Offline
Junior Member
Posts: 3
Joined: Aug 2012
Reputation: 0
Post: #5
I am stuck following the tutorial, but I believe it's my own ignorance that causes it. The sources files are imported into a new directory and XBMC still uses the original files.The changes I make have no effect. Am I missing something?

Oyvind
find quote
oyvfos Offline
Junior Member
Posts: 3
Joined: Aug 2012
Reputation: 0
Post: #6
I realized that the code for remote debugging should be added to the original Default.py file, not to the file in the eclipse project. Fixed that and it works fine now.
Thanks,

Oyvind
find quote
Bstrdsmkr Offline
Posting Freak
Posts: 803
Joined: Oct 2010
Reputation: 17
Post: #7
Not in any way helpful, but completely relevant: http://i.imgur.com/TS77f.jpg
find quote
jjacks Offline
Junior Member
Posts: 1
Joined: Oct 2014
Reputation: 0
Post: #8
I have issues importing pydevd into plugin script - pydevd tries to import lot of things - one of those things is third_party/pluginbase.py
pluginbase.py fails to import pydevd_constants which is in the parent folder.

Pydev version I use is 3.8 and the Python interpreter version used by XBMC (Frodo) is 2.6.6.

Pydev states that it is compatible with Python >= 2.1 but it seems like the way imports are being resolved has changed in 2.7 which may be an issue here.
Any thoughts?
find quote