From a10964d12c48edb3e0be45e2d67ad70a0e129601 Mon Sep 17 00:00:00 2001 From: Aleksandar Ristovski Date: Thu, 20 Oct 2011 20:06:14 +0000 Subject: [PATCH] * cp-namespace.c (cp_scan_for_anonymous_namespaces): Changed function arguments by adding OBJFILE. Instead of getting objfile from symbol's symtab, use new argument OBJFILE. * cp-support.h (cp_scan_for_anonymous_namespaces): Changed function arguments by adding OBJFILE. * gdb/dwarf2read.c (new_symbol_full): Change call to cp_scan_for_anonymous_namespaces to match new signature. * gdb/stabsread.c (define_symbol): Change call to cp_scan_for_anonymous_namespaces to match new signature. --- gdb/ChangeLog | 12 ++++++++++++ gdb/cp-namespace.c | 5 +++-- gdb/cp-support.h | 3 ++- gdb/dwarf2read.c | 2 +- gdb/stabsread.c | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c9d5b26bed8..228c456344b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2011-10-20 Aleksandar Ristovski + + * cp-namespace.c (cp_scan_for_anonymous_namespaces): Changed function + arguments by adding OBJFILE. Instead of getting objfile from + symbol's symtab, use new argument OBJFILE. + * cp-support.h (cp_scan_for_anonymous_namespaces): Changed function + arguments by adding OBJFILE. + * gdb/dwarf2read.c (new_symbol_full): Change call to + cp_scan_for_anonymous_namespaces to match new signature. + * gdb/stabsread.c (define_symbol): Change call to + cp_scan_for_anonymous_namespaces to match new signature. + 2011-10-20 Phil Muldoon PR python/13308 diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 68febcd8c42..86087251510 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -53,7 +53,8 @@ static struct type *cp_lookup_transparent_type_loop (const char *name, anonymous namespace; if so, add an appropriate using directive. */ void -cp_scan_for_anonymous_namespaces (const struct symbol *symbol) +cp_scan_for_anonymous_namespaces (const struct symbol *const symbol, + struct objfile *const objfile) { if (SYMBOL_DEMANGLED_NAME (symbol) != NULL) { @@ -96,7 +97,7 @@ cp_scan_for_anonymous_namespaces (const struct symbol *symbol) namespace given by the previous component if there is one, or to the global namespace if there isn't. */ cp_add_using_directive (dest, src, NULL, NULL, NULL, - &SYMBOL_SYMTAB (symbol)->objfile->objfile_obstack); + &objfile->objfile_obstack); } /* The "+ 2" is for the "::". */ previous_component = next_component + 2; diff --git a/gdb/cp-support.h b/gdb/cp-support.h index 51f808f80ef..9e7458ad9ec 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -197,7 +197,8 @@ extern void cp_set_block_scope (const struct symbol *symbol, const char *processing_current_prefix, int processing_has_namespace_info); -extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol); +extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol, + struct objfile *objfile); extern struct symbol *cp_lookup_symbol_nonlocal (const char *name, const struct block *block, diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 5f81da6b7d9..0f9f38220ef 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -11992,7 +11992,7 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, namespaces based on the demangled name. */ if (!processing_has_namespace_info && cu->language == language_cplus) - cp_scan_for_anonymous_namespaces (sym); + cp_scan_for_anonymous_namespaces (sym, objfile); } return (sym); } diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 5331bce4526..3ff3f5e9e6d 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -729,7 +729,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_SET_NAMES (sym, string, p - string, 1, objfile); if (SYMBOL_LANGUAGE (sym) == language_cplus) - cp_scan_for_anonymous_namespaces (sym); + cp_scan_for_anonymous_namespaces (sym, objfile); } p++; -- 2.30.2