[Haiku-commits] r31233 - haiku/trunk/src/apps/debugger/demangler

Ingo Weinhold ingo_weinhold at gmx.de
Thu Jun 25 12:28:22 CEST 2009


On 2009-06-25 at 09:58:53 [+0200], phoudoin at mail.berlios.de wrote:
> Author: phoudoin
> Date: 2009-06-25 09:58:51 +0200 (Thu, 25 Jun 2009)
> New Revision: 31233
> ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31233&view=rev
> 
> Modified:
>    haiku/trunk/src/apps/debugger/demangler/Demangler.cpp
>    haiku/trunk/src/apps/debugger/demangler/Jamfile
> Log:
> Add gcc2 demangling.
> 
> 
> Modified: haiku/trunk/src/apps/debugger/demangler/Demangler.cpp
> ===================================================================
> --- haiku/trunk/src/apps/debugger/demangler/Demangler.cpp    2009-06-24 
> 23:38:29 UTC (rev 31232)
> +++ haiku/trunk/src/apps/debugger/demangler/Demangler.cpp    2009-06-25 
> 07:58:51 UTC (rev 31233)
> @@ -12,14 +12,20 @@
>  Demangler::Demangle(const BString& mangledName)
>  {
>      char buffer[1024];
> +    const char* demangled;
> +
>      if (mangledName.Compare("_Z", 2) == 0) {
> -        const char* demangled = demangle_name_gcc3(mangledName.String(), 
> buffer,
> +        demangled = demangle_name_gcc3(mangledName.String(), buffer,
>              sizeof(buffer));
>          if (demangled != NULL)
>              return demangled;
>      }
>  
> -    // TODO: gcc2 demangling!
> +    // fallback is gcc2
> +    demangled = demangle_symbol_gcc2(mangledName.String(), buffer,
> +        sizeof(buffer), NULL);
> +    if (demangled != NULL)
> +        return demangled;
>  
>      return mangledName;
>  }

The TODO is still partially valid, since the mangling is at least not 
complete. Parameters are missing and not all features are supported 
(templates).

CU, Ingo



More information about the Haiku-commits mailing list