* elf32-m68k.c (elf_m68k_relocate_section): Allow
[binutils-gdb.git] / gdb / objc-lang.c
index cb7fa0ec27a3de31c8bb292c390ae20bdfd5c569..15bf792bc34f7bc14fa20b4ea9289a60467b9846 100644 (file)
@@ -1,7 +1,6 @@
 /* Objective-C language support routines for GDB, the GNU debugger.
 
-   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2002-2005, 2007-2012 Free Software Foundation, Inc.
 
    Contributed by Apple Computer, Inc.
    Written by Michael Snyder.
@@ -525,6 +524,7 @@ const struct language_defn objc_language_defn = {
   c_print_typedef,             /* Print a typedef using appropriate syntax */
   c_val_print,                 /* Print a value using appropriate syntax */
   c_value_print,               /* Print a top-level value */
+  default_read_var_value,      /* la_read_var_value */
   objc_skip_trampoline,        /* Language specific skip_trampoline */
   "self",                      /* name_of_this */
   basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
@@ -541,7 +541,7 @@ const struct language_defn objc_language_defn = {
   default_print_array_index,
   default_pass_by_reference,
   default_get_string,
-  strcmp_iw_ordered,
+  NULL,                                /* la_get_symbol_name_cmp */
   iterate_over_symbols,
   LANG_MAGIC
 };
@@ -637,14 +637,14 @@ end_msglist(void)
 }
 
 /*
- * Function: specialcmp (char *a, char *b)
+ * Function: specialcmp (const char *a, const char *b)
  *
  * Special strcmp: treats ']' and ' ' as end-of-string.
  * Used for qsorting lists of objc methods (either by class or selector).
  */
 
 static int
-specialcmp (char *a, char *b)
+specialcmp (const char *a, const char *b)
 {
   while (*a && *a != ' ' && *a != ']' && *b && *b != ' ' && *b != ']')
     {
@@ -669,7 +669,7 @@ specialcmp (char *a, char *b)
 static int
 compare_selectors (const void *a, const void *b)
 {
-  char *aname, *bname;
+  const char *aname, *bname;
 
   aname = SYMBOL_PRINT_NAME (*(struct symbol **) a);
   bname = SYMBOL_PRINT_NAME (*(struct symbol **) b);
@@ -698,7 +698,7 @@ selectors_info (char *regexp, int from_tty)
 {
   struct objfile       *objfile;
   struct minimal_symbol *msymbol;
-  char                  *name;
+  const char            *name;
   char                  *val;
   int                    matches = 0;
   int                    maxlen  = 0;
@@ -763,8 +763,8 @@ selectors_info (char *regexp, int from_tty)
            }
          if (regexp == NULL || re_exec(++name) != 0)
            { 
-             char *mystart = name;
-             char *myend   = (char *) strchr (mystart, ']');
+             const char *mystart = name;
+             const char *myend   = strchr (mystart, ']');
              
              if (myend && (myend - mystart > maxlen))
                maxlen = myend - mystart;       /* Get longest selector.  */
@@ -835,7 +835,7 @@ selectors_info (char *regexp, int from_tty)
 static int
 compare_classes (const void *a, const void *b)
 {
-  char *aname, *bname;
+  const char *aname, *bname;
 
   aname = SYMBOL_PRINT_NAME (*(struct symbol **) a);
   bname = SYMBOL_PRINT_NAME (*(struct symbol **) b);
@@ -860,7 +860,7 @@ classes_info (char *regexp, int from_tty)
 {
   struct objfile       *objfile;
   struct minimal_symbol *msymbol;
-  char                  *name;
+  const char            *name;
   char                  *val;
   int                    matches = 0;
   int                    maxlen  = 0;
@@ -902,8 +902,8 @@ classes_info (char *regexp, int from_tty)
        if (regexp == NULL || re_exec(name+2) != 0)
          { 
            /* Compute length of classname part.  */
-           char *mystart = name + 2;
-           char *myend   = (char *) strchr(mystart, ' ');
+           const char *mystart = name + 2;
+           const char *myend   = strchr (mystart, ' ');
            
            if (myend && (myend - mystart > maxlen))
              maxlen = myend - mystart;
@@ -1120,7 +1120,7 @@ find_methods (char type, const char *class, const char *category,
 {
   struct objfile *objfile = NULL;
 
-  char *symname = NULL;
+  const char *symname = NULL;
 
   char ntype = '\0';
   char *nclass = NULL;
@@ -1767,6 +1767,9 @@ resolve_msgsend_super_stret (CORE_ADDR pc, CORE_ADDR *new_pc)
   return 0;
 }
 
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+extern initialize_file_ftype _initialize_objc_lang;
+
 void
 _initialize_objc_lang (void)
 {