diff options
Diffstat (limited to 'gdb/objc-lang.c')
-rw-r--r-- | gdb/objc-lang.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 5341b05..e70dc12 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -46,7 +46,6 @@ #include "cli/cli-utils.h" #include "c-exp.h" -#include <ctype.h> #include <algorithm> struct objc_object { @@ -602,9 +601,9 @@ info_selectors_command (const char *regexp, int from_tty) } /* First time through is JUST to get max length and count. */ - for (objfile *objfile : current_program_space->objfiles ()) + for (objfile &objfile : current_program_space->objfiles ()) { - for (minimal_symbol *msymbol : objfile->msymbols ()) + for (minimal_symbol *msymbol : objfile.msymbols ()) { QUIT; name = msymbol->natural_name (); @@ -642,9 +641,9 @@ info_selectors_command (const char *regexp, int from_tty) sym_arr = XALLOCAVEC (struct symbol *, matches); matches = 0; - for (objfile *objfile : current_program_space->objfiles ()) + for (objfile &objfile : current_program_space->objfiles ()) { - for (minimal_symbol *msymbol : objfile->msymbols ()) + for (minimal_symbol *msymbol : objfile.msymbols ()) { QUIT; name = msymbol->natural_name (); @@ -756,9 +755,9 @@ info_classes_command (const char *regexp, int from_tty) } /* First time through is JUST to get max length and count. */ - for (objfile *objfile : current_program_space->objfiles ()) + for (objfile &objfile : current_program_space->objfiles ()) { - for (minimal_symbol *msymbol : objfile->msymbols ()) + for (minimal_symbol *msymbol : objfile.msymbols ()) { QUIT; name = msymbol->natural_name (); @@ -783,9 +782,9 @@ info_classes_command (const char *regexp, int from_tty) regexp ? regexp : "*"); sym_arr = XALLOCAVEC (struct symbol *, matches); matches = 0; - for (objfile *objfile : current_program_space->objfiles ()) + for (objfile &objfile : current_program_space->objfiles ()) { - for (minimal_symbol *msymbol : objfile->msymbols ()) + for (minimal_symbol *msymbol : objfile.msymbols ()) { QUIT; name = msymbol->natural_name (); @@ -850,9 +849,9 @@ parse_selector (char *method, char **selector) for (;;) { - if (isalnum (*s2) || (*s2 == '_') || (*s2 == ':')) + if (c_isalnum (*s2) || (*s2 == '_') || (*s2 == ':')) *s1++ = *s2; - else if (isspace (*s2)) + else if (c_isspace (*s2)) ; else if ((*s2 == '\0') || (*s2 == '\'')) break; @@ -914,7 +913,7 @@ parse_method (char *method, char *type, char **theclass, s1++; nclass = s1; - while (isalnum (*s1) || (*s1 == '_')) + while (c_isalnum (*s1) || (*s1 == '_')) s1++; s2 = s1; @@ -925,7 +924,7 @@ parse_method (char *method, char *type, char **theclass, s2++; s2 = skip_spaces (s2); ncategory = s2; - while (isalnum (*s2) || (*s2 == '_')) + while (c_isalnum (*s2) || (*s2 == '_')) s2++; *s2++ = '\0'; } @@ -938,9 +937,9 @@ parse_method (char *method, char *type, char **theclass, for (;;) { - if (isalnum (*s2) || (*s2 == '_') || (*s2 == ':')) + if (c_isalnum (*s2) || (*s2 == '_') || (*s2 == ':')) *s1++ = *s2; - else if (isspace (*s2)) + else if (c_isspace (*s2)) ; else if (*s2 == ']') break; @@ -989,7 +988,7 @@ find_methods (char type, const char *theclass, const char *category, gdb_assert (symbol_names != NULL); - for (objfile *objfile : current_program_space->objfiles ()) + for (objfile &objfile : current_program_space->objfiles ()) { unsigned int *objc_csym; @@ -1000,12 +999,12 @@ find_methods (char type, const char *theclass, const char *category, unsigned int objfile_csym = 0; - objc_csym = objc_objfile_data.get (objfile); + objc_csym = objc_objfile_data.get (&objfile); if (objc_csym != NULL && *objc_csym == 0) /* There are no ObjC symbols in this objfile. Skip it entirely. */ continue; - for (minimal_symbol *msymbol : objfile->msymbols ()) + for (minimal_symbol *msymbol : objfile.msymbols ()) { QUIT; @@ -1052,7 +1051,7 @@ find_methods (char type, const char *theclass, const char *category, } if (objc_csym == NULL) - objc_csym = objc_objfile_data.emplace (objfile, objfile_csym); + objc_csym = objc_objfile_data.emplace (&objfile, objfile_csym); else /* Count of ObjC methods in this objfile should be constant. */ gdb_assert (*objc_csym == objfile_csym); @@ -1327,9 +1326,7 @@ find_objc_msgcall (CORE_ADDR pc, CORE_ADDR *new_pc) return 0; } -void _initialize_objc_language (); -void -_initialize_objc_language () +INIT_GDB_FILE (objc_language) { add_info ("selectors", info_selectors_command, _("All Objective-C selectors, or those matching REGEXP.")); |