cansarigol/pdbr

Request: be able to search the source code

jeromegit opened this issue · 3 comments

One of the limitations of pdb (vs the Perl debugger for example) is to be able to search the source code/text of the file being debugged. For example, if I want to set a breakpoint at a specific line that has the variable say my_var, I would be able to do so by just typing something like:
/my_var
and pdbr can jump to the first instance of my_var in the code.
Repeating the action with either /my_var or a simple /, would jump to the next occurrence of my_var, and loop back to the beginning of the file if needed.

What do you think?

Would be great. After reading your message I thought that we can use jump command with a string search argument instead integer. But jump is limited with the current frame.
Could you elaborate more what you mean instance? If you expect to check entire source of the current frame, we might have to jump the next-previous frames and i am not sure how it can be done with a proper way.

I can traverse related lines of the current frame like below but i am not sure it is sufficient.

Screenshot from 2021-06-18 20-20-00