setpc

Sets the value of the program counter register.

Syntax
setpc {[-va|-ve|-vn]} -address <address>
setpc {[-va|-ve|-vn]} -line <line_number> {source_file} {target}
setpc {[-va|-ve|-vn]} -line [+|-]n
setpc {[-va|-ve|-vn]} -gsymbol <symbol>
setpc {[-va|-ve|-vn]} -lsymbol <symbol> <source_file> {target}
setpc {[-va|-ve|-vn]} -line [+|-]n <symbol>
setpc {[-va|-ve|-vn]} -line [+|-]n <symbol> <source_file> {target}
setpc {[-va|-ve|-vn]} -line [+|-] <symbol> <source_file> {target}
Examples

The following table lists and defines examples of the setpc command.

Table 1. setpc Command-line debugger command - Examples
Command Description
setpc -address 0x1000 Sets the PC to address 0x1000.
setpc -line 10 Sets the PC to source line 10 in the current source file.
setpc -line 10 myfile.c Sets the PC to source line 10 in source file 'myfile.c'.
setpc -line +10 Sets the PC to an offset of 10 lines from the current source line.
setpc -gsymbol my_extern_function Sets the PC to the address of the 'my_extern_function' global symbol.
setpc -lsymbol my_static_function myfile.c Sets the PC to the address of the 'my_static_function' local symbol defined in source file 'myfile.c'.
setpc -line +10 my_extern_function Sets the PC to the address corresponding to an offset of 10 source lines from the location where 'my_extern_function' global symbol was defined.
setpc -line +10 my_static_function myfile.c Sets the PC to the address corresponding to an offset of 10 source lines from the location where 'my_static_function' local symbol was defined, in source file 'myfile.c'.
setpc -line 10 myfile.c mymodule.ko Sets the PC to source line 10 in source file 'myfile.c'. The file 'myfile.c' is used by the target 'mymodule.ko'.