2005-02-11 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / gdb / objc-lang.c
index ecbce77b1906bbdf7c26cafd4cb91fd7c9b74d01..c4ae342a79151c82236e2befbe56cc34e00b1bfd 100644 (file)
@@ -1,6 +1,6 @@
 /* Objective-C language support routines for GDB, the GNU debugger.
 
-   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
    Contributed by Apple Computer, Inc.
    Written by Michael Snyder.
@@ -30,6 +30,7 @@
 #include "language.h"
 #include "c-lang.h"
 #include "objc-lang.h"
+#include "exceptions.h"
 #include "complaints.h"
 #include "value.h"
 #include "symfile.h"
@@ -93,14 +94,14 @@ lookup_struct_typedef (char *name, struct block *block, int noerr)
       if (noerr)
        return 0;
       else 
-       error ("No struct type named %s.", name);
+       error (_("No struct type named %s."), name);
     }
   if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_STRUCT)
     {
       if (noerr)
        return 0;
       else
-       error ("This context has class, union or enum %s, not a struct."
+       error (_("This context has class, union or enum %s, not a struct.")
               name);
     }
   return sym;
@@ -123,7 +124,7 @@ lookup_objc_class (char *classname)
     function = find_function_in_inferior("objc_lookup_class");
   else
     {
-      complaint (&symfile_complaints, "no way to lookup Objective-C classes");
+      complaint (&symfile_complaints, _("no way to lookup Objective-C classes"));
       return 0;
     }
 
@@ -150,7 +151,7 @@ lookup_child_selector (char *selname)
     function = find_function_in_inferior("sel_get_any_uid");
   else
     {
-      complaint (&symfile_complaints, "no way to lookup Objective-C selectors");
+      complaint (&symfile_complaints, _("no way to lookup Objective-C selectors"));
       return 0;
     }
 
@@ -201,9 +202,9 @@ value_nsstring (char *ptr, int len)
       nsstringValue = call_function_by_hand(function, 3, &stringValue[0]);
     }
   else
-    error ("NSString: internal error -- no way to create new NSString");
+    error (_("NSString: internal error -- no way to create new NSString"));
 
-  VALUE_TYPE(nsstringValue) = type;
+  deprecated_set_value_type (nsstringValue, type);
   return nsstringValue;
 }
 
@@ -334,7 +335,7 @@ objc_printchar (int c, struct ui_file *stream)
    FORCE_ELLIPSES.  */
 
 static void
