This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Markus.Pröller
Recipients Markus.Pröller
Date 2010-08-18.12:17:15
SpamBayes Score 0.0007301629
Marked as misclassified No
Message-id <1282133837.82.0.171010459939.issue9633@psf.upfronthosting.co.za>
In-reply-to
Content
Hello,

with python 2.7 I encounter the following problem:
I have created the following sample script:

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)

This is what I have done in the pdb session:
> 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
3
(Pdb) !stack_3 = 177
(Pdb) !print stack_3
177
(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
2
(Pdb) !stack_2 = 144
(Pdb) !print stack_2
144
(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
3
(Pdb) u
> c:\tst_pdb.py(9)function_2()
-> function_3(stack_2)
(Pdb) !print stack_2
2
(Pdb)

I walked through the stack and changed the values of the variables stack_x but the values weren't saved when I moved one frame up/down
History
Date User Action Args
2010-08-18 12:17:17Markus.Pröllersetrecipients: + Markus.Pröller
2010-08-18 12:17:17Markus.Pröllersetmessageid: <1282133837.82.0.171010459939.issue9633@psf.upfronthosting.co.za>
2010-08-18 12:17:16Markus.Pröllerlinkissue9633 messages
2010-08-18 12:17:15Markus.Pröllercreate