To display information about the breakpoint commands available in MDB, type
help breakpoints.
Table 2-2 provides additional information for this command.
Table: Breakpoint Commands
|
Sets a breakpoint at the specified source line number.
Command format: break filename:linenumber [passCount]
|
Sets a breakpoint at an absolute address.
Command format: break *address [passCount]
• |
address - the address of the program memory to break on – use the command: 'print /a' to get a symbol address. |
• |
passCount - the parameter is optional. The number of times the break ‘on condition’ is met before the program halts. |
MDB assigns a breakpoint number and returns:
Breakpoint 0 at 0x9d0000cc: file newmain.c, line 16.
|
Sets a breakpoint at the beginning of the function.
Command format: break function_name [passCount]
|
|
Deletes a breakpoint – if no argument is specified, delete all breakpoints. You can abbreviate this command as d.
Command format: delete [breakpoint number]
The breakpoint number is generated by MDB for the break and/or watch commands.
|
|
Stops the debugged program.
|
|
Sets a data breakpoint at the specified memory address, variable name, or an SFR (special function register):
Command format: Watch address breakonType[:value] [passCount]
• |
address – the name of a global variable, SFR, or data memory address to be watched. Use command 'print /a' to get a variable address. |
• |
breakonType: R -- Read. W -- Write. RW -- Read or Write. |
• |
value – this parameter is optional. If it is specified, the program will break only when the value held in the data memory matches the specified value matches the specified value. |
• |
passCount – this parameter is optional. The number of times the breakon condition is met before the program breaks. |
MDB will assign and return the watchpoint number, for example: Watchpoint 1
|