diff options
author | Paul Koning <paul_koning@dell.com> | 2015-10-26 15:26:16 -0400 |
---|---|---|
committer | Paul Koning <paul_koning@dell.com> | 2015-10-26 15:26:16 -0400 |
commit | 357d8270b141ee35d60fc6e01d0a17b9cd9b45fa (patch) | |
tree | 915d16acce6289bdd501b9bb69c5cd4d763e6a6c /gdb/target.h | |
parent | 97bc1d4ffe48b9fa482c3c31667ceae1ba252717 (diff) | |
download | gdb-357d8270b141ee35d60fc6e01d0a17b9cd9b45fa.zip gdb-357d8270b141ee35d60fc6e01d0a17b9cd9b45fa.tar.gz gdb-357d8270b141ee35d60fc6e01d0a17b9cd9b45fa.tar.bz2 |
introduce the target stack
there's a huge hack in multi_target_compatible
2014-07-29 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* make-target-delegates (write_debugmethod): Update for change to
debug_target.
* progspace.c (add_program_space): Acquire a reference to the
target stack.
(release_program_space): Release reference to the program space.
(set_current_program_space): Set the target stack.
* progspace.h (struct program_space) <target_stack>: New field.
* target.c (target_ops_ptr): New typedef.
(struct target_stack): New.
(target_stack): Change type.
(current_target): Update comment.
(update_current_target): Update.
(multi_target_compatible, ensure_multi_target_ok): New functions.
(push_target): Update. Add multi-target check.
(unpush_target, pop_all_targets_above, target_is_pushed)
(target_info, target_require_runnable): Update.
(target_stack_set): New global.
(currently_multi_target, target_stack_incref, target_stack_decref)
(target_stack_set_current, new_target_stack): New functions.
(maintenance_print_target_stack): Update.
(initialize_targets): Initialize target_stack_set, target_stack.
Update.
(target_stack_id): New function.
(next_available_target_id): New global.
(print_one_target_stack): New function.
(maintenance_print_target_stack): Move earlier. Rewrite.
(debug_target): Remove.
(debug_to_open, setup_target_debug): Update.
* target.h (target_stack_incref, target_stack_decref)
(target_stack_set_current, new_target_stack, target_stack_id):
Declare.
* testsuite/gdb.base/auto-connect-native-target.exp: Update.
Diffstat (limited to 'gdb/target.h')
-rw-r--r-- | gdb/target.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h index e319271..78610bf 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -39,6 +39,7 @@ struct traceframe_info; struct expression; struct dcache_struct; struct inferior; +struct target_stack; #include "infrun.h" /* For enum exec_direction_kind. */ #include "breakpoint.h" /* For enum bptype. */ @@ -1256,6 +1257,28 @@ struct target_ops #define OPS_MAGIC 3840 +/* Acquire a reference to the target stack. */ + +extern struct target_stack *target_stack_incref (void); + +/* Release a reference to the target stack. */ + +extern void target_stack_decref (struct target_stack *); + +/* Set target_stack and current_target from TSTACK. */ + +extern void target_stack_set_current (struct target_stack *tstack); + +/* Create a new "empty" target stack and return it. The current + target stack is not changed. The new stack is initialized with a + single reference count, which is owned by the caller. */ + +extern struct target_stack *new_target_stack (void); + +/* Return the numeric identifier of the current target stack. */ + +extern int target_stack_id (void); + /* The ops structure for our "current" target process. This should never be NULL. If there is no target, it points to the dummy_target. */ |