]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-09-25 David Carlton <carlton@math.stanford.edu>
authorDavid Carlton <carlton@bactrian.org>
Thu, 26 Sep 2002 00:04:42 +0000 (00:04 +0000)
committerDavid Carlton <carlton@bactrian.org>
Thu, 26 Sep 2002 00:04:42 +0000 (00:04 +0000)
* dictionary.c: Commented what needs to be done to add stuff to
this file.
* dictionary.h: Expand on namespace_enum comment.
* Makefile.in (cris-tdep.o): Depend on gdb_string_h.
(mcore-tdep.o): Ditto.
(ns32k-tdep.o): Ditto.
(sh3-rom.o): Ditto.
(vax-tdep.o): Ditto.
* cris-tdep.c: #include "gdb_string.h"
* mcore-tdep.c: Ditto.
* ns32k-tdep.c: Ditto.
* sh3-rom.c: Ditto.
* vax-tdep.c: Ditto.

gdb/ChangeLog
gdb/Makefile.in
gdb/cris-tdep.c
gdb/dictionary.c
gdb/dictionary.h
gdb/mcore-tdep.c
gdb/ns32k-tdep.c
gdb/sh3-rom.c
gdb/vax-tdep.c

index bbe191b07c49db6caafa8834928b9ae3cfffada5..008a5ef5ceefc90508ac8ad2c9bdfef1cb20b9b4 100644 (file)
@@ -1,3 +1,19 @@
+2002-09-25  David Carlton  <carlton@math.stanford.edu>
+
+       * dictionary.c: Commented what needs to be done to add stuff to
+       this file.
+       * dictionary.h: Expand on namespace_enum comment.
+       * Makefile.in (cris-tdep.o): Depend on gdb_string_h.
+       (mcore-tdep.o): Ditto.
+       (ns32k-tdep.o): Ditto.
+       (sh3-rom.o): Ditto.
+       (vax-tdep.o): Ditto.
+       * cris-tdep.c: #include "gdb_string.h"
+       * mcore-tdep.c: Ditto.
+       * ns32k-tdep.c: Ditto.
+       * sh3-rom.c: Ditto.
+       * vax-tdep.c: Ditto.
+
 2002-09-24  David Carlton  <carlton@math.stanford.edu>
 
        * dictionary.c: Comment out block-specific stuff.
index 980d66f4774aea913d6bb6c73d373a9480a489a3..bcefadd7f89b99a7b5ee7acef38b7e5bf2531fd9 100644 (file)
@@ -1612,7 +1612,7 @@ cpu32bug-rom.o: cpu32bug-rom.c $(defs_h) $(gdbcore_h) $(target_h) \
 cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \
        $(gdbtypes_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(value_h) \
        $(opcode_cris_h) $(arch_utils_h) $(regcache_h) $(symfile_h) \
-       $(solib_h) $(solib_svr4_h)
+       $(solib_h) $(solib_svr4_h) $(gdb_string_h)
 # OBSOLETE cxux-nat.o: cxux-nat.c
 d10v-tdep.o: d10v-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \
        $(gdbcmd_h) $(gdbcore_h) $(gdb_string_h) $(value_h) $(inferior_h) \
@@ -1896,7 +1896,7 @@ mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
        $(gdb_string_h) $(regcache_h) $(serial_h)
 mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \
        $(gdbcmd_h) $(regcache_h) $(symfile_h) $(gdbcore_h) $(inferior_h) \
-       $(arch_utils_h)
+       $(arch_utils_h) $(gdb_string_h)
 mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
        $(symfile_h) $(objfiles_h) $(gdb_obstack_h) $(buildsym_h) \
        $(stabsread_h) $(complaints_h) $(demangle_h) $(gdb_assert_h) \
@@ -1949,7 +1949,7 @@ nlmread.o: nlmread.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \
        $(objfiles_h) $(buildsym_h) $(stabsread_h)
 ns32k-tdep.o: ns32k-tdep.c $(defs_h) $(frame_h) $(gdbtypes_h) $(gdbcore_h) \
        $(inferior_h) $(regcache_h) $(target_h) $(arch_utils_h) \
-       $(ns32k_tdep_h)
+       $(ns32k_tdep_h) $(gdb_string_h)
 ns32knbsd-nat.o: ns32knbsd-nat.c $(defs_h) $(inferior_h) $(target_h) \
        $(gdbcore_h) $(regcache_h)
 ns32knbsd-tdep.o: ns32knbsd-tdep.c $(defs_h) $(ns32k_tdep_h)
@@ -2127,7 +2127,8 @@ sh-tdep.o: sh-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(symfile_h) \
        $(regcache_h) $(doublest_h) $(sh_tdep_h) $(elf_bfd_h) \
        $(solib_svr4_h) $(elf_sh_h) $(gdb_sim_sh_h)
 sh3-rom.o: sh3-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
-       $(serial_h) $(srec_h) $(arch_utils_h) $(regcache_h) $(sh_tdep_h)
+       $(serial_h) $(srec_h) $(arch_utils_h) $(regcache_h) $(gdb_string_h) \
+       $(sh_tdep_h)
 shnbsd-nat.o: shnbsd-nat.c $(defs_h) $(inferior_h) $(shnbsd_tdep_h)
 shnbsd-tdep.o: shnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) $(value_h) \
        $(solib_svr4_h) $(nbsd_tdep_h) $(sh_tdep_h) $(shnbsd_tdep_h)
