Subject: bug#6097: 23.1; PDB should pop "up" the stack on return

From: Stefan Kangas <[email-masked]>
Date: Fri, 13 Sep 2019 13:38:26 +0200

David Abrahams <[email-masked]> writes:

> 1) Debug a python program using PDB, say
>
>     def g():
>         pass
>
>     def h():
>         pass
>
>     def f():
>         g()
>         h()
>
> 2) step into g()
> 3) hit `n' until you see
>
>    --Return--
>
>    in the *gud* buffer
>
> 4) Note that the GUD line marker is still pointing at the last line of g,
>    just as it was before the last `n'
>
> 5) Hit `n' again.  Note that the GUD line marker is now pointing at
>    the first line of h()
>
> It would be more consistent and easier to use if, at step 4, the line
> marker indicated the 3rd line of f(), i.e. the call to h()

I'm not exactly sure what you are requesting here.

To determine what line to jump to, pdb is parsing lines such as:

> /home/skangas/foo.py(2)g()->None
                       ^
> /home/skangas/foo.py(9)f()
                       ^

This works as expected on the latest master branch.

I'm not sure how we could do better here, unless pdb changes it's
output.  I'm therefore leaning towards closing this as notabug.

Please clarify if there is something I'm missing.

Best regards,
Stefan Kangas