maintenance_print_symbols (char *args, int from_tty)
{
struct ui_file *outfile = gdb_stdout;
- struct cleanup *cleanups;
char *address_arg = NULL, *source_arg = NULL, *objfile_arg = NULL;
int i, outfile_idx;
dont_repeat ();
gdb_argv argv (args);
- cleanups = make_cleanup (null_cleanup, NULL);
for (i = 0; argv != NULL && argv[i] != NULL; ++i)
{
if (argv != NULL && argv[outfile_idx] != NULL)
{
- char *outfile_name;
-
if (argv[outfile_idx + 1] != NULL)
error (_("Junk at end of command"));
- outfile_name = tilde_expand (argv[outfile_idx]);
- make_cleanup (xfree, outfile_name);
- if (!arg_outfile.open (outfile_name, FOPEN_WT))
- perror_with_name (outfile_name);
+ gdb::unique_xmalloc_ptr<char> outfile_name
+ (tilde_expand (argv[outfile_idx]));
+ if (!arg_outfile.open (outfile_name.get (), FOPEN_WT))
+ perror_with_name (outfile_name.get ());
outfile = &arg_outfile;
}
if (source_arg != NULL && !found)
error (_("No symtab for source file: %s"), source_arg);
}
-
- do_cleanups (cleanups);
}
/* Print symbol ARGS->SYMBOL on ARGS->OUTFILE. ARGS->DEPTH says how
maintenance_print_msymbols (char *args, int from_tty)
{
struct ui_file *outfile = gdb_stdout;
- struct cleanup *cleanups;
char *objfile_arg = NULL;
struct objfile *objfile;
int i, outfile_idx;
dont_repeat ();
gdb_argv argv (args);
- cleanups = make_cleanup (null_cleanup, NULL);
for (i = 0; argv != NULL && argv[i] != NULL; ++i)
{
if (argv != NULL && argv[outfile_idx] != NULL)
{
- char *outfile_name;
-
if (argv[outfile_idx + 1] != NULL)
error (_("Junk at end of command"));
- outfile_name = tilde_expand (argv[outfile_idx]);
- make_cleanup (xfree, outfile_name);
- if (!arg_outfile.open (outfile_name, FOPEN_WT))
- perror_with_name (outfile_name);
+ gdb::unique_xmalloc_ptr<char> outfile_name
+ (tilde_expand (argv[outfile_idx]));
+ if (!arg_outfile.open (outfile_name.get (), FOPEN_WT))
+ perror_with_name (outfile_name.get ());
outfile = &arg_outfile;
}
|| compare_filenames_for_search (objfile_name (objfile), objfile_arg))
dump_msymbols (objfile, outfile);
}
-
- do_cleanups (cleanups);
}
static void