In: Computer Science
In C language:
What is the difference between the step and stepi gdb commands? Why is this difference significant?
Q:- What is the difference between the step and
stepi gdb commands? Why is this difference significant?
Answer:------
Use the step command to execute a line of source code. When the
line being stepped contains a function call, the step command steps
into the function and stops at the first executable statement.
Use the stepi command to step into the next machine instruction. When the instruction contains a function call, the stepi command steps into the function being called.
For multithreaded applications, use the stepi command to step the current thread one machine instruction while putting all other threads on hold.
If you supply the optional expression argument, the debugger evaluates the expression as a positive integer that specifies the number of times to execute the command. The expression can be any expression that is valid in the current context.
step_into_command
: step [ step_number ]
| stepi [ step_number ]
step_number
: expression