-objc_printstr (struct ui_file *stream, char *string, 
+objc_printstr (struct ui_file *stream, const bfd_byte *string, 
               unsigned int length, int width, int force_ellipses)
 {
   unsigned int i;
@@ -462,7 +463,7 @@ objc_create_fundamental_type (struct objfile *objfile, int typeid)
        type = init_type (TYPE_CODE_INT,
                          TARGET_INT_BIT / TARGET_CHAR_BIT,
                          0, "<?type?>", objfile);
-        warning ("internal error: no C/C++ fundamental type %d", typeid);
+        warning (_("internal error: no C/C++ fundamental type %d"), typeid);
        break;
       case FT_VOID:
        type = init_type (TYPE_CODE_VOID,
@@ -659,6 +660,7 @@ 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,
@@ -675,15 +677,13 @@ const struct language_defn objc_language_defn = {
   basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   objc_demangle,               /* Language specific symbol demangler */
-  {"",     "",    "",  ""},    /* Binary format info */
-  {"0%lo",  "0",   "o", ""},   /* Octal format info */
-  {"%ld",   "",    "d", ""},   /* Decimal format info */
-  {"0x%lx", "0x",  "x", ""},   /* Hex format info */
+  NULL,                                /* Language specific class_name_from_physname */
   objc_op_print_tab,           /* Expression operators for printing */
   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
 };
 
@@ -762,7 +762,7 @@ end_msglist(void)
   msglist_sel = sel->msglist_sel;
   selid = lookup_child_selector(p);
   if (!selid)
-    error("Can't find selector \"%s\"", p);
+    error (_("Can't find selector \"%s\""), p);
   write_exp_elt_longcst (selid);
   xfree(p);
   write_exp_elt_longcst (val); /* Number of args */
@@ -809,12 +809,12 @@ compare_selectors (const void *a, const void *b)
   aname = SYMBOL_PRINT_NAME (*(struct symbol **) a);
   bname = SYMBOL_PRINT_NAME (*(struct symbol **) b);
   if (aname == NULL || bname == NULL)
-    error ("internal: compare_selectors(1)");
+    error (_("internal: compare_selectors(1)"));
 
   aname = strchr(aname, ' ');
   bname = strchr(bname, ' ');
   if (aname == NULL || bname == NULL)
-    error ("internal: compare_selectors(2)");
+    error (_("internal: compare_selectors(2)"));
 
   return specialcmp (aname+1, bname+1);
 }
@@ -869,7 +869,7 @@ selectors_info (char *regexp, int from_tty)
     {
       val = re_comp (myregexp);
       if (val != 0)
-       error ("Invalid regexp (%s): %s", val, regexp);
+       error (_("Invalid regexp (%s): %s"), val, regexp);
     }
 
   /* First time thru is JUST to get max length and count.  */
@@ -899,7 +899,7 @@ selectors_info (char *regexp, int from_tty)
     }
   if (matches)
     {
-      printf_filtered ("Selectors matching \"%s\":\n\n"
+      printf_filtered (_("Selectors matching \"%s\":\n\n")
                       regexp ? regexp : "*");
 
       sym_arr = alloca (matches * sizeof (struct symbol *));
@@ -946,7 +946,7 @@ selectors_info (char *regexp, int from_tty)
       begin_line();
     }
   else
-    printf_filtered ("No selectors matching \"%s\"\n", regexp ? regexp : "*");
+    printf_filtered (_("No selectors matching \"%s\"\n"), regexp ? regexp : "*");
 }
 
 /*
@@ -964,7 +964,7 @@ compare_classes (const void *a, const void *b)
   aname = SYMBOL_PRINT_NAME (*(struct symbol **) a);
   bname = SYMBOL_PRINT_NAME (*(struct symbol **) b);
   if (aname == NULL || bname == NULL)
-    error ("internal: compare_classes(1)");
+    error (_("internal: compare_classes(1)"));
 
   return specialcmp (aname+1, bname+1);
 }
@@ -1009,7 +1009,7 @@ classes_info (char *regexp, int from_tty)
     {
       val = re_comp (myregexp);
       if (val != 0)
-       error ("Invalid regexp (%s): %s", val, regexp);
+       error (_("Invalid regexp (%s): %s"), val, regexp);
     }
 
   /* First time thru is JUST to get max length and count.  */
@@ -1033,7 +1033,7 @@ classes_info (char *regexp, int from_tty)
     }
   if (matches)
     {
-      printf_filtered ("Classes matching \"%s\":\n\n"
+      printf_filtered (_("Classes matching \"%s\":\n\n")
                       regexp ? regexp : "*");
       sym_arr = alloca (matches * sizeof (struct symbol *));
       matches = 0;
@@ -1072,7 +1072,7 @@ classes_info (char *regexp, int from_tty)
       begin_line();
     }
   else
-    printf_filtered ("No classes matching \"%s\"\n", regexp ? regexp : "*");
+    printf_filtered (_("No classes matching \"%s\"\n"), regexp ? regexp : "*");
 }
 
 /* 
@@ -1551,13 +1551,13 @@ print_object_command (char *args, int from_tty)
 
   function = find_function_in_inferior ("_NSPrintForDebugger");
   if (function == NULL)
-    error ("Unable to locate _NSPrintForDebugger in child process");
+    error (_("Unable to locate _NSPrintForDebugger in child process"));
 
   description = call_function_by_hand (function, 1, &object);
 
   string_addr = value_as_long (description);
   if (string_addr == 0)
-    error ("object returns null description");
+    error (_("object returns null description"));
 
   read_memory (string_addr + i++, &c, 1);
   if (c != '\0')
@@ -1568,7 +1568,7 @@ print_object_command (char *args, int from_tty)
        read_memory (string_addr + i++, &c, 1);
       } while (c != 0);
   else
-    printf_filtered("<object returns empty description>");
+    printf_filtered(_("<object returns empty description>"));
   printf_filtered ("\n");
 }
 
This page took 0.029548 seconds and 4 git commands to generate.