#include "defs.h"
#include "compile-internal.h"
+#include "compile-c.h"
#include "compile.h"
#include "gdb-dlfcn.h"
#include "c-lang.h"
write_macro_definitions (const struct block *block, CORE_ADDR pc,
struct ui_file *file)
{
- struct macro_scope *scope;
+ gdb::unique_xmalloc_ptr<struct macro_scope> scope;
if (block != NULL)
scope = sal_macro_scope (find_pc_line (pc, 0));
and the user's code may only refer to globals. */
if (inst->scope != COMPILE_I_RAW_SCOPE)
{
- unsigned char *registers_used;
int i;
/* Generate the code to compute variable locations, but do it
before generating the function header, so we can define the
register struct before the function body. This requires a
temporary stream. */
- registers_used = generate_c_for_variable_locations (context,
- var_stream, gdbarch,
- expr_block, expr_pc);
- make_cleanup (xfree, registers_used);
+ gdb::unique_xmalloc_ptr<unsigned char> registers_used
+ = generate_c_for_variable_locations (context, var_stream, gdbarch,
+ expr_block, expr_pc);
buf.puts ("typedef unsigned int"
" __attribute__ ((__mode__(__pointer__)))"
mode, mode);
}
- generate_register_struct (&buf, gdbarch, registers_used);
+ generate_register_struct (&buf, gdbarch, registers_used.get ());
}
add_code_header (inst->scope, &buf);