aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-19 09:38:11 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:45:24 -0700
commit1101cb7b3b05d857c8bccc848bc5664155c82730 (patch)
treef54054788d6d3a1b0faf099ea9c109feb775e9e7 /gdb/target.c
parent8b06beed0f0eb221067a1013add2efd159a36ade (diff)
downloadgdb-1101cb7b3b05d857c8bccc848bc5664155c82730.zip
gdb-1101cb7b3b05d857c8bccc848bc5664155c82730.tar.gz
gdb-1101cb7b3b05d857c8bccc848bc5664155c82730.tar.bz2
add make-target-delegates
This patch adds a new script, call make-target-delegates, which auto-generates some target delegation code based on annotations in target.h. This adds the new delegation macros, the new generated file, and adds the necessary calls to the new generated functions to target.c. It doesn't, however, add any actual annotations to the target methods, leaving these for separate patches. 2014-02-19 Tom Tromey <tromey@redhat.com> PR build/7701: * target-delegates.c: New file. * target.c: Include target-delegates.c. (init_dummy_target): Call install_dummy_methods. (complete_target_initialization): Call install_delegators. * target.h (TARGET_DEFAULT_IGNORE, TARGET_DEFAULT_NORETURN) (TARGET_DEFAULT_RETURN, TARGET_DEFAULT_FUNC): New defines. * make-target-delegates: New file.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 75f7506..9643b5e 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -79,6 +79,8 @@ static target_xfer_partial_ftype current_xfer_partial;
static struct gdbarch *default_thread_architecture (struct target_ops *ops,
ptid_t ptid);
+#include "target-delegates.c"
+
static void init_dummy_target (void);
static struct target_ops debug_target;
@@ -353,6 +355,8 @@ complete_target_initialization (struct target_ops *t)
if (t->to_has_execution == NULL)
t->to_has_execution = (int (*) (struct target_ops *, ptid_t)) return_zero;
+
+ install_delegators (t);
}
/* Add possible target architecture T to the list and add a new
@@ -560,6 +564,9 @@ update_current_target (void)
/* First, reset current's contents. */
memset (&current_target, 0, sizeof (current_target));
+ /* Install the delegators. */
+ install_delegators (&current_target);
+
#define INHERIT(FIELD, TARGET) \
if (!current_target.FIELD) \
current_target.FIELD = (TARGET)->FIELD
@@ -3883,6 +3890,8 @@ init_dummy_target (void)
dummy_target.to_stopped_data_address =
(int (*) (struct target_ops *, CORE_ADDR *)) return_zero;
dummy_target.to_magic = OPS_MAGIC;
+
+ install_dummy_methods (&dummy_target);
}
static void