diff options
author | Luis Machado <luisgpm@br.ibm.com> | 2012-02-24 15:10:59 +0000 |
---|---|---|
committer | Luis Machado <luisgpm@br.ibm.com> | 2012-02-24 15:10:59 +0000 |
commit | b775012e845380ed4c7421a1b87caf7bfae39f5f (patch) | |
tree | ac2f84dfcd17de662a5608d8c8dd707c9567f8c7 /gdb/breakpoint.h | |
parent | 3788aec75a91b4b6e10255f20aaa649ddbfdf78c (diff) | |
download | fsf-binutils-gdb-b775012e845380ed4c7421a1b87caf7bfae39f5f.zip fsf-binutils-gdb-b775012e845380ed4c7421a1b87caf7bfae39f5f.tar.gz fsf-binutils-gdb-b775012e845380ed4c7421a1b87caf7bfae39f5f.tar.bz2 |
2012-02-24 Luis Machado <lgustavo@codesourcery.com>
* remote.c (remote_supports_cond_breakpoints): New forward
declaration.
(remote_add_target_side_condition): New function.
(remote_insert_breakpoint): Add target-side breakpoint
conditional if supported.
(remote_insert_hw_breakpoint): Likewise.
(init_remote_ops): Set to_supports_evaluation_of_breakpoint_conditions
hook.
* target.c (update_current_target): Inherit
to_supports_evaluation_of_breakpoint_conditions.
Default to_supports_evaluation_of_breakpoint_conditions to return_zero.
* target.h (struct target_ops)
<to_supports_evaluation_of_breakpoint_conditions>: New field.
(target_supports_evaluation_of_breakpoint_conditions): New #define.
* breakpoint.c (get_first_locp_gte_addr): New forward declaration.
(condition_evaluation_both, condition_evaluation_auto,
condition_evaluation_host, condition_evaluation_target,
condition_evaluation_enums, condition_evaluation_mode_1,
condition_evaluation_mode): New static globals.
(translate_condition_evaluation_mode): New function.
(breakpoint_condition_evaluation_mode): New function.
(gdb_evaluates_breakpoint_condition_p): New function.
(ALL_BP_LOCATIONS_AT_ADDR): New helper macro.
(mark_breakpoint_modified): New function.
(mark_breakpoint_location_modified): New function.
(set_condition_evaluation_mode): New function.
(show_condition_evaluation_mode): New function.
(bp_location_compare_addrs): New function.
(get_first_location_gte_addr): New helper function.
(set_breakpoint_condition): Free condition bytecode if locations
has become unconditional. Call mark_breakpoint_modified (...).
(condition_command): Call update_global_location_list (1) for
breakpoints.
(breakpoint_xfer_memory): Use is_breakpoint (...).
(is_breakpoint): New function.
(parse_cond_to_aexpr): New function.
(build_target_condition_list): New function.
(insert_bp_location): Handle target-side conditional
breakpoints and call build_target_condition_list (...).
(update_inserted_breakpoint_locations): New function.
(insert_breakpoint_locations): Handle target-side conditional
breakpoints.
(bpstat_check_breakpoint_conditions): Add comment.
(bp_condition_evaluator): New function.
(bp_location_condition_evaluator): New function.
(print_breakpoint_location): Print information on where the condition
will be evaluated.
(print_one_breakpoint_location): Likewise.
(init_bp_location): Call mark_breakpoint_location_modified (...) for
breakpoint location.
(force_breakpoint_reinsertion): New functions.
(update_global_location_list): Handle target-side breakpoint
conditions.
Reinsert locations that are already inserted if conditions have
changed.
(bp_location_dtor): Free agent expression bytecode.
(disable_breakpoint): Call mark_breakpoint_modified (...).
Call update_global_location_list (...) with parameter 1 for breakpoints.
(disable_command): Call mark_breakpoint_location_modified (...).
Call update_global_location_list (...) with parameter 1 for breakpoints.
(enable_breakpoint_disp): Call mark_breakpoint_modified (...).
(enable_command): mark_breakpoint_location_modified (...).
(_initialize_breakpoint): Update documentation and add
condition-evaluation breakpoint subcommand.
* breakpoint.h: Include ax.h.
(condition_list): New data structure.
(condition_status): New enum.
(bp_target_info) <cond_list>: New field.
(bp_location) <condition_changed, cond_bytecode>: New fields.
(is_breakpoint): New prototype.
Diffstat (limited to 'gdb/breakpoint.h')
-rw-r--r-- | gdb/breakpoint.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 07e3fc9..7e8c597 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -22,6 +22,7 @@ #include "frame.h" #include "value.h" #include "vec.h" +#include "ax.h" struct value; struct block; @@ -215,6 +216,16 @@ enum target_hw_bp_type }; +/* Status of breakpoint conditions used when synchronizing + conditions with the target. */ + +enum condition_status + { + condition_unchanged = 0, + condition_modified, + condition_updated + }; + /* Information used by targets to insert and remove breakpoints. */ struct bp_target_info @@ -249,6 +260,10 @@ struct bp_target_info (e.g. if a remote stub handled the details). We may still need the size to remove the breakpoint safely. */ int placed_size; + + /* Vector of conditions the target should evaluate if it supports target-side + breakpoint conditions. */ + VEC(agent_expr_p) *conditions; }; /* GDB maintains two types of information about each breakpoint (or @@ -315,6 +330,30 @@ struct bp_location the owner breakpoint object. */ struct expression *cond; + /* Conditional expression in agent expression + bytecode form. This is used for stub-side breakpoint + condition evaluation. */ + struct agent_expr *cond_bytecode; + + /* Signals that the condition has changed since the last time + we updated the global location list. This means the condition + needs to be sent to the target again. This is used together + with target-side breakpoint conditions. + + condition_unchanged: It means there has been no condition changes. + + condition_modified: It means this location had its condition modified. + + condition_updated: It means we already marked all the locations that are + duplicates of this location and thus we don't need to call + force_breakpoint_reinsertion (...) for this location. */ + + enum condition_status condition_changed; + + /* Signals that breakpoint conditions need to be re-synched with the + target. This has no use other than target-side breakpoints. */ + char needs_update; + /* This location's address is in an unloaded solib, and so this location should not be inserted. It will be automatically enabled when that solib is loaded. */ @@ -726,6 +765,11 @@ struct watchpoint CORE_ADDR hw_wp_mask; }; +/* Return true if BPT is either a software breakpoint or a hardware + breakpoint. */ + +extern int is_breakpoint (const struct breakpoint *bpt); + /* Returns true if BPT is really a watchpoint. */ extern int is_watchpoint (const struct breakpoint *bpt); |