1 Nov 01:01
Re: interaction between ipython and gvim for debuging
TheLonelyStar <nabble2 <at> lonely-star.org>
2009-11-01 00:01:11 GMT
2009-11-01 00:01:11 GMT
Gökhan SEVER-2 wrote: > > On Fri, Oct 30, 2009 at 3:53 AM, TheLonelyStar > <nabble2 <at> lonely-star.org>wrote: > >> >> Hi, >> >> I am searching for a solution to debug python programs using gvim and >> ipython, and found nothing good so far. >> >> What would be cool: >> - open current file and line in gvim from ipython whenever an error >> occurs >> - setting breakpoints from gvim >> >> So can this be done: >> - If I have a ipython debug session started, can I somehow invoke a >> command >> from the outside (from gvim in this case) which enables and disables >> breakpoints in a certain file a t a certain position? >> - Can ipython be configured, that it opens the current file if a error >> occurs with the correct line? >> > > Have you seen this thread? > > http://advice.mechanicalkern.com/question/3/how-can-i-integrate-vim-with-ipython >(Continue reading)
When would you ever want to print breakpoints to a file? If you're using pdb
programmatically to set breakpoints, you will already have access to a pdb
instance (created with p = pdb.Pdb()). Then p.breaks is a dict of the current
breakpoints. Otherwise, you're using the interactive debugger and can just copy
output from the command window. Or am I missing something here?
> I also discovered:
> pdb.Pdb.get_all_breaks()
Yes:
In [39]: pdb.Pdb.get_all_breaks??
[...]
Source:
def get_all_breaks(self):
return self.breaks
> But it just gives me:
> *** TypeError: unbound method get_all_breaks() must be called with Pdb
> instance as first argument (got nothing instead)
Yes, pdb.Pdb is just a class, you need to instantiate it with Pdb(). This
works, kind of:
>>> pdb.Pdb().get_all_breaks()
{}
Marginally more usefully:
>>> p = pdb.Pdb()
>>> # add some breakpoints (but how?)
>>> p.get_all_breaks()
I think this feature request, "expose IPython's pdb instance", may be
sympathetic to your cause.
RSS Feed