This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Change cplus_specific to an alocated struct


On 05/26/2010 11:45 AM, sami wagiaalla wrote:
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 3b3894c..62e1251 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -1142,32 +1142,32 @@ static struct htab *decoded_names_store;
  char *
  ada_decode_symbol (const struct general_symbol_info *gsymbol)
  {
-  char **resultp =
-    (char **)&gsymbol->language_specific.cplus_specific.demangled_name;
-  if (*resultp == NULL)
+  char *result = symbol_get_cplus_demangled_name (gsymbol);
+

Changed char **resultp to char *result since demangled_name no longer necessarily has an address. I didn't see why a pointer pointer was needed so I hope I am not missing anything. My guess was that it is an artifact left over from an earlier form of the function.



Also, both locations which call ada_decode_symbol (symbol_natural_name, and symbol_demangled_name) check before call the function cplus_specific.demangled_name. So, the check can perhaps be removed from either the caller or callee.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]