diff options
author | Tom Tromey <tromey@redhat.com> | 2013-12-18 09:42:24 -0700 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-02-19 07:47:02 -0700 |
commit | bebd3233bfe1e95ba46c1dad413c8aba623a4449 (patch) | |
tree | 1b83fa607837e651e7ab2f08647e6507c513f780 | |
parent | a53f36250ea71db7b4968020e2284dc0488a4ce8 (diff) | |
download | gdb-bebd3233bfe1e95ba46c1dad413c8aba623a4449.zip gdb-bebd3233bfe1e95ba46c1dad413c8aba623a4449.tar.gz gdb-bebd3233bfe1e95ba46c1dad413c8aba623a4449.tar.bz2 |
convert to_post_attach
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_post_attach.
* target.h (struct target_ops) <to_post_attach>: Use
TARGET_DEFAULT_IGNORE.
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/target-delegates.c | 15 | ||||
-rw-r--r-- | gdb/target.c | 5 | ||||
-rw-r--r-- | gdb/target.h | 3 |
4 files changed, 26 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0ccd337..a197e9b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -2,6 +2,14 @@ * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default + to_post_attach. + * target.h (struct target_ops) <to_post_attach>: Use + TARGET_DEFAULT_IGNORE. + +2014-02-19 Tom Tromey <tromey@redhat.com> + + * target-delegates.c: Rebuild. + * target.c (update_current_target): Don't inherit or default to_rcmd. (default_rcmd): New function. (do_monitor_command): Unconditionally delegate. diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index b2547c0..0c30afa 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -11,6 +11,18 @@ delegate_attach (struct target_ops *self, char *arg1, int arg2) } static void +delegate_post_attach (struct target_ops *self, int arg1) +{ + self = self->beneath; + self->to_post_attach (self, arg1); +} + +static void +tdefault_post_attach (struct target_ops *self, int arg1) +{ +} + +static void delegate_detach (struct target_ops *self, const char *arg1, int arg2) { self = self->beneath; @@ -166,6 +178,8 @@ install_delegators (struct target_ops *ops) { if (ops->to_attach == NULL) ops->to_attach = delegate_attach; + if (ops->to_post_attach == NULL) + ops->to_post_attach = delegate_post_attach; if (ops->to_detach == NULL) ops->to_detach = delegate_detach; if (ops->to_resume == NULL) @@ -200,6 +214,7 @@ static void install_dummy_methods (struct target_ops *ops) { ops->to_attach = find_default_attach; + ops->to_post_attach = tdefault_post_attach; ops->to_detach = tdefault_detach; ops->to_resume = tdefault_resume; ops->to_wait = tdefault_wait; diff --git a/gdb/target.c b/gdb/target.c index 3782e7c..ef961e3 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -591,7 +591,7 @@ update_current_target (void) /* Do not inherit to_open. */ /* Do not inherit to_close. */ /* Do not inherit to_attach. */ - INHERIT (to_post_attach, t); + /* Do not inherit to_post_attach. */ INHERIT (to_attach_no_wait, t); /* Do not inherit to_detach. */ /* Do not inherit to_disconnect. */ @@ -730,9 +730,6 @@ update_current_target (void) de_fault (to_close, (void (*) (struct target_ops *)) target_ignore); - de_fault (to_post_attach, - (void (*) (struct target_ops *, int)) - target_ignore); de_fault (to_prepare_to_store, (void (*) (struct target_ops *, struct regcache *)) noprocess); diff --git a/gdb/target.h b/gdb/target.h index bd33b4c..c35b9e3 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -405,7 +405,8 @@ struct target_ops void (*to_close) (struct target_ops *); void (*to_attach) (struct target_ops *ops, char *, int) TARGET_DEFAULT_FUNC (find_default_attach); - void (*to_post_attach) (struct target_ops *, int); + void (*to_post_attach) (struct target_ops *, int) + TARGET_DEFAULT_IGNORE (); void (*to_detach) (struct target_ops *ops, const char *, int) TARGET_DEFAULT_IGNORE (); void (*to_disconnect) (struct target_ops *, char *, int); |