Skip to content

continue until reaching your own code #1665

Description

@ernop

I use ipython for debugging Django & I'll often call a deep system or django function, which will generate a deep series of calls, at the bottom of which is a return to one of my own functions (but I'm not sure which).

In order to figure it out, I usually set a breakpoint right before the call, and then step down into it about 10 times, to get to where it calls my own function. In django this comes up a lot because it has lots of functions which are just two lines.

I was thinking, it'd be pretty great to be able to define a target directory and then be able to issue a different type of continue command from within ipdb, which would do a normal continue, but automatically stop whenever execution returned to a file in or below the target directory you had defined.

Calling it "continue to target", you could just do "ct" from the debugger right before a system call, and processing would continue until it returned to my own code. In some ways it'd be like the "next" command - if there were only system calls contained in your function. But if there were calls to your own code somewhere in there, you'd automatically stop there.

Really, it could be implemented with smart aliases - just keep stepping until the currently executing frame matches the target dir - but doing it there would probably be slow.

I realize that this could also be done by just setting breakpoints at the start of all my functions, or by logging all my functions. This would work in some cases, but if I don't want to always break there, then it would require setting up lots of ignored breakpoints and having them trigger at the right time - it could get complicated.

Anyway, is this something that exists already?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions