1
func(a(), b.c)

When executing the line above in the pdb debugger, using step will actually step into a, and then into the getter for b.c if its atypical (such as being a property), before actually stepping into func.

Generally I find myself using step followed by r to return from the frames I'm not interested in, and often inexplicably pass over and miss the opportunity to step directly into func.

How do I step directly into func, or what sequence of debugger commands will guarantee that I end up in func rather than passing over it?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526

2 Answers2

2

tb func ("temporary break at func") followed by c ("continue") should work.

Alex Martelli
  • 854,459
  • 170
  • 1,222
  • 1,395
0

I would handle this by setting a break at the line number inside func that you're interested in, and then use continue. For example suppose your code looks like this:

110  def func(a1, a2):
111      "" docstring ""
112      first interesting line

then do this:

python -m pdb caller.py
pdb> b 112
pdb> c
Vicki Laidler
  • 3,415
  • 1
  • 20
  • 17
  • This leaves a break at that line -- `tbreak` (the temporary break, that works just once), as I suggested earlier, seems closer to what the OP is asking. – Alex Martelli Jul 17 '10 at 03:56