]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
convert to_get_bookmark
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 18:10:32 +0000 (11:10 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:47:33 +0000 (07:47 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target-delegates.c: Rebuild.
* target.c (update_current_target): Don't inherit or default
to_get_bookmark.
(dummy_get_bookmark): Remove.
(init_dummy_target): Don't inherit or default to_get_bookmark.
* target.h (struct target_ops) <to_get_bookmark>: Use
TARGET_DEFAULT_NORETURN

gdb/ChangeLog
gdb/target-delegates.c
gdb/target.c
gdb/target.h

index 23d5c3bba3ef5a66dace158d06b9e38f8dfade30..3528a4ede4bd4999f6a7d903177c896599b1d425 100644 (file)
@@ -1,3 +1,13 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target-delegates.c: Rebuild.
+       * target.c (update_current_target): Don't inherit or default
+       to_get_bookmark.
+       (dummy_get_bookmark): Remove.
+       (init_dummy_target): Don't inherit or default to_get_bookmark.
+       * target.h (struct target_ops) <to_get_bookmark>: Use
+       TARGET_DEFAULT_NORETURN
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target-delegates.c: Rebuild.
index 33bb3291a4ed3b08309e94b9d385c8e08264665a..7d8878a2bf0f6858eb54c6b3dc01e540159f00f8 100644 (file)
@@ -525,6 +525,19 @@ delegate_make_corefile_notes (struct target_ops *self, bfd *arg1, int *arg2)
   return self->to_make_corefile_notes (self, arg1, arg2);
 }
 
+static gdb_byte * 
+delegate_get_bookmark (struct target_ops *self, char *arg1, int arg2)
+{
+  self = self->beneath;
+  return self->to_get_bookmark (self, arg1, arg2);
+}
+
+static gdb_byte * 
+tdefault_get_bookmark (struct target_ops *self, char *arg1, int arg2)
+{
+  tcomplain ();
+}
+
 static enum target_xfer_status 
 delegate_xfer_partial (struct target_ops *self, enum target_object  arg1, const char *arg2, gdb_byte *arg3, const gdb_byte *arg4, ULONGEST arg5, ULONGEST arg6, ULONGEST *arg7)
 {
@@ -646,6 +659,8 @@ install_delegators (struct target_ops *ops)
     ops->to_find_memory_regions = delegate_find_memory_regions;
   if (ops->to_make_corefile_notes == NULL)
     ops->to_make_corefile_notes = delegate_make_corefile_notes;
+  if (ops->to_get_bookmark == NULL)
+    ops->to_get_bookmark = delegate_get_bookmark;
   if (ops->to_xfer_partial == NULL)
     ops->to_xfer_partial = delegate_xfer_partial;
   if (ops->to_supports_btrace == NULL)
@@ -701,6 +716,7 @@ install_dummy_methods (struct target_ops *ops)
   ops->to_async = tdefault_async;
   ops->to_find_memory_regions = dummy_find_memory_regions;
   ops->to_make_corefile_notes = dummy_make_corefile_notes;
+  ops->to_get_bookmark = tdefault_get_bookmark;
   ops->to_xfer_partial = tdefault_xfer_partial;
   ops->to_supports_btrace = tdefault_supports_btrace;
 }
index 911c49750435c4d5498547e2a61baf707781354c..1218e4ffbe85bd89b66ef571459c99ffb077feca 100644 (file)
@@ -670,7 +670,7 @@ update_current_target (void)
       /* Do not inherit to_async.  */
       /* Do not inherit to_find_memory_regions.  */
       /* Do not inherit to_make_corefile_notes.  */
-      INHERIT (to_get_bookmark, t);
+      /* Do not inherit to_get_bookmark.  */
       INHERIT (to_goto_bookmark, t);
       /* Do not inherit to_get_thread_local_address.  */
       INHERIT (to_can_execute_reverse, t);
@@ -3680,14 +3680,6 @@ dummy_make_corefile_notes (struct target_ops *self,
   return NULL;
 }
 
-/* Error-catcher for target_get_bookmark.  */
-static gdb_byte *
-dummy_get_bookmark (struct target_ops *self, char *ignore1, int ignore2)
-{
-  tcomplain ();
-  return NULL;
-}
-
 /* Error-catcher for target_goto_bookmark.  */
 static void
 dummy_goto_bookmark (struct target_ops *self, gdb_byte *ignore, int from_tty)
@@ -3710,7 +3702,6 @@ init_dummy_target (void)
     = find_default_supports_disable_randomization;
   dummy_target.to_pid_to_str = dummy_pid_to_str;
   dummy_target.to_stratum = dummy_stratum;
-  dummy_target.to_get_bookmark = dummy_get_bookmark;
   dummy_target.to_goto_bookmark = dummy_goto_bookmark;
   dummy_target.to_has_all_memory = (int (*) (struct target_ops *)) return_zero;
   dummy_target.to_has_memory = (int (*) (struct target_ops *)) return_zero;
index 26a95bc9555ab928364cd25dd0f345ad94a4d0f2..0fb7d8eefbe26f373aeed68b4d60444429db66e2 100644 (file)
@@ -588,7 +588,8 @@ struct target_ops
     char * (*to_make_corefile_notes) (struct target_ops *, bfd *, int *)
       TARGET_DEFAULT_FUNC (dummy_make_corefile_notes);
     /* get_bookmark support method for bookmarks */
-    gdb_byte * (*to_get_bookmark) (struct target_ops *, char *, int);
+    gdb_byte * (*to_get_bookmark) (struct target_ops *, char *, int)
+      TARGET_DEFAULT_NORETURN (tcomplain ());
     /* goto_bookmark support method for bookmarks */
     void (*to_goto_bookmark) (struct target_ops *, gdb_byte *, int);
     /* Return the thread-local address at OFFSET in the