/* Disassemble support for GDB.
- Copyright (C) 2000-2020 Free Software Foundation, Inc.
+ Copyright (C) 2000-2021 Free Software Foundation, Inc.
This file is part of GDB.
if (mle1.start_pc != mle2.start_pc)
val = mle1.start_pc < mle2.start_pc;
else
- val = mle1.line < mle2.line;
+ val = mle1.line < mle2.line;
}
else
{
if (mle1.line != mle2.line)
val = mle1.line < mle2.line;
else
- val = mle1.start_pc < mle2.start_pc;
+ val = mle1.start_pc < mle2.start_pc;
}
return val;
}
std::string name, filename;
bool omit_fname = ((flags & DISASSEMBLY_OMIT_FNAME) != 0);
if (!build_address_symbolic (gdbarch, pc, false, omit_fname, &name,
- &offset, &filename, &line, &unmapped))
+ &offset, &filename, &line, &unmapped))
{
/* We don't care now about line, filename and unmapped. But we might in
the future. */
how_many, flags, NULL);
/* When we've reached the end of the mle array, or we've seen the last
- assembly range for this source line, close out the list/tuple. */
+ assembly range for this source line, close out the list/tuple. */
if (i == (newlines - 1) || mle[i + 1].line > mle[i].line)
{
inner_list_emitter.reset ();
disassemble_init_for_target (&m_di);
}
+gdb_disassembler::~gdb_disassembler ()
+{
+ disassemble_free_target (&m_di);
+}
+
int
gdb_disassembler::print_insn (CORE_ADDR memaddr,
int *branch_delay_insns)
gdb_buffered_insn_length_init_dis (gdbarch, &di, insn, max_len, addr,
&disassembler_options_holder);
- return gdbarch_print_insn (gdbarch, addr, &di);
+ int result = gdbarch_print_insn (gdbarch, addr, &di);
+ disassemble_free_target (&di);
+ return result;
}
char *