Remove most uses of ALL_OBJFILES
[deliverable/binutils-gdb.git] / gdb / objc-lang.c
index 8c24fde3eedb84a3896106e2c088296990a9821e..ec0ea56063b4efdeb2d45f411f828285c0b2970f 100644 (file)
@@ -1,6 +1,6 @@
 /* Objective-C language support routines for GDB, the GNU debugger.
 
-   Copyright (C) 2002-2018 Free Software Foundation, Inc.
+   Copyright (C) 2002-2019 Free Software Foundation, Inc.
 
    Contributed by Apple Computer, Inc.
    Written by Michael Snyder.
@@ -124,8 +124,7 @@ lookup_objc_class (struct gdbarch *gdbarch, const char *classname)
     function = find_function_in_inferior("objc_lookup_class", NULL);
   else
     {
-      complaint (&symfile_complaints,
-                _("no way to lookup Objective-C classes"));
+      complaint (_("no way to lookup Objective-C classes"));
       return 0;
     }
 
@@ -133,7 +132,7 @@ lookup_objc_class (struct gdbarch *gdbarch, const char *classname)
   classval = value_coerce_array (classval);
   return (CORE_ADDR) value_as_long (call_function_by_hand (function,
                                                           NULL,
-                                                          1, &classval));
+                                                          classval));
 }
 
 CORE_ADDR
@@ -154,15 +153,14 @@ lookup_child_selector (struct gdbarch *gdbarch, const char *selname)
     function = find_function_in_inferior("sel_get_any_uid", NULL);
   else
     {
-      complaint (&symfile_complaints,
-                _("no way to lookup Objective-C selectors"));
+      complaint (_("no way to lookup Objective-C selectors"));
       return 0;
     }
 
   selstring = value_coerce_array (value_string (selname, 
                                                strlen (selname) + 1,
                                                char_type));
-  return value_as_long (call_function_by_hand (function, NULL, 1, &selstring));
+  return value_as_long (call_function_by_hand (function, NULL, selstring));
 }
 
 struct value * 
@@ -183,13 +181,12 @@ value_nsstring (struct gdbarch *gdbarch, char *ptr, int len)
   if (lookup_minimal_symbol("_NSNewStringFromCString", 0, 0).minsym)
     {
       function = find_function_in_inferior("_NSNewStringFromCString", NULL);
-      nsstringValue = call_function_by_hand(function,
-                                           NULL, 1, &stringValue[2]);
+      nsstringValue = call_function_by_hand(function, NULL, stringValue[2]);
     }
   else if (lookup_minimal_symbol("istr", 0, 0).minsym)
     {
       function = find_function_in_inferior("istr", NULL);
-      nsstringValue = call_function_by_hand(function, NULL, 1, &stringValue[2]);
+      nsstringValue = call_function_by_hand(function, NULL, stringValue[2]);
     }
   else if (lookup_minimal_symbol("+[NSString stringWithCString:]", 0, 0).minsym)
     {
@@ -201,7 +198,7 @@ value_nsstring (struct gdbarch *gdbarch, char *ptr, int len)
        (type, lookup_objc_class (gdbarch, "NSString"));
       stringValue[1] = value_from_longest 
        (type, lookup_child_selector (gdbarch, "stringWithCString:"));
-      nsstringValue = call_function_by_hand(function, NULL, 3, &stringValue[0]);
+      nsstringValue = call_function_by_hand(function, NULL, stringValue);
     }
   else
     error (_("NSString: internal error -- no way to create new NSString"));
@@ -378,7 +375,6 @@ extern const struct language_defn objc_language_defn = {
   objc_extensions,
   &exp_descriptor_standard,
   c_parse,
-  c_yyerror,
   null_post_parser,
   c_printchar,                /* Print a character constant */
   c_printstr,                 /* Function to print string constant */
@@ -626,8 +622,7 @@ info_selectors_command (const char *regexp, int from_tty)
          name = (char *) strchr (name+2, ' ');
          if (name == NULL)
            {
-             complaint (&symfile_complaints, 
-                        _("Bad method name '%s'"), 
+             complaint (_("Bad method name '%s'"),
                         MSYMBOL_NATURAL_NAME (msymbol));
              continue;
            }
@@ -977,8 +972,6 @@ find_methods (char type, const char *theclass, const char *category,
              const char *selector,
              std::vector<const char *> *symbol_names)
 {
-  struct objfile *objfile = NULL;
-
   const char *symname = NULL;
 
   char ntype = '\0';
@@ -991,7 +984,7 @@ find_methods (char type, const char *theclass, const char *category,
 
   gdb_assert (symbol_names != NULL);
 
-  ALL_OBJFILES (objfile)
+  for (objfile *objfile : all_objfiles (current_program_space))
     {
       unsigned int *objc_csym;
       struct minimal_symbol *msymbol = NULL;
@@ -1193,7 +1186,7 @@ print_object_command (const char *args, int from_tty)
   if (function == NULL)
     error (_("Unable to locate _NSPrintForDebugger in child process"));
 
-  description = call_function_by_hand (function, NULL, 1, &object);
+  description = call_function_by_hand (function, NULL, object);
 
   string_addr = value_as_long (description);
   if (string_addr == 0)
This page took 0.029092 seconds and 4 git commands to generate.