From 852dff6c6724a3a578e9aad70c2185f7f279782f Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Wed, 29 Feb 2012 19:50:22 +0000 Subject: [PATCH] Minor cleanup to a couple of functions in ada-lang.c. gdb/ChangeLog: * ada-lang.h (ada_find_any_symbol, ada_find_any_type): Delete. * ada-lang.c (ada_find_any_type): Add advance declaration. Make static. Replace ada_find_any_symbol by ada_find_any_type_symbol. (ada_find_any_type_symbol): Renames ada_find_any_symbol. Improve function description. Make static. (ada_find_renaming_symbol, find_old_style_renaming_symbol): Replace ada_find_any_symbol by ada_find_any_type_symbol. --- gdb/ChangeLog | 11 +++++++++++ gdb/ada-lang.c | 16 +++++++++------- gdb/ada-lang.h | 4 ---- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2681f17f71a..ad316c6d3ab 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2012-02-29 Joel Brobecker + + * ada-lang.h (ada_find_any_symbol, ada_find_any_type): Delete. + * ada-lang.c (ada_find_any_type): Add advance declaration. + Make static. Replace ada_find_any_symbol by + ada_find_any_type_symbol. + (ada_find_any_type_symbol): Renames ada_find_any_symbol. + Improve function description. Make static. + (ada_find_renaming_symbol, find_old_style_renaming_symbol): + Replace ada_find_any_symbol by ada_find_any_type_symbol. + 2012-02-29 Joel Brobecker * ada-lang.c (struct tag_args): Delete. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 1b467789c35..c5d5ff742f7 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -271,6 +271,8 @@ static struct value *ada_evaluate_subexp (struct type *, struct expression *, static void ada_forward_operator_length (struct expression *, int, int *, int *); + +static struct type *ada_find_any_type (const char *name); @@ -7022,10 +7024,10 @@ field_alignment (struct type *type, int f) return atoi (name + align_offset) * TARGET_CHAR_BIT; } -/* Find a symbol named NAME. Ignores ambiguity. */ +/* Find a typedef or tag symbol named NAME. Ignores ambiguity. */ -struct symbol * -ada_find_any_symbol (const char *name) +static struct symbol * +ada_find_any_type_symbol (const char *name) { struct symbol *sym; @@ -7041,10 +7043,10 @@ ada_find_any_symbol (const char *name) solely for types defined by debug info, it will not search the GDB primitive types. */ -struct type * +static struct type * ada_find_any_type (const char *name) { - struct symbol *sym = ada_find_any_symbol (name); + struct symbol *sym = ada_find_any_type_symbol (name); if (sym != NULL) return SYMBOL_TYPE (sym); @@ -7068,7 +7070,7 @@ ada_find_renaming_symbol (const char *name, struct block *block) return sym; /* Not right yet. FIXME pnh 7/20/2007. */ - sym = ada_find_any_symbol (name); + sym = ada_find_any_type_symbol (name); if (sym != NULL && strstr (SYMBOL_LINKAGE_NAME (sym), "___XR") != NULL) return sym; else @@ -7126,7 +7128,7 @@ find_old_style_renaming_symbol (const char *name, struct block *block) xsnprintf (rename, rename_len * sizeof (char), "%s___XR", name); } - return ada_find_any_symbol (rename); + return ada_find_any_type_symbol (rename); } /* Because of GNAT encoding conventions, several GDB symbols may match a diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index d11a624be55..abf9c53031a 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -333,10 +333,6 @@ extern struct type *ada_find_parallel_type (struct type *, extern LONGEST get_int_var_value (char *, int *); -extern struct symbol *ada_find_any_symbol (const char *name); - -extern struct type *ada_find_any_type (const char *name); - extern struct symbol *ada_find_renaming_symbol (const char *name, struct block *block); -- 2.30.2