MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / do_jump

Method do_jump

tools/python-3.11.9-amd64/Lib/pdb.py:1132–1158  ·  view source on GitHub ↗

j(ump) lineno Set the next line that will be executed. Only available in the bottom-most frame. This lets you jump back and execute code again, or jump forward to skip code that you don't want to run. It should be noted that not all jumps are allowed

(self, arg)

Source from the content-addressed store, hash-verified

1130 do_c = do_cont = do_continue
1131
1132 def do_jump(self, arg):
1133 """j(ump) lineno
1134 Set the next line that will be executed. Only available in
1135 the bottom-most frame. This lets you jump back and execute
1136 code again, or jump forward to skip code that you don't want
1137 to run.
1138
1139 It should be noted that not all jumps are allowed -- for
1140 instance it is not possible to jump into the middle of a
1141 for loop or out of a finally clause.
1142 """
1143 if self.curindex + 1 != len(self.stack):
1144 self.error('You can only jump within the bottom frame')
1145 return
1146 try:
1147 arg = int(arg)
1148 except ValueError:
1149 self.error("The 'jump' command requires a line number")
1150 else:
1151 try:
1152 # Do the jump, fix up our copy of the stack, and display the
1153 # new position
1154 self.curframe.f_lineno = arg
1155 self.stack[self.curindex] = self.stack[self.curindex][0], arg
1156 self.print_stack_entry(self.stack[self.curindex])
1157 except ValueError as e:
1158 self.error('Jump failed: %s' % e)
1159 do_j = do_jump
1160
1161 def do_debug(self, arg):

Callers

nothing calls this directly

Calls 2

errorMethod · 0.95
print_stack_entryMethod · 0.95

Tested by

no test coverage detected