2004-08-29 David Lecomber <david@streamline-computing.com>
[deliverable/binutils-gdb.git] / gdb / objc-lang.c
index 732da8f73be616a409a3926fd44a4fddffc243f1..b02af1c236118700f6098e3307a6f58faed4e154 100644 (file)
@@ -1,6 +1,6 @@
 /* Objective-C language support routines for GDB, the GNU debugger.
 
-   Copyright 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Apple Computer, Inc.
    Written by Michael Snyder.
@@ -83,7 +83,7 @@ struct objc_method {
 struct symbol *
 lookup_struct_typedef (char *name, struct block *block, int noerr)
 {
-  register struct symbol *sym;
+  struct symbol *sym;
 
   sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0, 
                       (struct symtab **) NULL);
@@ -133,7 +133,7 @@ lookup_objc_class (char *classname)
                                                           1, &classval));
 }
 
-int
+CORE_ADDR
 lookup_child_selector (char *selname)
 {
   struct value * function, *selstring;
@@ -274,7 +274,7 @@ objc_demangle (const char *mangled, int options)
    for printing characters and strings is language specific.  */
 
 static void
-objc_emit_char (register int c, struct ui_file *stream, int quoter)
+objc_emit_char (int c, struct ui_file *stream, int quoter)
 {
 
   c &= 0xFF;                   /* Avoid sign bit follies.  */
@@ -337,7 +337,7 @@ static void
 objc_printstr (struct ui_file *stream, char *string, 
               unsigned int length, int width, int force_ellipses)
 {
-  register unsigned int i;
+  unsigned int i;
   unsigned int things_printed = 0;
   int in_quotes = 0;
   int need_comma = 0;
@@ -449,7 +449,7 @@ objc_printstr (struct ui_file *stream, char *string,
 static struct type *
 objc_create_fundamental_type (struct objfile *objfile, int typeid)
 {
-  register struct type *type = NULL;
+  struct type *type = NULL;
 
   switch (typeid)
     {
@@ -659,9 +659,11 @@ const struct language_defn objc_language_defn = {
   range_check_off,
   type_check_off,
   case_sensitive_on,
+  array_row_major,
+  &exp_descriptor_standard,
   objc_parse,
   objc_error,
-  evaluate_subexp_standard,
+  null_post_parser,
   objc_printchar,              /* Print a character constant */
   objc_printstr,               /* Function to print string constant */
   objc_emit_char,
@@ -672,7 +674,9 @@ const struct language_defn objc_language_defn = {
   objc_skip_trampoline,        /* Language specific skip_trampoline */
   value_of_this,               /* value_of_this */
   basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
+  basic_lookup_transparent_type,/* lookup_transparent_type */
   objc_demangle,               /* Language specific symbol demangler */
+  NULL,                                /* Language specific class_name_from_physname */
   {"",     "",    "",  ""},    /* Binary format info */
   {"0%lo",  "0",   "o", ""},   /* Octal format info */
   {"%ld",   "",    "d", ""},   /* Decimal format info */
@@ -681,6 +685,8 @@ const struct language_defn objc_language_defn = {
   1,                           /* C-style arrays */
   0,                           /* String lower bound */
   &builtin_type_char,          /* Type of string elements */
+  default_word_break_characters,
+  NULL, /* FIXME: la_language_arch_info.  */
   LANG_MAGIC
 };
 
@@ -703,7 +709,7 @@ static char *msglist_sel;
 void
 start_msglist(void)
 {
-  register struct selname *new = 
+  struct selname *new = 
     (struct selname *) xmalloc (sizeof (struct selname));
 
   new->next = selname_chain;
@@ -749,10 +755,10 @@ add_msglist(struct stoken *str, int addcolon)
 int
 end_msglist(void)
 {
-  register int val = msglist_len;
-  register struct selname *sel = selname_chain;
-  register char *p = msglist_sel;
-  int selid;
+  int val = msglist_len;
+  struct selname *sel = selname_chain;
+  char *p = msglist_sel;
+  CORE_ADDR selid;
 
   selname_chain = sel->next;
   msglist_len = sel->msglist_len;
@@ -775,7 +781,8 @@ end_msglist(void)
  * Used for qsorting lists of objc methods (either by class or selector).
  */
 
-int specialcmp(char *a, char *b)
+static int
+specialcmp (char *a, char *b)
 {
   while (*a && *a != ' ' && *a != ']' && *b && *b != ' ' && *b != ']')
     {
@@ -1518,7 +1525,7 @@ char *find_imps (struct symtab *symtab, struct block *block,
   return method + (tmp - buf);
 }
 
-void 
+static void 
 print_object_command (char *args, int from_tty)
 {
   struct value *object, *function, *description;
@@ -1532,12 +1539,12 @@ print_object_command (char *args, int from_tty)
 
   {
     struct expression *expr = parse_expression (args);
-    register struct cleanup *old_chain = 
+    struct cleanup *old_chain = 
       make_cleanup (free_current_contents, &expr);
     int pc = 0;
 
-    object = expr->language_defn->evaluate_exp (builtin_type_void_data_ptr,
-                                               expr, &pc, EVAL_NORMAL);
+    object = expr->language_defn->la_exp_desc->evaluate_exp 
+      (builtin_type_void_data_ptr, expr, &pc, EVAL_NORMAL);
     do_cleanups (old_chain);
   }
 
@@ -1606,7 +1613,7 @@ static struct objc_methcall methcalls[] = {
  * case the functions have moved for some reason.  
  */
 
-void 
+static void 
 find_objc_msgsend (void)
 {
   unsigned int i;
@@ -1653,7 +1660,7 @@ struct objc_submethod_helper_data {
   CORE_ADDR *new_pc;
 };
 
-int 
+static int 
 find_objc_msgcall_submethod_helper (void * arg)
 {
   struct objc_submethod_helper_data *s = 
@@ -1665,7 +1672,7 @@ find_objc_msgcall_submethod_helper (void * arg)
     return 0;
 }
 
-int 
+static int 
 find_objc_msgcall_submethod (int (*f) (CORE_ADDR, CORE_ADDR *),
                             CORE_ADDR pc, 
                             CORE_ADDR *new_pc)
@@ -1709,6 +1716,8 @@ find_objc_msgcall (CORE_ADDR pc, CORE_ADDR *new_pc)
   return 0;
 }
 
+extern initialize_file_ftype _initialize_objc_language; /* -Wmissing-prototypes */
+
 void
 _initialize_objc_language (void)
 {
@@ -1772,7 +1781,7 @@ read_objc_class (CORE_ADDR addr, struct objc_class *class)
   class->protocols = read_memory_unsigned_integer (addr + 36, 4);
 }
 
-CORE_ADDR
+static CORE_ADDR
 find_implementation_from_class (CORE_ADDR class, CORE_ADDR sel)
 {
   CORE_ADDR subclass = class;
@@ -1822,7 +1831,7 @@ find_implementation_from_class (CORE_ADDR class, CORE_ADDR sel)
   return 0;
 }
 
-CORE_ADDR
+static CORE_ADDR
 find_implementation (CORE_ADDR object, CORE_ADDR sel)
 {
   struct objc_object ostr;
This page took 0.026992 seconds and 4 git commands to generate.