From 45c58896fccae96ae023059410027791537cb285 Mon Sep 17 00:00:00 2001 From: Sami Wagiaalla Date: Mon, 9 Aug 2010 20:13:51 +0000 Subject: [PATCH] Fixed stabs cplus_specific issue 2010-08-09 Sami Wagiaalla * symtab.c (symbol_get_demangled_name): Remove assertion and return NULL when language_specific.cplus_specific is not initialized. * stabsread.c (define_symbol): Set the name before calling cp_scan_for_anonymous_namespaces. --- gdb/ChangeLog | 7 +++++++ gdb/stabsread.c | 5 ++++- gdb/symtab.c | 6 ++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index aa4bd19e804..d0522f83b6b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2010-08-09 Sami Wagiaalla + + * symtab.c (symbol_get_demangled_name): Remove assertion and + return NULL when language_specific.cplus_specific is not initialized. + * stabsread.c (define_symbol): Set the name before calling + cp_scan_for_anonymous_namespaces. + 2010-08-09 Sami Wagiaalla * symtab.h: Renamed SYMBOL_INIT_LANGUAGE_SPECIFIC to diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 5f6b0042580..43b09f10ed4 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -712,7 +712,6 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, memcpy (name, string, p - string); name[p - string] = '\0'; new_name = cp_canonicalize_string (name); - cp_scan_for_anonymous_namespaces (sym); } if (new_name != NULL) { @@ -721,6 +720,10 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, } else SYMBOL_SET_NAMES (sym, string, p - string, 1, objfile); + + if (SYMBOL_LANGUAGE (sym) == language_cplus) + cp_scan_for_anonymous_namespaces (sym); + } p++; diff --git a/gdb/symtab.c b/gdb/symtab.c index 5fbe58cf698..d43d573c6e1 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -382,8 +382,10 @@ symbol_get_demangled_name (const struct general_symbol_info *gsymbol) { if (gsymbol->language == language_cplus) { - gdb_assert (gsymbol->language_specific.cplus_specific != NULL); - return gsymbol->language_specific.cplus_specific->demangled_name; + if (gsymbol->language_specific.cplus_specific != NULL) + return gsymbol->language_specific.cplus_specific->demangled_name; + else + return NULL; } else return gsymbol->language_specific.mangled_lang.demangled_name; -- 2.30.2