aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-18 09:47:18 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:47:03 -0700
commit6c628163866f1d34561472c32a18a17cadf37a51 (patch)
treeb96aacd15a34fb37535f67892914004040ed64de
parentbebd3233bfe1e95ba46c1dad413c8aba623a4449 (diff)
downloadgdb-6c628163866f1d34561472c32a18a17cadf37a51.zip
gdb-6c628163866f1d34561472c32a18a17cadf37a51.tar.gz
gdb-6c628163866f1d34561472c32a18a17cadf37a51.tar.bz2
convert to_prepare_to_store
2014-02-19 Tom Tromey <tromey@redhat.com> * target-delegates.c: Rebuild. * target.c (update_current_target): Don't inherit or default to_store. * target.h (struct target_ops) <to_store>: Use TARGET_DEFAULT_NORETURN.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/target-delegates.c16
-rw-r--r--gdb/target.c5
-rw-r--r--gdb/target.h3
4 files changed, 27 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a197e9b..9a2ff8c 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_store.
+ * target.h (struct target_ops) <to_store>: Use
+ TARGET_DEFAULT_NORETURN.
+
+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.
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index 0c30afa..3f1ec9b 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -73,6 +73,19 @@ tdefault_store_registers (struct target_ops *self, struct regcache *arg1, int ar
noprocess ();
}
+static void
+delegate_prepare_to_store (struct target_ops *self, struct regcache *arg1)
+{
+ self = self->beneath;
+ self->to_prepare_to_store (self, arg1);
+}
+
+static void
+tdefault_prepare_to_store (struct target_ops *self, struct regcache *arg1)
+{
+ noprocess ();
+}
+
static int
delegate_insert_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
{
@@ -188,6 +201,8 @@ install_delegators (struct target_ops *ops)
ops->to_wait = delegate_wait;
if (ops->to_store_registers == NULL)
ops->to_store_registers = delegate_store_registers;
+ if (ops->to_prepare_to_store == NULL)
+ ops->to_prepare_to_store = delegate_prepare_to_store;
if (ops->to_insert_breakpoint == NULL)
ops->to_insert_breakpoint = delegate_insert_breakpoint;
if (ops->to_remove_breakpoint == NULL)
@@ -219,6 +234,7 @@ install_dummy_methods (struct target_ops *ops)
ops->to_resume = tdefault_resume;
ops->to_wait = tdefault_wait;
ops->to_store_registers = tdefault_store_registers;
+ ops->to_prepare_to_store = tdefault_prepare_to_store;
ops->to_insert_breakpoint = memory_insert_breakpoint;
ops->to_remove_breakpoint = memory_remove_breakpoint;
ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint;
diff --git a/gdb/target.c b/gdb/target.c
index ef961e3..05b307d 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -599,7 +599,7 @@ update_current_target (void)
/* Do not inherit to_wait. */
/* Do not inherit to_fetch_registers. */
/* Do not inherit to_store_registers. */
- INHERIT (to_prepare_to_store, t);
+ /* Do not inherit to_prepare_to_store. */
INHERIT (deprecated_xfer_memory, t);
INHERIT (to_files_info, t);
/* Do not inherit to_insert_breakpoint. */
@@ -730,9 +730,6 @@ update_current_target (void)
de_fault (to_close,
(void (*) (struct target_ops *))
target_ignore);
- de_fault (to_prepare_to_store,
- (void (*) (struct target_ops *, struct regcache *))
- noprocess);
de_fault (deprecated_xfer_memory,
(int (*) (CORE_ADDR, gdb_byte *, int, int,
struct mem_attrib *, struct target_ops *))
diff --git a/gdb/target.h b/gdb/target.h
index c35b9e3..4b476aa 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -418,7 +418,8 @@ struct target_ops
void (*to_fetch_registers) (struct target_ops *, struct regcache *, int);
void (*to_store_registers) (struct target_ops *, struct regcache *, int)
TARGET_DEFAULT_NORETURN (noprocess ());
- void (*to_prepare_to_store) (struct target_ops *, struct regcache *);
+ void (*to_prepare_to_store) (struct target_ops *, struct regcache *)
+ TARGET_DEFAULT_NORETURN (noprocess ());
/* Transfer LEN bytes of memory between GDB address MYADDR and
target address MEMADDR. If WRITE, transfer them to the target, else