[PyKDE] eric3 - debugging & svn integration

Robin Bryce robin at wiretooth.com
Mon Jun 14 11:36:01 BST 2004


Hi Detlev,

> "Developers" is 99% just me.
good job ! and thanks for your help. here is some more info on the https
svn thing and a request for some advice re tinkering I've done with
DebugClientBase.


svn first.

for 5. checking out from a url of the form
https://xxx.xxxx.com:NNN/path/to/project

using the project->version control-> new from repository menu after
making the mods to svnURL I mentioned in prev mail failed to checkout.
the problem seemed to relate to handling of the case when the server
hosting the repository is accessed via ssl and the hosts ssl
certificates are self signed. this means they are not signed by a
trusted authority as far as the svn client layer is concerned so it
prompts the user to chose whether to accept the certificate temporarily,
permanently or not at all. I had recently resigned the certificate
because I had forgotten to set a sensible validity period hence the
resigned certificate was 'new' as far as my local cache of acceptable
'untrusted' certificates was concerned.

I just tried to reproduce this, without resigning the certificate, and
couldn't. so it seems that once its accepted via command line eric3 is
ok. but please understand that I haven't gone through the steps
thoroughly enough to be certain any or all of the above is 'fact'.

so in summary I have managed to create a project using the
project->version control-> new from repository menu and a url of the
form "https://xxx.xxxx.com:NNN/path/to/project" but it definitely failed
earlier. sorry this is such a weak explanation.

oh... I remember now. the first time I was running eric as sudo
/path/to/eric3. <smack/> doh~ not doing that anymore.


the other way I tried was the project -> new menu and ticking the VCS
integration. (ruining eric3 with my user, group) url was as above and
the project directory was in my home directory (I definitely had write
permissions). after a pause with nothing much happening a dialogue poped
up titled 'read project file' message was

"
The project
file /the/path/ispecified/projectname.e3pz
could not be read
" 

with a single button 'abort'

I'll probably stick to the command line svn client for now.

ok debugger stuff.


I took on board your comment re bdb.py, rolled up my sleeves and had a
look. cant be that hard, I thought at 9pm this morning. many fun filed
hours later, plus a headache ;-), I settled on the following changes. my
question is if I work with this setup what problems have I created for
myself ?

. overrode dispatch_call from bdb as a method in DebugBase.py. it is
identical to the original except the first thing it does is:

self._dbgClient.eventPoll()

. added the method eventPoll to DebugClientBase

first it does:

lasteventpolltime = getattr(self, 'lasteventpolltime', time.time())
now = time.time()
if now - lasteventpolltime < 0.5:
    self.lasteventpolltime = lasteventpolltime
    return
else:
    self.lasteventpolltime = now

then assuming enough time has elapsed it does a single pass over a copy
of the body of the while self.eventExit is None: loop in eventLoop but
sets the timeout parameter for the select call to 0.

this of course will not help with apps that run a non python main loop
and go for long periods without executing python. what happens for this
case with eric3 ?

having done all this I have the ability to 'inject' break points into my
running app after a continue with no break points in the subsequent code
path. this was the one feature I was really missing from wingide. I'm
now hoping I can debug the background thread of my application from the
ide but haven't tried this yet.

Best,

Robin


