pdbtrack

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

pdbtrack

Andreas Röhler-2

Hi Barry,

I'll send you two screenshots offlist.  Please feel
free to forward them to interested persons, just didn't
want to publish my path at the list.

20090428_pdbtrack3.png displays pdbtrack opened second
windows, cursor displayed at line 4 "import"

With 20090428_pdbtrack4.png you see  shell-output
from line 8, but cursor in second window still is at line 4.

Always get "Traceback cue not found"

Cause seems var `py-pdbtrack-stack-entry-regexp'.

That doesn't happen, if pdb.set_trace() is inside the
python-file.

Did someone else remark this?

Andreas
_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: pdbtrack

Barry Warsaw
On Apr 30, 2009, at 4:07 PM, Andreas Roehler wrote:

> I'll send you two screenshots offlist.  Please feel
> free to forward them to interested persons, just didn't
> want to publish my path at the list.
>
> 20090428_pdbtrack3.png displays pdbtrack opened second
> windows, cursor displayed at line 4 "import"
>
> With 20090428_pdbtrack4.png you see  shell-output
> from line 8, but cursor in second window still is at line 4.
>
> Always get "Traceback cue not found"
>
> Cause seems var `py-pdbtrack-stack-entry-regexp'.
>
> That doesn't happen, if pdb.set_trace() is inside the
> python-file.
>
> Did someone else remark this?
Hi Andreas,

I haven't heard this one before, but perhaps it's because of the  
ipython prompt?  I think pdbtrack expects (by default) the standard  
(pdb) prompt.

-Barry


_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode

