line breaking
This commit is contained in:
@@ -171,14 +171,14 @@ break line.cpp:31
|
|||||||
Set a breakpoint at some point in your code just before (in order of execution!) you think the first error
|
Set a breakpoint at some point in your code just before (in order of execution!) you think the first error
|
||||||
might occur. Finally, in order to actually start running the program under control of the debugger,
|
might occur. Finally, in order to actually start running the program under control of the debugger,
|
||||||
you will need to type *run* at the gdb command line.
|
you will need to type *run* at the gdb command line.
|
||||||
|
|
||||||
4. Stepping through the program:
|
4. Stepping through the program:
|
||||||
You can step through the code using the commands *next* (move to the next line of code), *step* (enter
|
You can step through the code using the commands *next* (move to the next line of code), *step* (enter the function), and *finish* (leave the function). The command *continue* allows you to move to the next breakpoint.
|
||||||
the function), and *finish* (leave the function). The command *continue* allows you to move to the
|
|
||||||
next breakpoint.
|
|
||||||
5. Examining the content of variables:
|
5. Examining the content of variables:
|
||||||
- You can use *print* to see the values of variables and expressions.
|
- You can use *print* to see the values of variables and expressions.
|
||||||
- You can use the command *display* to see the contents of a particular variable or expression when the
|
- You can use the command *display* to see the contents of a particular variable or expression when the program is stopped.
|
||||||
program is stopped.
|
|
||||||
6. Program flow:
|
6. Program flow:
|
||||||
The command *backtrace* can be used to show the contents of the call stack. This is particularly
|
The command *backtrace* can be used to show the contents of the call stack. This is particularly
|
||||||
important if your program crashes. Unfortunately, the crash often occurs inside C++ library code.
|
important if your program crashes. Unfortunately, the crash often occurs inside C++ library code.
|
||||||
|
|||||||
Reference in New Issue
Block a user