Previous Next

MDB Reference : List of Commands : Breakpoint Commands

Breakpoint Commands
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 
Break
Sets a breakpoint at the specified source line number.
Command format: break filename:linenumber [passCount]
Example:
break newmain.c:142 4
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.
Example:
break *0x9d0000cc 5
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]
Example:
break function_foo 5
Delete
Deletes a breakpoint – if no argument is specified, delete all breakpoints. You can abbreviate this command as d.
Command format: delete [breakpoint number]
d [breakpoint number]
The breakpoint number is generated by MDB for the break and/or watch commands.
Examples:
delete or D
delete 1 or d 1
Halt
Stops the debugged program.
Watch
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.
Examples:
watch 0xa0007ff0 R:0xf 1
watch 0xa0007ff0 R:10 1
watch my_Variable W 4
MDB will assign and return the watchpoint number, for example: Watchpoint 1

Previous Next Microchip Support
Help Updated: 2014-08-12 12:16:05Z
Help Page: 12