@@ -2276,7 +2277,7 @@ varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \
        $(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h)
 vax-tdep.o: vax-tdep.c $(defs_h) $(symtab_h) $(opcode_vax_h) $(gdbcore_h) \
        $(inferior_h) $(regcache_h) $(frame_h) $(value_h) $(arch_utils_h) \
-       $(vax_tdep_h)
+       $(gdb_string_h) $(vax_tdep_h)
 w89k-rom.o: w89k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
        $(serial_h) $(xmodem_h) $(regcache_h)
 win32-nat.o: win32-nat.c $(defs_h) $(tm_h) $(frame_h) $(inferior_h) \
index 0bfb5b32f6d22b6054189bc397a042caa486041f..5d64d43f1f6c432f8a014bdcfba83656459f9fb3 100644 (file)
@@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "solib.h"              /* Support for shared libraries. */
 #include "solib-svr4.h"         /* For struct link_map_offsets.  */
+#include "gdb_string.h"
 
 
 enum cris_num_regs
index b1c96f0bacdfbb4a6c83e5a47e59a53d1c0ec3ff..0e98be2fea91eb3bb6d2db492ee07dc157d32849 100644 (file)
 
    Each dictionary starts with a 'virtual function table' that
    contains the functions that actually implement the various
-   operations that dictionaries provide.  */
+   operations that dictionaries provide.
+
+   To add a new dictionary implementation <impl>, what you should do
+   is:
+
+   * Add a new element DICT_<IMPL> to dict_type.
+   
+   * Create a new structure dictionary_<impl>.  If your new
+   implementation is a variant of an existing one, make sure that
+   their structs have the same initial data members.  Define accessor
+   macros for your new data members.
+
+   * Implement all the functions in dict_vtbl as static functions,
+   whose name is the same as the corresponding member of dict_vtbl
+   plus _<impl>.  You don't have to do this for those members where
+   you can reuse existing generic functions
+   (e.g. add_symbol_nonexpandable, free_obstack) or in the case where
+   your new implementation is a variant of an existing implementation
+   and where the variant doesn't affect the member function in
+   question.
+
+   * Define a static const struct dict_vtbl dict_<impl>_vtbl.
+
+   * Define a function dict_create_<impl> to create these
+   gizmos.  Add its declaration to dictionary.h.
+
+   To add a new operation <op> on all existing implementations, what
+   you should do is:
+
+   * Add a new member <op> to struct dict_vtbl.
+
+   * If there is useful generic behavior <op>, define a static
+   function <op>_something_informative that implements that behavior.
+   (E.g. add_symbol_nonexpandable, free_obstack.)
+
+   * For every implementation <impl> that should have its own specific
+   behavior for <op>, define a static function <op>_<impl>
+   implementing it.
+
+   * Modify all existing dict_vtbl_<impl>'s to include the appropriate
+   member.
+
+   * Define a function dict_<op> that looks up <op> in the dict_vtbl
+   and calls the appropriate function.  Add a declaration for
+   dict_<op> to dictionary.h.
+   
+*/
 
 /* NOTE: carlton/2002-09-20: Originally, I'd had each dictionary start
    with a dict_type member, and had implemented the various functions
index c944c2f187c37e94baf8fe9e9b2b8b60a5b4790c..ea39922e429a0e8f8d1434b90d04b50d65f4cf1a 100644 (file)
@@ -23,7 +23,9 @@
 
 /* FIXME: carlton/2002-09-24: because of namespace_enum, you have to
    include symtab.h before including this file.  But I'm leaving in
-   opaque declarations as if that weren't true.  */
+   opaque declarations as if that weren't true.  (Probably the
+   'namespace' argument to dict_lookup should eventually be moved back
+   into lookup_block_symbol, I think.)  */
 
 /* An opaque type for dictionaries; only dictionary.c should know
    about its innards.  */
index 395bb44f8a691ee87c5be958dcfb08e7491b90ce..41114b44735be369415ffba3236cad4bc081cde3 100644 (file)
@@ -27,6 +27,7 @@
 #include "gdbcore.h"
 #include "inferior.h"
 #include "arch-utils.h"
+#include "gdb_string.h"
 
 /* Functions declared and used only in this file */
 
index 58c2e13c10c2b4f16ae2cc685381e0ea7dfa8d2f..e60b1c0ef364774c638b5174342e36908faefd36 100644 (file)
@@ -30,6 +30,7 @@
 #include "arch-utils.h"
 
 #include "ns32k-tdep.h"
+#include "gdb_string.h"
 
 static int sign_extend (int value, int bits);
 static CORE_ADDR ns32k_get_enter_addr (CORE_ADDR);
index f450ac9d5fcb0cd1f25dadfe1477603e5fe195a5..7d07fa53c801d4b5d9fad518afcdb791fbe5e2a7 100644 (file)
@@ -27,6 +27,7 @@
 #include "srec.h"
 #include "arch-utils.h"
 #include "regcache.h"
+#include "gdb_string.h"
 
 #include "sh-tdep.h"
 
index 709ef383c83541d084cf9571657479401ef212e5..2f517edb379ef104016e349d4f22c7fdebf7357f 100644 (file)
@@ -28,6 +28,7 @@
 #include "frame.h"
 #include "value.h"
 #include "arch-utils.h"
+#include "gdb_string.h"
 
 #include "vax-tdep.h"