Message114200
Hello,
I changed pdb.py to the file I added in the attachment (I just used the given patch pdb_cache_f_locals.patch)
Then I created the following file:
import pdb
def function_1(number):
stack_1 = number
function_2(stack_1)
def function_2(number):
stack_2 = number + 1
function_3(stack_2)
def function_3(number):
stack_3 = number + 1
pdb.set_trace()
print stack_3
function_1(1)
and run that file with python -i <filename>
This is my python version:
---------------------------------------
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
-----------------------------------------
And here is what I did in the pdb session:
> c:\tst_pdb.py(14)function_3()
-> print stack_3
(Pdb) !print stack_3
3
(Pdb) u
> c:\tst_pdb.py(9)function_2()
-> function_3(stack_2)
(Pdb) l
4 stack_1 = number
5 function_2(stack_1)
6
7 def function_2(number):
8 stack_2 = number + 1
9 -> function_3(stack_2)
10
11 def function_3(number):
12 stack_3 = number + 1
13 pdb.set_trace()
14 print stack_3
(Pdb) !print stack_2
*** NameError: name 'stack_2' is not defined
(Pdb) d
> c:\tst_pdb.py(14)function_3()
-> print stack_3
(Pdb) l
9 function_3(stack_2)
10
11 def function_3(number):
12 stack_3 = number + 1
13 pdb.set_trace()
14 -> print stack_3
15
16 function_1(1) [EOF]
(Pdb) !stack_3 = 125 #this works now with the patch
(Pdb) !print stack_3
125
(Pdb)
When I use my original pdb.py, I can print variable stack_2 when I move one frame up, but can't change the value of these local variables. |
|
Date |
User |
Action |
Args |
2010-08-18 06:18:08 | Markus.Pröller | set | recipients:
+ Markus.Pröller, georg.brandl, amaury.forgeotdarc, benjamin.peterson, mproeller, maru |
2010-08-18 06:18:07 | Markus.Pröller | set | messageid: <1282112287.02.0.609631069229.issue5215@psf.upfronthosting.co.za> |
2010-08-18 06:18:05 | Markus.Pröller | link | issue5215 messages |
2010-08-18 06:18:04 | Markus.Pröller | create | |
|