2017-09-29 Tom Tromey <tom@tromey.com>
+ * stack.c (parse_frame_specification): Use std::string
+ (info_frame_command): Use gdb::unique_xmalloc_ptr.
+
+2017-09-29 Tom Tromey <tom@tromey.com>
+
* tilegx-tdep.c (tilegx_push_dummy_call): Use gdb::byte_vector.
2017-09-29 Tom Tromey <tom@tromey.com>
numargs = 0;
while (1)
{
- char *addr_string;
- struct cleanup *cleanup;
const char *p;
/* Skip leading white space, bail of EOL. */
for (p = frame_exp;
*p && !ISSPACE (*p);
p++);
- addr_string = savestring (frame_exp, p - frame_exp);
+ std::string addr_string (frame_exp, p - frame_exp);
frame_exp = p;
- cleanup = make_cleanup (xfree, addr_string);
/* NOTE: Parse and evaluate expression, but do not use
functions such as parse_and_eval_long or
side-effects. */
if (numargs >= ARRAY_SIZE (args))
error (_("Too many args in frame specification"));
- args[numargs++] = parse_and_eval (addr_string);
-
- do_cleanups (cleanup);
+ args[numargs++] = parse_and_eval (addr_string.c_str ());
}
}
const char *pc_regname;
int selected_frame_p;
struct gdbarch *gdbarch;
- struct cleanup *back_to = make_cleanup (null_cleanup, NULL);
CORE_ADDR frame_pc;
int frame_pc_p;
/* Initialize it to avoid "may be used uninitialized" warning. */
func = get_frame_function (fi);
symtab_and_line sal = find_frame_sal (fi);
s = sal.symtab;
+ gdb::unique_xmalloc_ptr<char> func_only;
if (func)
{
funname = SYMBOL_PRINT_NAME (func);
stored in the symbol table, but we stored a version
with DMGL_PARAMS turned on, and here we don't want to
display parameters. So remove the parameters. */
- char *func_only = cp_remove_params (funname);
+ func_only.reset (cp_remove_params (funname));
if (func_only)
- {
- funname = func_only;
- make_cleanup (xfree, func_only);
- }
+ funname = func_only.get ();
}
}
else if (frame_pc_p)
if (count || need_nl)
puts_filtered ("\n");
}
-
- do_cleanups (back_to);
}
/* Print briefly all stack frames or just the innermost COUNT_EXP