diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2012-01-16 17:44:36 +0000 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2012-01-16 17:44:36 +0000 |
commit | 983af33b2623508a921372f02abee87aad9c8915 (patch) | |
tree | c8a2757e35a16b3253bb8630360a70b1f8ccdaf0 /gdb/breakpoint.h | |
parent | abcc497831b4dbb2e6cb16ca38baec1e68c93a6f (diff) | |
download | binutils-gdb-983af33b2623508a921372f02abee87aad9c8915.tar.gz |
2012-01-16 Sergio Durigan Junior <sergiodj@redhat.com>
* breakpoint.c (create_sals_from_address_default): New function.
(create_breakpoints_sal_default): Likewise.
(decode_linespec_default): Likewise.
(is_marker_spec): Removed.
(strace_marker_p): New function.
(init_breakpoint_sal): Using `strace_marker_p' instead of
`is_marker_spec'.
(create_breakpoint): Call method `create_sals_from_address' from
breakpoint_ops, replacing code that created SALs conditionally
on the type of the breakpoint. Call method `create_breakpoints_sal',
replacing code that created breakpoints conditionally on the type
wanted.
(base_breakpoint_create_sals_from_address): New function.
(base_breakpoint_create_breakpoints_sal): Likewise.
(base_breakpoint_decode_linespec): Likewise.
(base_breakpoint_ops): Add methods
`base_breakpoint_create_sals_from_address',
`base_breakpoint_create_breakpoints_sal' and
`base_breakpoint_decode_linespec'.
(bkpt_create_sals_from_address): New function.
(bkpt_create_breakpoints_sal): Likewise.
(bkpt_decode_linespec): Likewise.
(tracepoint_create_sals_from_address): Likewise.
(tracepoint_create_breakpoints_sal): Likewise.
(tracepoint_decode_linespec): Likewise.
(strace_marker_create_sals_from_address): Likewise.
(strace_marker_create_breakpoints_sal): Likewise.
(strace_marker_decode_linespec): Likewise.
(strace_marker_breakpoint_ops): New variable.
(addr_string_to_sals): Remove `marker_spec'. Call method
`decode_linespec' from breakpoint_ops, replacing code that decoded
an address string into a SAL. Use `strace_marker_p' instead of
`marker_spec'.
(strace_command): Decide whether we are dealing with a static
tracepoint with marker or not. Use the appropriate breakpoint_ops.
(initialize_breakpoint_ops): Initialize new fields of breakpoint_ops.
* breakpoint.h (linespec_result, linespec_sals): New forward
declarations.
(breakpoint_ops) <create_sals_from_address>,
<create_breakpoints_sal>, <decode_linespec>: New methods.
Diffstat (limited to 'gdb/breakpoint.h')
-rw-r--r-- | gdb/breakpoint.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index c1d3be9b611..8a8d5f27b79 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -30,6 +30,8 @@ struct get_number_or_range_state; struct thread_info; struct bpstats; struct bp_location; +struct linespec_result; +struct linespec_sals; /* This is the maximum number of bytes a breakpoint instruction can take. Feel free to increase it. It's just used in a few places to @@ -482,6 +484,37 @@ struct breakpoint_ops /* Print to FP the CLI command that recreates this breakpoint. */ void (*print_recreate) (struct breakpoint *, struct ui_file *fp); + + /* Create SALs from address string, storing the result in linespec_result. + + For an explanation about the arguments, see the function + `create_sals_from_address_default'. + + This function is called inside `create_breakpoint'. */ + void (*create_sals_from_address) (char **, struct linespec_result *, + enum bptype, char *, char **); + + /* This method will be responsible for creating a breakpoint given its SALs. + Usually, it just calls `create_breakpoints_sal' (for ordinary + breakpoints). However, there may be some special cases where we might + need to do some tweaks, e.g., see + `strace_marker_create_breakpoints_sal'. + + This function is called inside `create_breakpoint'. */ + void (*create_breakpoints_sal) (struct gdbarch *, + struct linespec_result *, + struct linespec_sals *, char *, + enum bptype, enum bpdisp, int, int, + int, const struct breakpoint_ops *, + int, int, int); + + /* Given the address string (second parameter), this method decodes it + and provides the SAL locations related to it. For ordinary breakpoints, + it calls `decode_line_full'. + + This function is called inside `addr_string_to_sals'. */ + void (*decode_linespec) (struct breakpoint *, char **, + struct symtabs_and_lines *); }; /* Helper for breakpoint_ops->print_recreate implementations. Prints |