| |||
| Home > DS-5 Debugger commands > DS-5 Debugger commands listed in alphabetical order > hbreak | |||
This command sets a hardware execution breakpoint at a specific
location. You can also specify a conditional breakpoint by using
an if statement that stops only when the conditional expression
evaluates to true.
The number of hardware breakpoints are usually limited. If you run out of hardware breakpoints then delete or disable one that you are no longer using.
Breakpoints that are set within a shared object are deleted when the shared object is unloaded.
hbreak [-d] [-p] [ [filename:]location | *address] [ thread | core number...] [vmid vmid] [if expression]
Where:
dDisables the breakpoint immediately after creation.
pSpecifies whether or not the resolution of an unrecognized breakpoint location results in a pending breakpoint being created.
filenameSpecifies the file.
locationSpecifies the location:
line_numis a line number.
functionis a function name.
labelis a label name.
+offset | -offsetSpecifies the line offset from the current location.
addressSpecifies the address. This can be either an address or an expression that evaluates to an address.
numberSpecifies one or more threads or processors to apply
the breakpoint to. You can use $thread to refer
to the current thread. If is
not specified then all threads are affected.number
vmidSpecifies the Virtual Machine ID (VMID) to apply the breakpoint to. This can be either an integer or an expression that evaluates to an integer.
expressionSpecifies an expression that is evaluated when the breakpoint is hit.
If no arguments are specified then a hardware breakpoint is set at the current PC.
Example 38. hbreak
hbreak *0x8000 # Set breakpoint at address 0x8000 hbreak *0x8000 thread $thread # Set breakpoint at address 0x8000 on current thread hbreak *0x8000 thread 1 3 # Set breakpoint at address 0x8000 on threads 1 and 3 hbreak main # Set breakpoint at address of main() hbreak SVC_Handler # Set breakpoint at address of label SVC_Handler hbreak +1 # Set breakpoint at address of next source line hbreak my_File.c:main # Set breakpoint at address of main() in my_File.c hbreak my_File.c:8 # Set breakpoint at address of line 8 in my_File.c hbreak function1 if x>0 # Set conditional breakpoint that stops when x>0