Strange debugger behaviour

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

Strange debugger behaviour

Luc J. Bourhis
When I execute the following snippet in the debugger

def f(a):
    if a > 0:
        pass
    else:
        return 1
   
a = f(1)

the run marker eventually goes on “pass”, which is fine, but then jump onto “return 1”, which is very surprising!! Hitting step over again immediately jumps out of the routine contrary to what would have happened if that if branch had been taken.

I am running Wing IDE Professional 2.0.2-1 Patches 03 on MacOS 10.4 with the System python (i.e. 2.3.5).

Thanks,

Luc Bourhis

Software Engineer

Chemical Crystallography Laboratory

University of Durham, UK



_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Strange debugger behaviour

Charles Hartman

On Jun 30, 2005, at 5:25 AM, Luc Bourhis wrote:

When I execute the following snippet in the debugger

def f(a):
    if a > 0:
        pass
    else:
        return 1
   
a = f(1)

the run marker eventually goes on “pass”, which is fine, but then jump onto “return 1”, which


This threw me too at first. It isn't jumping to the line "return 1" -- it's jumping to _the end of the routine_. No matter what path the marker has followed thro9ugh the function, it always makes a last stop on the last line. Sometimes it's confusing, as in the case you wrote. It has one big advantage, though: it lets you check variable values just before you leave the function.

Charles Hartman

is very surprising!! Hitting step over again immediately jumps out of the routine contrary to what would have happened if that if branch had been taken.

I am running Wing IDE Professional 2.0.2-1 Patches 03 on MacOS 10.4 with the System python (i.e. 2.3.5).

Thanks,

Luc Bourhis
Software Engineer
Chemical Crystallography Laboratory
University of Durham, UK

_________________________________________________
Wing IDE users list


_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: Strange debugger behaviour

Wing IDE Support
In reply to this post by Luc J. Bourhis
On Thu, 30 Jun 2005, Luc Bourhis wrote:
> When I execute the following snippet in the debugger
>
> def f(a):
>      if a > 0:
>          pass
>      else:
>          return 1
>
> a = f(1)

This is a confusing case.  We may try changing the marker to a
line under last line of function or something when we get an
exit event.

- Stephan

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: Strange debugger behaviour

Charles Hartman

On Jun 30, 2005, at 9:51 AM, Wingware Support wrote:

On Thu, 30 Jun 2005, Luc Bourhis wrote:

When I execute the following snippet in the debugger

def f(a):
     if a > 0:
         pass
     else:
         return 1

a = f(1)


This is a confusing case.  We may try changing the marker to a 
line under last line of function or something when we get an
exit event.

That sounds useful. When debugging gets to the exit of a function, insert a new line with "<return>" or something on it, highlight that, then get rid of it when we step onward?

Charles Hartman




- Stephan

_________________________________________________
Wing IDE users list


Charles Hartman
Professor of English, Poet in Residence
Connecticut College
*the Scandroid* is at cherry.conncoll.edu/cohar/Programs






_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: Strange debugger behaviour

Wing IDE Support
On Thu, 30 Jun 2005, Charles Hartman wrote:
> > This is a confusing case.  We may try changing the marker to a
> > line under last line of function or something when we get an
> > exit event.
>
> That sounds useful. When debugging gets to the exit of a function,  
> insert a new line with "<return>" or something on it, highlight that,  
> then get rid of it when we step onward?

No, I meant just using an underline instead of highlighting the
whole line.  I don't want to make the source appear to change --
that would be scary!

- Stephan

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: Strange debugger behaviour

Charles Hartman
Of course you're right.

On Jun 30, 2005, at 9:59 AM, Wingware Support wrote:

> On Thu, 30 Jun 2005, Charles Hartman wrote:
>
>>> This is a confusing case.  We may try changing the marker to a
>>> line under last line of function or something when we get an
>>> exit event.
>>>
>>
>> That sounds useful. When debugging gets to the exit of a function,
>> insert a new line with "<return>" or something on it, highlight that,
>> then get rid of it when we step onward?
>>
>
> No, I meant just using an underline instead of highlighting the
> whole line.  I don't want to make the source appear to change --
> that would be scary!
>
> - Stephan
>
>

Charles Hartman
Professor of English, Poet in Residence
Connecticut College
[hidden email]
*the Scandroid* is at cherry.conncoll.edu/cohar/Programs





_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: Strange debugger behaviour

Mike Rovner
In reply to this post by Wing IDE Support
Wingware Support wrote:

> On Thu, 30 Jun 2005, Charles Hartman wrote:
>
>>>This is a confusing case.  We may try changing the marker to a
>>>line under last line of function or something when we get an
>>>exit event.
>>
>>That sounds useful. When debugging gets to the exit of a function,  
>>insert a new line with "<return>" or something on it, highlight that,  
>>then get rid of it when we step onward?
>
>
> No, I meant just using an underline instead of highlighting the
> whole line.  I don't want to make the source appear to change --
> that would be scary!

BTW it will be good to have a return value in Stack Data frame
at this point.

Mike

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: Strange debugger behaviour

jason g-2
In reply to this post by Wing IDE Support
On 6/30/05, Wingware Support <[hidden email]> wrote:

> On Thu, 30 Jun 2005, Charles Hartman wrote:
> > > This is a confusing case.  We may try changing the marker to a
> > > line under last line of function or something when we get an
> > > exit event.
> >
> > That sounds useful. When debugging gets to the exit of a function,
> > insert a new line with "<return>" or something on it, highlight that,
> > then get rid of it when we step onward?
>
> No, I meant just using an underline instead of highlighting the
> whole line.  I don't want to make the source appear to change --
> that would be scary!
>
> - Stephan
>
> _________________________________________________
> Wing IDE users list
> http://wingware.com/lists/wingide
>
How about bringing the marker to the signature line of the function?
Or would this be too awkward? Just a suggestion!
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
Reply | Threaded
Open this post in threaded view
|

Re: Strange debugger behaviour

Luc J. Bourhis
In reply to this post by Mike Rovner

On 30 Jun 2005, at 19:27, Mike Rovner wrote:

Wingware Support wrote:

No, I meant just using an underline instead of highlighting the 
whole line.  I don't want to make the source appear to change -- 
that would be scary!

I vote for that feature!


BTW it will be good to have a return value in Stack Data frame
at this point.

I second that too. How many times I have created a “result” variable in a very simple function just for the sake of debugging…

Luc

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Strange debugger behaviour

Douglas Soares de Andrade
Hi !

> > BTW it will be good to have a return value in Stack Data frame
> > at this point.
>
> I second that too. How many times I have created a “result” variable
> in a very simple function just for the sake of debugging…

+1

I did this some times too.

> Luc

--
Douglas Soares de Andrade
dsa at unilestemg.br
UnilesteMG - www.unilestemg.br
ICQ, MSN = 76277921, douglas at tuxfamily.org

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide