[issue9633] pdb go stack up/down

2020-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

I've reproduced the bug on 3.10.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2019-04-23 Thread daniel hahler


Change by daniel hahler :


--
nosy: +blueyed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2018-12-10 Thread Henry Chen


Change by Henry Chen :


--
pull_requests: +10309
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2017-10-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Note that we're currently looking into this as something that could be 
potentially addressed by PEP 558 and any related changes to the way that 
function locals interact with trace hooks: 
https://bugs.python.org/issue30744#msg304388

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2017-10-14 Thread Nick Coghlan

Change by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2013-03-28 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee: georg.brandl - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9633
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2012-12-05 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9633
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2012-11-24 Thread Xavier de Gaye

Xavier de Gaye added the comment:

It is not only the up and down commands; the where, longlist and
source commands may also overwrite changes made to f_locals.

In Markus sample script above, and with the patch applied, when the
change made to stack_2 is followed by a step command, stack_2 value
goes back to '2' again. This is because the self.curframe_locals list
is built from scratch again when processing the new trace function
triggered after the step command and a new call to frame_getlocals
(and thus to PyFrame_FastToLocals) is made on the frame of function_2
to populate self.curframe_locals, overwritting the previous value
'144' of stack_2.

With a dictionary mapping frames to f_locals (and only updating this
dictionary when adding entries for frames that do not exist in the
dictionary), the above problem is fixed. However, running step
repeatedly until returning to function_2, causes the value of stack_2
to become '2' again when in function_2. This is because, just after
returning from the frame of function_3, the following calls are made
in call_trampoline to invoke the first (after tracing function_3)
trace function in function_2 frame; the 'frame' argument of
PyFrame_FastToLocals is the frame of function_2 and so, the call to
PyFrame_FastToLocals overwrites the value '144' of stack_2, and the
value of stack_2 is back to '2' again:

  PyFrame_FastToLocals(frame);
  result = PyEval_CallObject(callback, args);
  PyFrame_LocalsToFast(frame, 1);

Only the f_locals of the top level frame is saved by
PyFrame_LocalsToFast after exiting the trace function, so it is not
possible to keep consistent the changes made in the f_locals of the
lower level frames.

Another solution would be to ensure that changes made to locals at the
top level frame are not overwritten, and to explicitly make readonly
the locals of the other frames.  See how this is done at
http://code.google.com/p/pdb-clone/source/detail?r=5643890608fce2eac318de61f1d6d065d5a7d538

--
nosy: +xdegaye

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9633
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2010-09-01 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

I believe this is slightly tricky because 'bdb.format_stack_entry' makes 
references to '.f_locals' and 'bdb.format_stack_entry' is invoked in several 
places in 'pdb'.  One option would be to add a extra parameter to 
'bdb.format_stack_entry' to accept a dictionary of locals to operate with.

I implemented this approach and added a doctest to verify.  See attached patch. 
 I didn't update the 'bdb' documentation to note the new parameter, but will if 
this approach seems reasonable.

--
keywords: +patch
Added file: http://bugs.python.org/file18706/issue9633.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9633
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2010-08-30 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
nosy: +meador.inge

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9633
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2010-08-18 Thread Markus Pröller

New submission from Markus Pröller mproel...@googlemail.com:

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

--
components: Library (Lib)
messages: 114213
nosy: Markus.Pröller
priority: normal
severity: normal
status: open
title: pdb go stack up/down
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9633
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2010-08-18 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Thank you for the report. I don’t know pdb much, but I assume you have checked 
the doc to make sure this is indeed a bug. Can you test it with 3.1 and 3.2 too?

Bug tracker tip: You can find if a core developer is interested in a module in 
Misc/maintainers.rst and make them nosy (or assign to them, if there is a star 
near their name, like in Georg’s case).

--
assignee:  - georg.brandl
nosy: +eric.araujo, georg.brandl

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9633
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9633] pdb go stack up/down

2010-08-18 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

The problem here is that changes in the locals are only saved back to the frame 
when leaving the trace function, and up/down don't do that.

This could be fixed by making Pdb.curframe_locals a dictionary for all visited 
frames while interaction is running.  I'll look into it for 3.2.

--
versions: +Python 3.2 -Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9633
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com