This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC 00/32] clean up target delegation


Tom> I started implementing the easy bits but then I realized that the debug
Tom> target puts a wrinkle into this.  For instance, inheriting to_shortname
Tom> is needed when target debug is active.

I did go ahead and write the appended, which removes the calls that
truly aren't needed.

Tom

commit b15ac78fa8b7c50df3eae348871c0e0d2e231199
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Jan 15 12:58:50 2014 -0700

    remove some calls to INHERIT and de_fault
    
    This removes a few unnecessary calls to INHERIT and de_fault:
    
    * to_doc is only used when a target is registered
    * to_magic is only used when a target is pushed and not useful for
      current_target.
    * to_open and to_close are only ever called using a specific
      target_ops object; there is no need to de_fault them.
    
    2014-01-15  Tom Tromey  <tromey@redhat.com>
    
    	* target.c (update_current_target): Do not INHERIT to_doc or
    	to_magic.  Do not de_fault to_open or to_close.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7a1b817..f4c9923 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2014-01-15  Tom Tromey  <tromey@redhat.com>
 
+	* target.c (update_current_target): Do not INHERIT to_doc or
+	to_magic.  Do not de_fault to_open or to_close.
+
+2014-01-15  Tom Tromey  <tromey@redhat.com>
+
 	* gcore.h (objfile_find_memory_regions): Declare.
 	* gcore.c (objfile_find_memory_regions): No longer static.  Add
 	"self" argument.
diff --git a/gdb/target.c b/gdb/target.c
index 44e2490..f121e91 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -604,13 +604,11 @@ update_current_target (void)
     {
       INHERIT (to_shortname, t);
       INHERIT (to_longname, t);
-      INHERIT (to_doc, t);
       INHERIT (to_attach_no_wait, t);
       INHERIT (deprecated_xfer_memory, t);
       INHERIT (to_have_steppable_watchpoint, t);
       INHERIT (to_have_continuable_watchpoint, t);
       INHERIT (to_has_thread_control, t);
-      INHERIT (to_magic, t);
     }
 #undef INHERIT
 
@@ -622,12 +620,6 @@ update_current_target (void)
   if (!current_target.field)               \
     current_target.field = value
 
-  de_fault (to_open,
-	    (void (*) (char *, int))
-	    tcomplain);
-  de_fault (to_close,
-	    (void (*) (struct target_ops *))
-	    target_ignore);
   de_fault (deprecated_xfer_memory,
 	    (int (*) (CORE_ADDR, gdb_byte *, int, int,
 		      struct mem_attrib *, struct target_ops *))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]