PGP.sig (313 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: pdbtrack

Andreas Röhler-2
Barry Warsaw wrote:

> On Apr 30, 2009, at 4:07 PM, Andreas Roehler wrote:
>
>> I'll send you two screenshots offlist.  Please feel
>> free to forward them to interested persons, just didn't
>> want to publish my path at the list.
>>
>> 20090428_pdbtrack3.png displays pdbtrack opened second
>> windows, cursor displayed at line 4 "import"
>>
>> With 20090428_pdbtrack4.png you see  shell-output
>> from line 8, but cursor in second window still is at line 4.
>>
>> Always get "Traceback cue not found"
>>
>> Cause seems var `py-pdbtrack-stack-entry-regexp'.
>>
>> That doesn't happen, if pdb.set_trace() is inside the
>> python-file.
>>
>> Did someone else remark this?
>
> Hi Andreas,
>
> I haven't heard this one before, but perhaps it's because of the ipython
> prompt?

Maybe. As shows message in first screenshot #3, pdbtrack indicates line 4 correctly.
Its not brocken completely.

Its a question of regexp, which doesn't recognise/accept the result, delivered by `block'.

Already tried to change the regexp or even simply eliminate that checking step, but not
found a solution.

Hhm. Could you give me an example, how you run script activating pdbtrace, reaching
the standard (pdb) prompt from Emacs?

Only get it from shell.

Thanks

Andreas


 I think pdbtrack expects (by default) the standard (pdb) prompt.
>
> -Barry
>

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: pdbtrack

Barry Warsaw
On May 1, 2009, at 4:50 PM, Andreas Roehler wrote:

> Hhm. Could you give me an example, how you run script activating  
> pdbtrace, reaching
> the standard (pdb) prompt from Emacs?

I almost always just add the following line to the source code at the  
point I want to start debugging:

     import pdb; pdb.set_trace()

Then I fire up my application from the shell.  When that line gets it,  
Python breaks and pdbtrack starts up.  It's worked pretty much that  
way for me since forever.

-Barry


_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode

PGP.sig (313 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: pdbtrack

ken manheimer
In reply to this post by Andreas Röhler-2
On Fri, May 1, 2009 at 4:50 PM, Andreas Roehler <[hidden email]> wrote:
Barry Warsaw wrote:
> On Apr 30, 2009, at 4:07 PM, Andreas Roehler wrote:
>
>> I'll send you two screenshots offlist.  Please feel
>> free to forward them to interested persons, just didn't
>> want to publish my path at the list.
>>
>> 20090428_pdbtrack3.png displays pdbtrack opened second
>> windows, cursor displayed at line 4 "import"
>>
>> With 20090428_pdbtrack4.png you see  shell-output
>> from line 8, but cursor in second window still is at line 4.
>>
>> Always get "Traceback cue not found"
>>
>> Cause seems var `py-pdbtrack-stack-entry-regexp'.
>>
>> That doesn't happen, if pdb.set_trace() is inside the
>> python-file.
>>
>> Did someone else remark this?
>
> Hi Andreas,
>
> I haven't heard this one before, but perhaps it's because of the ipython
> prompt?

Maybe. As shows message in first screenshot #3, pdbtrack indicates line 4 correctly.
Its not brocken completely.

i'm having some difficulties tracking your descriptions of the situation, andreas, but i think you (and barry) are right that the problem is failure to recognize, rather than pdbtrack not being activated (as you seemed to initially be suggesting).
 
Its a question of regexp, which doesn't recognise/accept the result, delivered by `block'.

i don't understand what you mean by "delivered by 'block'"
 
Already tried to change the regexp or even simply eliminate that checking step, but not
found a solution.
 
the match may be necessary to parse the traceback, and for other reasons.

Hhm. Could you give me an example, how you run script activating pdbtrace, reaching
the standard (pdb) prompt from Emacs?

what do you mean by "reaching the standard (pdb) prompt from Emacs"??  perhaps you're talking about the python interaction buffer that python-mode provides?  i believe, but am not certain, that pdbtrack watches the output in any comint buffer, including the python interaction buffer.  i can check this kind of thing, but need to understand better what you're saying before investigating.

Only get it from shell.

one thing i can suggest that you do is copy the text from the emacs buffer that pdbtrack should recognize but doesn't, and send that excerpt to us.  i know that's in the pictures, but it's easier for you to send us the text than it is for us to type it accurately from the pictures.-)  preferably you would also send an excerpt that is similar but is successfuly recognized.

i will try to find time to examine it, and see if i can identify what is happening and what should be happening...
--
ken
http://myriadicity.net
 
Thanks

Andreas


 I think pdbtrack expects (by default) the standard (pdb) prompt.
>
> -Barry


_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: pdbtrack

ken manheimer
looking at this a little bit more closely, it's surprising to me not that it fails for you, but that it works at all.  have you made any changes to the py-pdbtrack-input-prompt variable (aka 'python-pdbtrack-input-prompt' in recent versions of python.el)?

as the docstring for py-pdbtrack-track-stack-file states, "We depend on the pdb input prompt matching `py-pdbtrack-input-prompt' at the beginning of the line."  the default setting simply should not match the "ipydb> " that your photos are showing.  ?

sorry if i'm missing something obvious - i'm trying to get context here, with not quite enough time to pay full attention...
--
ken
http://myriadicity.net

On Fri, May 1, 2009 at 5:28 PM, ken manheimer <[hidden email]> wrote:
On Fri, May 1, 2009 at 4:50 PM, Andreas Roehler <[hidden email]> wrote:
Barry Warsaw wrote:
> On Apr 30, 2009, at 4:07 PM, Andreas Roehler wrote:
>
>> I'll send you two screenshots offlist.  Please feel
>> free to forward them to interested persons, just didn't
>> want to publish my path at the list.
>>
>> 20090428_pdbtrack3.png displays pdbtrack opened second
>> windows, cursor displayed at line 4 "import"
>>
>> With 20090428_pdbtrack4.png you see  shell-output
>> from line 8, but cursor in second window still is at line 4.
>>
>> Always get "Traceback cue not found"
>>
>> Cause seems var `py-pdbtrack-stack-entry-regexp'.
>>
>> That doesn't happen, if pdb.set_trace() is inside the
>> python-file.
>>
>> Did someone else remark this?
>
> Hi Andreas,
>
> I haven't heard this one before, but perhaps it's because of the ipython
> prompt?

Maybe. As shows message in first screenshot #3, pdbtrack indicates line 4 correctly.
Its not brocken completely.

i'm having some difficulties tracking your descriptions of the situation, andreas, but i think you (and barry) are right that the problem is failure to recognize, rather than pdbtrack not being activated (as you seemed to initially be suggesting).
 
Its a question of regexp, which doesn't recognise/accept the result, delivered by `block'.

i don't understand what you mean by "delivered by 'block'"
 
Already tried to change the regexp or even simply eliminate that checking step, but not
found a solution.
 
the match may be necessary to parse the traceback, and for other reasons.

Hhm. Could you give me an example, how you run script activating pdbtrace, reaching
the standard (pdb) prompt from Emacs?

what do you mean by "reaching the standard (pdb) prompt from Emacs"??  perhaps you're talking about the python interaction buffer that python-mode provides?  i believe, but am not certain, that pdbtrack watches the output in any comint buffer, including the python interaction buffer.  i can check this kind of thing, but need to understand better what you're saying before investigating.

Only get it from shell.

one thing i can suggest that you do is copy the text from the emacs buffer that pdbtrack should recognize but doesn't, and send that excerpt to us.  i know that's in the pictures, but it's easier for you to send us the text than it is for us to type it accurately from the pictures.-)  preferably you would also send an excerpt that is similar but is successfuly recognized.

i will try to find time to examine it, and see if i can identify what is happening and what should be happening...
--
ken
http://myriadicity.net
 
Thanks

Andreas


 I think pdbtrack expects (by default) the standard (pdb) prompt.
>
> -Barry

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: pdbtrack

Andreas Röhler-2
ken manheimer wrote:
> looking at this a little bit more closely, it's surprising to me not
> that it fails for you, but that it works at all.  


Hi Ken,

thats the point probably.

Originally question was: must we change the source-code in order to
make pdbtrack working, must we put a pdb.set_trace() into it?

Tried to avoid that and watched results coming from pdb also without that.

While executing, results are delivered to function

py-pdbtrack-get-source-buffer (block)

line 1444 of my python-mode.el


Then (string-match py-pdbtrack-stack-entry-regexp block) decides to accept result or not.

Played a little bit with py-pdbtrack-stack-entry-regexp:.

;; pdbtrack constants
(defconst py-pdbtrack-stack-entry-regexp
;  "^> \\([^(]+\\)(\\([0-9]+\\))\\([?a-zA-Z0-9_]+\\)()"
;; "^> \\(.*\\)(\\([0-9]+\\))\\([?a-zA-Z0-9_]+\\)()"
  "> \\(.*\\)(\\([0-9]+\\))\\(.*\\)()"
  ;; "^ \\(.*\\)"
"Regular expression pdbtrack uses to find a stack trace entry.")



Andreas

have you made any

> changes to the py-pdbtrack-input-prompt variable (aka
> 'python-pdbtrack-input-prompt' in recent versions of python.el)?
>
> as the docstring for py-pdbtrack-track-stack-file states, "We depend on
> the pdb input prompt matching `py-pdbtrack-input-prompt' at the
> beginning of the line."  the default setting simply should not match the
> "ipydb> " that your photos are showing.  ?
>
> sorry if i'm missing something obvious - i'm trying to get context here,
> with not quite enough time to pay full attention...
> --
> ken
> http://myriadicity.net <http://myriadicity.net/>
>
> On Fri, May 1, 2009 at 5:28 PM, ken manheimer <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On Fri, May 1, 2009 at 4:50 PM, Andreas Roehler
>     <[hidden email] <mailto:[hidden email]>> wrote:
>
>         Barry Warsaw wrote:
>         > On Apr 30, 2009, at 4:07 PM, Andreas Roehler wrote:
>         >
>         >> I'll send you two screenshots offlist.  Please feel
>         >> free to forward them to interested persons, just didn't
>         >> want to publish my path at the list.
>         >>
>         >> 20090428_pdbtrack3.png displays pdbtrack opened second
>         >> windows, cursor displayed at line 4 "import"
>         >>
>         >> With 20090428_pdbtrack4.png you see  shell-output
>         >> from line 8, but cursor in second window still is at line 4.
>         >>
>         >> Always get "Traceback cue not found"
>         >>
>         >> Cause seems var `py-pdbtrack-stack-entry-regexp'.
>         >>
>         >> That doesn't happen, if pdb.set_trace() is inside the
>         >> python-file.
>         >>
>         >> Did someone else remark this?
>         >
>         > Hi Andreas,
>         >
>         > I haven't heard this one before, but perhaps it's because of
>         the ipython
>         > prompt?
>
>         Maybe. As shows message in first screenshot #3, pdbtrack
>         indicates line 4 correctly.
>         Its not brocken completely.
>
>
>     i'm having some difficulties tracking your descriptions of the
>     situation, andreas, but i think you (and barry) are right that the
>     problem is failure to recognize, rather than pdbtrack not being
>     activated (as you seemed to initially be suggesting).
>      
>
>         Its a question of regexp, which doesn't recognise/accept the
>         result, delivered by `block'.
>
>
>     i don't understand what you mean by "delivered by 'block'"
>      
>
>         Already tried to change the regexp or even simply eliminate that
>         checking step, but not
>         found a solution.
>
>      
>     the match may be necessary to parse the traceback, and for other
>     reasons.
>
>         Hhm. Could you give me an example, how you run script activating
>         pdbtrace, reaching
>         the standard (pdb) prompt from Emacs?
>
>
>     what do you mean by "reaching the standard (pdb) prompt from
>     Emacs"??  perhaps you're talking about the python interaction buffer
>     that python-mode provides?  i believe, but am not certain, that
>     pdbtrack watches the output in any comint buffer, including the
>     python interaction buffer.  i can check this kind of thing, but need
>     to understand better what you're saying before investigating.
>
>         Only get it from shell.
>
>
>     one thing i can suggest that you do is copy the text from the emacs
>     buffer that pdbtrack should recognize but doesn't, and send that
>     excerpt to us.  i know that's in the pictures, but it's easier for
>     you to send us the text than it is for us to type it accurately from
>     the pictures.-)  preferably you would also send an excerpt that is
>     similar but is successfuly recognized.
>
>     i will try to find time to examine it, and see if i can identify
>     what is happening and what should be happening...
>     --
>     ken
>     http://myriadicity.net
>      
>
>         Thanks
>
>         Andreas
>
>
>          I think pdbtrack expects (by default) the standard (pdb) prompt.
>         >
>         > -Barry
>

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode