[Tutor] Debuggers that permit you to change variable values d uring debug session

Mallett, Roger rmallett@rational.com
Thu, 7 Dec 2000 09:09:26 -0800


Concerning changing values of variables during a debug session,

Simon stated:
>This worked fine for me:

>[Dbg]>>> counter
>0
>[Dbg]>>> counter = 2
>[Dbg]>>> counter
>7
>[Dbg]>>> 
>
>What OS/Python release/PythonWin build are you at?

My configuration is as follows:
     OS:  Win2K SP1
     Version # from the About Box:  ActivePython build 202
     From the Interactive Window: PythonWin 2.0 (#8, Oct 19,2000, 11:30:05)

It is interesting to me that you obtained the results I expected to get but
didn't.

After receiving your response, I checked the ActiveState site and build 202
is the latest build.  I attempted to redownload for a reinstall but the site
was not responding, so I'll wait till later.

I am now curious as to what version you are using after all, if you are
using the same version I am, then there is certainty that my installation is
bad and a reinstall in necessary, otherwise,...).

Roger Mallett





-----Original Message-----
From: Simon Brunning [mailto:SBrunning@trisystems.co.uk]
Sent: Thursday, December 07, 2000 1:29 AM
To: 'Mallett, Roger'; tutor@python.org
Subject: RE: [Tutor] Debuggers that permit you to change variable values
d uring debug session


> From:	Mallett, Roger [SMTP:rmallett@rational.com]
> I attempted to modify a variable using the interactive 
>window.  However, the modification did not affect the 
>value on the stack.
> 
> For example, below are three lines of code and the 
> interactive session that I experienced.  A breakpoint 
> was set at line3.  When line2 executed, the stack 
> showed its counter = 0, which is also what I experienced 
> in line4 & line5.  However, when I modified the value 
> of the counter (line6) (while still at the breakpoint), 
> the value of counter only changed in the interactive 
> window (line7 & line8), but did not change the value 
> on the stack.  Evidence that the value on the stack 
> did not change was demonstrated when line3 was 
> executed and the value of counter as 5 rather than 6 
> (line9 & line10).  A display of 5 means that line6 
> had no real affect on the variable as it was being 
> operated on in the script.
> 
> Is it possible to modify values on the stack from 
> within the debug session?
> 
> 
> line1    def Main():
> line2        counter = 0
> line3        counter = counter + 5
> 
> 
> 
> line4    [Dbg]>>> counter 
> line5    0
> line6    [Dbg]>>> counter = counter + 1
> line7    [Dbg]>>> counter 
> line8    1
> line9    [Dbg]>>> counter
> line10   5
> line11   [Dbg]>>> 
  
This worked fine for me:

[Dbg]>>> counter
0
[Dbg]>>> counter = 2
[Dbg]>>> counter
7
[Dbg]>>> 

What OS/Python release/PythonWin build are you at?

Cheers,
Simon Brunning
TriSystems Ltd.
sbrunning@trisystems.co.uk




-----------------------------------------------------------------------
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution, or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. TriSystems Ltd. cannot
accept liability for statements made which are clearly the senders own.