aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-18 14:52:02 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:48:17 -0700
commitf6fb29258bb410c212c7bcbc48fb1f715bfd3839 (patch)
tree29f6cbcf6f96ad1f808d22a7234e107025d99b67 /gdb
parente8a6c6ace9d2cc7fa94f8adb81aba5181f77442c (diff)
downloadgdb-f6fb29258bb410c212c7bcbc48fb1f715bfd3839.zip
gdb-f6fb29258bb410c212c7bcbc48fb1f715bfd3839.tar.gz
gdb-f6fb29258bb410c212c7bcbc48fb1f715bfd3839.tar.bz2
convert to_flash_done
2014-02-19 Tom Tromey <tromey@redhat.com> * target-delegates.c: Rebuild. * target.c (target_flash_done): Unconditionally delegate. * target.h (struct target_ops) <to_flash_done>: Use TARGET_DEFAULT_NORETURN.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/target-delegates.c16
-rw-r--r--gdb/target.c15
-rw-r--r--gdb/target.h3
4 files changed, 28 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f15d678..56e62e0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,13 @@
2014-02-19 Tom Tromey <tromey@redhat.com>
* target-delegates.c: Rebuild.
+ * target.c (target_flash_done): Unconditionally delegate.
+ * target.h (struct target_ops) <to_flash_done>: Use
+ TARGET_DEFAULT_NORETURN.
+
+2014-02-19 Tom Tromey <tromey@redhat.com>
+
+ * target-delegates.c: Rebuild.
* target.c (target_flash_erase): Unconditionally delegate.
* target.h (struct target_ops) <to_flash_erase>: Use
TARGET_DEFAULT_NORETURN.
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index c5fe013..94117b8 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -736,6 +736,19 @@ tdefault_flash_erase (struct target_ops *self, ULONGEST arg1, LONGEST arg2)
tcomplain ();
}
+static void
+delegate_flash_done (struct target_ops *self)
+{
+ self = self->beneath;
+ self->to_flash_done (self);
+}
+
+static void
+tdefault_flash_done (struct target_ops *self)
+{
+ tcomplain ();
+}
+
static ptid_t
delegate_get_ada_task_ptid (struct target_ops *self, long arg1, long arg2)
{
@@ -1365,6 +1378,8 @@ install_delegators (struct target_ops *ops)
ops->to_xfer_partial = delegate_xfer_partial;
if (ops->to_flash_erase == NULL)
ops->to_flash_erase = delegate_flash_erase;
+ if (ops->to_flash_done == NULL)
+ ops->to_flash_done = delegate_flash_done;
if (ops->to_get_ada_task_ptid == NULL)
ops->to_get_ada_task_ptid = delegate_get_ada_task_ptid;
if (ops->to_can_execute_reverse == NULL)
@@ -1514,6 +1529,7 @@ install_dummy_methods (struct target_ops *ops)
ops->to_goto_bookmark = tdefault_goto_bookmark;
ops->to_xfer_partial = tdefault_xfer_partial;
ops->to_flash_erase = tdefault_flash_erase;
+ ops->to_flash_done = tdefault_flash_done;
ops->to_get_ada_task_ptid = default_get_ada_task_ptid;
ops->to_can_execute_reverse = tdefault_can_execute_reverse;
ops->to_execution_direction = default_execution_direction;
diff --git a/gdb/target.c b/gdb/target.c
index b208443..d96f706 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1766,18 +1766,9 @@ target_flash_erase (ULONGEST address, LONGEST length)
void
target_flash_done (void)
{
- struct target_ops *t;
-
- for (t = current_target.beneath; t != NULL; t = t->beneath)
- if (t->to_flash_done != NULL)
- {
- if (targetdebug)
- fprintf_unfiltered (gdb_stdlog, "target_flash_done\n");
- t->to_flash_done (t);
- return;
- }
-
- tcomplain ();
+ if (targetdebug)
+ fprintf_unfiltered (gdb_stdlog, "target_flash_done\n");
+ current_target.to_flash_done (&current_target);
}
static void
diff --git a/gdb/target.h b/gdb/target.h
index 17e3ed2..cb0bed2 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -683,7 +683,8 @@ struct target_ops
all flash memory should be available for writing and the result
of reading from areas written by 'to_flash_write' should be
equal to what was written. */
- void (*to_flash_done) (struct target_ops *);
+ void (*to_flash_done) (struct target_ops *)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
/* Describe the architecture-specific features of this target.
Returns the description found, or NULL if no description