Stop when the line with the lineno greater than the current one is reached or when returning from current frame.
bdb/Bdb.set_until
Bdb.set_until