Jump to the specified line number or address.
jump { num | *addr }
num |
Number of the line to jump to. |
addr |
Address of the instruction to jump to. |
This command jumps the program counter to the specified location. The debugger resumes program execution at that point unless it encounters a breakpoint there.
A jump does not change the stack frame or any memory contents. Jumping from one routine to another can lead to unpredictable results.
The tbreak command is commonly used in conjunction with this command.
One way you can use this command is to go to a section of the debuggee that has already executed, in order to examine it more closely.
If num is in a function other than the one currently executing, and the two functions require different argument patterns or different patterns for local variables, the output of this command may be unpredictable.
Because of this behavior, when num is not in the current function, the debugger prompts you to confirm this command.
This command is similar to storing a new value in the $pc register, in that it changes the address from which the application continues executing. For example, the command set $pc = 0x123 causes the next continue command to continue from the address 0x123.
When the debugger hits the breakpoint at line 23, the code at line 23 has not yet been executed, so a[11] holds garbage. The jump to line 27 mean that the code at lines 23, 24, 25 and 26 is not executed, so a[11] still holds garbage.
Breakpoint 1, main () at string_call.c:23 23 char a[11] = "ten chars!\000"; /* Add stopper for char* reference */ (idb) l 18 printf("string is \"%s\"\n", str); 19 } 20 21 int main() 22 { /*1234567890*/ 23 char a[11] = "ten chars!\000"; /* Add stopper for char* reference */ 24 char *p = "10 string."; 25 char *n = "null\x0null"; 26 27 print_array(a); /* array is "ten chars!" */ (idb) b 28 Breakpoint 2 at 0x8048457: file string_call.c, line 28. (idb) jump 27 Continuing at 0x804844a. array is "˜ZZ·?z_·˜Z" /* init of 'a' on line 23 was skipped, so it holds garbage. */ Breakpoint 2, main () at string_call.c:28 28 print_char_ptr(&a[0]); /* string is "ten chars!" */ (idb)
Copyright © 1996-2010, Intel Corporation. All rights reserved.