From 2117c711ae07700adb57ea5b5ca61e4c32d7e3d2 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 13 Jan 2014 09:30:30 -0700 Subject: change delegation for to_read_description This switches to_read_description to the "new normal" delegation scheme. This one was a bit trickier than the other changes due to the way that target_read_description handled delegation. I examined all the target implementations of to_read_description and changed the ones returning NULL to instead delegate. 2014-02-19 Tom Tromey * arm-linux-nat.c (arm_linux_read_description): Delegate when needed. * corelow.c (core_read_description): Delegate when needed. * remote.c (remote_read_description): Delegate when needed. * target-delegates.c: Rebuild. * target.c (target_read_description): Rewrite. * target.h (struct target_ops) : Update comment. Use TARGET_DEFAULT_RETURN. --- gdb/target.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'gdb/target.c') diff --git a/gdb/target.c b/gdb/target.c index 13b2e65..44387da 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -748,7 +748,6 @@ update_current_target (void) (int (*) (CORE_ADDR, gdb_byte *, int, int, struct mem_attrib *, struct target_ops *)) nomemory); - current_target.to_read_description = NULL; #undef de_fault @@ -2630,19 +2629,7 @@ target_mourn_inferior (void) const struct target_desc * target_read_description (struct target_ops *target) { - struct target_ops *t; - - for (t = target; t != NULL; t = t->beneath) - if (t->to_read_description != NULL) - { - const struct target_desc *tdesc; - - tdesc = t->to_read_description (t); - if (tdesc) - return tdesc; - } - - return NULL; + return target->to_read_description (target); } /* This implements a basic search of memory, reading target memory and -- cgit v1.1