On Sun, 2004-06-13 at 09:31, Detlev Offenbach wrote:
> Hi,
> 
> thanks you very much for this lengthy report. I'll look into the topics 
> and will try to fix the problem areas. Some comments can be found below.
> 
> Detlev
> 
> Am Sonntag, 13. Juni 2004 04:45 schrieb Robin Bryce:
> > hi all,
> > Newbie eric3 user migrating from winglite. I like the eric3
> > environment a lot but I've had some problems with the debugger and svn
> > integration. also big apologies to all if this is inappropriate post.
> >
> > fedora core 2
> > Python 2.3.3
> > Qt 3.2.2-2
> > PyQt-3.12
> > QScintilla 1.3
> > BRM 0.9 cvs20040211
> > eric-3.4.2 installed from a source tar ball.
> >
> > so stuff I've had trouble with:
> >
> > 1. if I clear all break points, hit F6, I cant interrupt the program
> > by setting a new break point. I can imagine a number of work around
> > that would require hackery in my source. thats fine but if there is a
> > better way ...
> 
> That's the way the Python debugger (bdb.py) works.
> 
> >
> > 2. attempted to use passive debugging mode in conjunction with the
> > multi threaded client. using the following command line:
> >  python
> > /usr/lib/python2.3/site-packages/eric3/Debugger/DebugClientThreads.py
> > -w /home/myhome/mydevdir -- /usr/bin/twistd --originalname --pidfile
> > blackmiled.pid -nof blackmiled.tap
> >
> > this caused infinite loop in DebugClientBase.py in the argument
> > processing loop beginning at line 1106. changing all the del args[1]'s
> > to del args[0]'s fixed this.
> >
> > with that change the debugger connected to the ide but fell over in:
> > DebugClientBase.shouldSkip line 751
> >
> > attributeError: tracePython
> >
> > call stack was (verbatim trace at end of email)
> > DebugClientThreads.py 183 shouldSkip
> > DebugBase.py 386 stop_here
> > bdb.py 70 dispatch_call
> > bdb.py 50 trace_dispatch
> > twistd 23 "import sys, os, string"
> > string:1
> >
> > DebugClientBase 1079 startProgInDebugger
> > DebugClientBase 1132 main
> > DebugClientThreads 183
> >
> > I'm guessing line 293 in DebugClientBase.py has not been executed at
> > the point the exception is thrown but I'm out of my depth here.
> >
> > passive mode works fine using same command line but with
> > DebugClientNoQt instead of  DebugClientThreads
> >
> > 3. svn checkout forces '/trunk' onto the end of the repository path if
> > no tag is specified. what I really wanted was a 'just use _this_ path'
> > setting. changing line 177 in subversion.py to svnUrl = vcsDir had the
> > effect I was after.
> 
> The subversion integration is following the recommendations given by the 
> subversion book. However, it might be possible to add an option to 
> change this.
> 
> >
> > 4. urls of the form https://svn.domain.com:PORTNUM/repos/ were
> > problematic. ended up changing the body of svnURL in supbersion.py
> > line 1066 to:
> >
> > url = tuple(url.split(':', 2))
> > if len(url) == 3:
> >     scheme = url[0]
> >     host = url[1]
> >     port, path = url[2].split("/",1)
> >     return "%s:%s:%s/%s" % (scheme, host,port,urllib.quote(path))
> > else:
> >     return "%s:%s" % (url[0], urllib.quote(url[1]))
> >
> > 5. I really wanted an option to accept self signed ssl certificates. I
> > understand the issues with this but I want the choice. could anyone
> > point me in the right direction so I can either kluge this in localy
> > or implement 'as best I can' ? I gave up with this in the end and just
> > used ssh + localport forwarding.
> 
> Could you please give some detailed explanations?
> 
> >
> > 6. I very much want to have one eric project with subfolders that are
> > bound to different parts of a svn archive. ie:
> > svnpath/projectA
> > svnpath/otherprojects/projectB, projectC
> > svnpath/yetmoreprojects/projectD
> >
> > and have an eric project with vcs integration with a direcory tree
> > like this:
> > /home/build/masterproject/
> > 	projectA,
> > 	projectB
> > 	projectC
> > 	projectD
> >
> >
> > Any how, a big thank you to the developers of eric3. I think its
> > really very nice!
> 
> "Developers" is 99% just me.
> 
> >
> > Best Regards,
> >
> > Robin Bryce
> >
> >
> > ----------------------------------------------------------------------
> >--- full stack trace for attribute error thing with passive debugging
> >
> >   File
> > "/usr/lib/python2.3/site-packages/eric3/Debugger/DebugClientThreads.py
> >", line 183, in ?
> >     debugClient.main()
> >   File
> > "/usr/lib/python2.3/site-packages/eric3/Debugger/DebugClientBase.py",
> > line 1132, in main
> >     self.startProgInDebugger(args, wd, host, port)
> >   File
> > "/usr/lib/python2.3/site-packages/eric3/Debugger/DebugClientBase.py",
> > line 1079, in startProgInDebugger
> >     res = self.mainThread.run('execfile(' + `self.running` +
> > ')',self.debugMod.__dict__)
> >   File "/usr/lib/python2.3/bdb.py", line 350, in run
> >     exec cmd in globals, locals
> >   File "<string>", line 1, in ?
> >   File "/usr/bin/twistd", line 23, in ?
> >     import sys, os, string
> >   File "/usr/lib/python2.3/site-packages/Debugger/DebugThread.py",
> > line 111, in trace_dispatch
> >   File "/usr/lib/python2.3/bdb.py", line 50, in trace_dispatch
> >     return self.dispatch_call(frame, arg)
> >   File "/usr/lib/python2.3/bdb.py", line 70, in dispatch_call
> >     if not (self.stop_here(frame) or self.break_anywhere(frame)):
> >   File "/usr/lib/python2.3/site-packages/Debugger/DebugBase.py", line
> > 386, in stop_here
> >   File
> > "/usr/lib/python2.3/site-packages/eric3/Debugger/DebugClientBase.py",
> > line 751, in shouldSkip
> >     if self.mainThread.tracePython:     # trace into Python library
> > AttributeError: tracePython
> >
> >
> 
> Detlev




More information about the PyQt mailing list