VIRTUTECH CONFIDENTIAL    Previous - Up - Next

breakpoint

Implemented By
context, memory-space
Description

The breakpoint interface are implemented by any object who supports breaking on an address range.

typedef void (*insert_bp_func_t)
        (conf_object_t *object, breakpoint_t *bp, 
         generic_address_t start, generic_address_t end);
typedef void (*remove_bp_func_t)
        (conf_object_t *object, breakpoint_t *bp);
typedef void (*remove_bp_range_func_t)
        (conf_object_t *object, breakpoint_id_t bp_id,
         access_t access, 
         generic_address_t start, generic_address_t end);
typedef breakpoint_range_t *(*get_bp_ranges_func_t)
        (conf_object_t *object, 
         breakpoint_t *bp);
typedef breakpoint_vector_t (*get_bp_func_t)
        (conf_object_t *object, 
         access_t access, 
         breakpoint_kind_t type, 
         generic_address_t start, 
         generic_address_t end);

struct breakpoint_interface {
        insert_bp_func_t       insert_breakpoint;
        remove_bp_func_t       remove_breakpoint;
        remove_bp_range_func_t remove_breakpoint_range;
        get_bp_ranges_func_t   get_breakpoint_ranges;
        get_bp_func_t          get_breakpoints;
};

#define BREAKPOINT_INTERFACE "breakpoint"

Most functions in the interface get the object and the bp arguments as in-parameters. Object is the object implementing this interface and bp is a structure that is used to identify the breakpoint. bp is of type breakpoint_t and is declared like this:

typedef struct breakpoint breakpoint_t;

insert_breakpoint are called when a breakpoint is added on the object. This can be done with the break command or with the SIM_breakpoint API function.

remove_breakpoint should remove the breakpoint and further accesses to the address range should not stop the simulation.

remove_breakpoint_range is called when a range should be removed from a breakpoint. It is thus possible to create holes in the range. See SIM_breakpoint_remove. access is what kind of accesses should be removed. See SIM_breakpoint for a description of the access parameter.

get_breakpoint_ranges should return a list of ranges currently set. breakpoint_range_t is declared like this:

typedef struct breakpoint_range breakpoint_range_t;
struct breakpoint_range {
        generic_address_t          lower;
        generic_address_t          upper;
        struct breakpoint_range   *next;
};

get_breakpoints should return a vector of breakpoints set on the object matching access and type. See SIM_breakpoint for a description of access and type. breakpoint_vector_t is declared like this:

typedef struct {
        int             size;
        breakpoint_t  **vector;
} breakpoint_vector_t;

Command List
breakset breakpoint
tbreakset temporary breakpoint on current processor

Command Descriptions

<breakpoint>.break
Synopsis
<breakpoint>.break address [length] [-r] [-w] [-x]
<breakpoint>.tbreak address [length] [-r] [-w] [-x]
break address [length] [-r] [-w] [-x]
Description
Add breakpoint (read, write, or execute) on an object implementing the breakpoint interface. This is typically a memory space object such as physical memory; e.g., phys_mem0.break 0xff3800. Accesses intersecting the given range will trigger the breakpoint. By default the breakpoint will only trigger for instruction execution, but any subset of read, write, and execute accesses can be set to trigger using combinations of -r, -w, and -x.

length is the interval length in bytes (default is 1).

Breakpoints inserted with the tbreak command are automatically disabled when they have triggered.

The default action at a triggered breakpoint is to return to the frontend. This can be changed by using haps. When an execution breakpoint is triggered, Simics will return to the command prompt before the instructions is executed, while instructions triggering read or write breakpoints will complete before control is returned to the command prompt.

To break on a virtual address, use a context object:

primary_context.break 0x1ff00

Several breakpoints can be set on the same address and Simics will break on them in turn. If hap handlers (callback functions) are connected to the breakpoints they will also be executed in turn. Hap handlers are called before the access is performed, allowing the user to read a memory value that may be overwritten by the access. See the Simics Reference Manual for a description of hap handlers.

Each breakpoint is associated with an id (printed when the breakpoint is set or by the list-breakpoints command) which is used for further references to the breakpoint.

For convenience there are also a break command which sets a breakpoint on memory connected to the current frontend CPU (see pselect). Default is to break on virtual address accesses (in the current context). By prefixing the address with p: it is possible to break on physical accesses as well (cf. phys_mem0.break); e.g., break p:0xffc0.

Several attributes can be set for a breakpoint for breaking only when some conditions are true. See the disable, enable, ignore, set-prefix, set-substr and set-pattern commands for more details.

Breakpoints can be removed using delete.

See Also
unbreak, delete, enable, ignore, set-prefix, set-substr, set-pattern, list-breakpoints
<breakpoint>.tbreak
Synopsis
<breakpoint>.tbreak address [length] [-r] [-w] [-x]
<breakpoint>.break address [length] [-r] [-w] [-x]
break address [length] [-r] [-w] [-x]
Description
Add breakpoint (read, write, or execute) on an object implementing the breakpoint interface. This is typically a memory space object such as physical memory; e.g., phys_mem0.break 0xff3800. Accesses intersecting the given range will trigger the breakpoint. By default the breakpoint will only trigger for instruction execution, but any subset of read, write, and execute accesses can be set to trigger using combinations of -r, -w, and -x.

length is the interval length in bytes (default is 1).

Breakpoints inserted with the tbreak command are automatically disabled when they have triggered.

The default action at a triggered breakpoint is to return to the frontend. This can be changed by using haps. When an execution breakpoint is triggered, Simics will return to the command prompt before the instructions is executed, while instructions triggering read or write breakpoints will complete before control is returned to the command prompt.

To break on a virtual address, use a context object:

primary_context.break 0x1ff00

Several breakpoints can be set on the same address and Simics will break on them in turn. If hap handlers (callback functions) are connected to the breakpoints they will also be executed in turn. Hap handlers are called before the access is performed, allowing the user to read a memory value that may be overwritten by the access. See the Simics Reference Manual for a description of hap handlers.

Each breakpoint is associated with an id (printed when the breakpoint is set or by the list-breakpoints command) which is used for further references to the breakpoint.

For convenience there are also a break command which sets a breakpoint on memory connected to the current frontend CPU (see pselect). Default is to break on virtual address accesses (in the current context). By prefixing the address with p: it is possible to break on physical accesses as well (cf. phys_mem0.break); e.g., break p:0xffc0.

Several attributes can be set for a breakpoint for breaking only when some conditions are true. See the disable, enable, ignore, set-prefix, set-substr and set-pattern commands for more details.

Breakpoints can be removed using delete.

See Also
unbreak, delete, enable, ignore, set-prefix, set-substr, set-pattern, list-breakpoints

VIRTUTECH CONFIDENTIAL    Previous - Up - Next