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: [RFA] Remove some cleanups from dwarf2read.c


On 2017-10-08 06:53 PM, Tom Tromey wrote:
> @@ -9068,18 +9047,15 @@ dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu)
>  	  /* This is a lie, but we already lie to the caller new_symbol_full.
>  	     new_symbol_full assumes we return the mangled name.
>  	     This just undoes that lie until things are cleaned up.  */
> -	  demangled = NULL;
>  	}
>        else
>  	{
> -	  demangled = gdb_demangle (mangled,
> -				    (DMGL_PARAMS | DMGL_ANSI | DMGL_RET_DROP));
> +	  demangled.reset (gdb_demangle (mangled,
> +					 (DMGL_PARAMS | DMGL_ANSI
> +					  | DMGL_RET_DROP)));

It would be nice (as a future change) for gdb_demangle to return a unique_xmalloc_ptr.

> @@ -11371,21 +11336,17 @@ lookup_dwo_cutu (struct dwarf2_per_cu_data *this_unit,
>    {
>      /* Print the name of the DWP file if we looked there, helps the user
>         better diagnose the problem.  */
> -    char *dwp_text = NULL;
> -    struct cleanup *cleanups;
> +    std::string dwp_text;
>  
>      if (dwp_file != NULL)
> -      dwp_text = xstrprintf (" [in DWP file %s]", lbasename (dwp_file->name));
> -    cleanups = make_cleanup (xfree, dwp_text);
> +      dwp_text = string_printf (" [in DWP file %s]", lbasename (dwp_file->name));

80 columns.

Otherwise, LGTM.

Simon


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