hardbrk
Arguments
[read] [write] [execute] [mask=num] exp[:num] [{cmds}] [delete=num]
read
attribute
write
attribute
execute
attribute
mask
bit mask
exp
memory address, variable, or pointer name
{cmds}
See "Command list".
delete
attribute

Sets, clears, displays, enables, and disables hardware breakpoints, based on a single address with attributes read, write and execute. These breakpoints are implemented through direct hardware support and are only on some targets. MULTI removes all hardware breakpoints when detaching from process.

One advantage to a hardware breakpoint is that you can set it on a specific memory location. This causes a break when accessing that location, regardless of what instruction the program is on.

When a hardware breakpoint is reached, a message displays the breakpoint number and whether the break occurred on a read, write, or execute. For example:

Stopped by hardware break 1 on execute

Typing hardbrk by itself lists all currently set hardware breakpoints.

Any combination of read, write, and execute can be specified. read causes the break to occur when reading from the given address. write causes the break to occur when writing to the given address. execute causes the break to occur if the instruction stored at the given address is executed. Often the break only occurs after the read or write. read and write are used by default.

If mask=num is specified, then the bitwise complement of num is bitwise AND'ed with all addresses involved. This can give a range of addresses. For example, including mask=0xf ignores the lower four bits of the given address. In effect, this gives a range of 15 memory locations to use. mask is set to zero by default.

exp may be a memory address, variable, or pointer name. If :num is specified after exp, then num bytes after the address is used. The default size is one byte for memory locations, and the size of the object for variables.

If cmds is specified, the given commands will be executed each time the hardware breakpoint is hit.

If delete=num is specified, then hardware breakpoint num is deleted. Use hardbrk to get breakpoint numbers.

An error message appears if the target system cannot support the requested breakpoint.

For example:

hardbrk read val

Stops on any read from variable val.

hardbrk mask=0xf 0x10000

Stops on any read or write to locations 0x10000 to 0x1000f.

hardbrk write *string:9

Stops on any write to the first nine bytes pointed by string.

hardbrk delete=2

Deletes breakpoint number two.

hardbrk val {"stopped on val ";c}

Prints stopped on val in the command window any time the variable val is accessed.

hardbrk execute 0x100ff

Stops anytime when the instruction at address 0x100ff is executed.


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.