This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Remove some cleanups from dwarf2read.c
- From: Simon Marchi <simark at simark dot ca>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Sun, 8 Oct 2017 22:36:45 -0400
- Subject: Re: [RFA] Remove some cleanups from dwarf2read.c
- Authentication-results: sourceware.org; auth=none
- References: <20171008225305.22006-1-tom@tromey.com>
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