[ cgen/ChangeLog ]
2002-05-01 Graydon Hoare <graydon@redhat.com> * desc-cpu.scm (@arch@_cgen_cpu_close): Fix memory leaks. [ opcodes/ChangeLog ] 2002-05-07 Graydon Hoare <graydon@redhat.com> * cgen-dis.in: (print_insn_@arch@): Cache list of opened CPUs rather than just most-recently-opened.
This commit is contained in:
parent
40af4b0c8b
commit
748f46d42a
@ -1,3 +1,8 @@
|
|||||||
|
2002-05-07 Graydon Hoare <graydon@redhat.com>
|
||||||
|
|
||||||
|
* cgen-dis.in: (print_insn_@arch@): Cache list of opened CPUs rather
|
||||||
|
than just most-recently-opened.
|
||||||
|
|
||||||
2002-05-01 Alan Modra <amodra@bigpond.net.au>
|
2002-05-01 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* ppc-opc.c: Add "tlbsx." and "tlbsxe." for booke.
|
* ppc-opc.c: Add "tlbsx." and "tlbsxe." for booke.
|
||||||
|
@ -351,11 +351,21 @@ default_print_insn (cd, pc, info)
|
|||||||
Print one instruction from PC on INFO->STREAM.
|
Print one instruction from PC on INFO->STREAM.
|
||||||
Return the size of the instruction (in bytes). */
|
Return the size of the instruction (in bytes). */
|
||||||
|
|
||||||
|
typedef struct cpu_desc_list {
|
||||||
|
struct cpu_desc_list *next;
|
||||||
|
int isa;
|
||||||
|
int mach;
|
||||||
|
int endian;
|
||||||
|
CGEN_CPU_DESC cd;
|
||||||
|
} cpu_desc_list;
|
||||||
|
|
||||||
int
|
int
|
||||||
print_insn_@arch@ (pc, info)
|
print_insn_@arch@ (pc, info)
|
||||||
bfd_vma pc;
|
bfd_vma pc;
|
||||||
disassemble_info *info;
|
disassemble_info *info;
|
||||||
{
|
{
|
||||||
|
static cpu_desc_list *cd_list = 0;
|
||||||
|
cpu_desc_list *cl = 0;
|
||||||
static CGEN_CPU_DESC cd = 0;
|
static CGEN_CPU_DESC cd = 0;
|
||||||
static int prev_isa;
|
static int prev_isa;
|
||||||
static int prev_mach;
|
static int prev_mach;
|
||||||
@ -389,14 +399,23 @@ print_insn_@arch@ (pc, info)
|
|||||||
isa = info->insn_sets;
|
isa = info->insn_sets;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If we've switched cpu's, close the current table and open a new one. */
|
/* If we've switched cpu's, try to find a handle we've used before */
|
||||||
if (cd
|
if (cd
|
||||||
&& (isa != prev_isa
|
&& (isa != prev_isa
|
||||||
|| mach != prev_mach
|
|| mach != prev_mach
|
||||||
|| endian != prev_endian))
|
|| endian != prev_endian))
|
||||||
{
|
{
|
||||||
@arch@_cgen_cpu_close (cd);
|
|
||||||
cd = 0;
|
cd = 0;
|
||||||
|
for (cl = cd_list; cl; cl = cl->next)
|
||||||
|
{
|
||||||
|
if (cl->isa == isa &&
|
||||||
|
cl->mach == mach &&
|
||||||
|
cl->endian == endian)
|
||||||
|
{
|
||||||
|
cd = cl->cd;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we haven't initialized yet, initialize the opcode table. */
|
/* If we haven't initialized yet, initialize the opcode table. */
|
||||||
@ -418,6 +437,16 @@ print_insn_@arch@ (pc, info)
|
|||||||
CGEN_CPU_OPEN_END);
|
CGEN_CPU_OPEN_END);
|
||||||
if (!cd)
|
if (!cd)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
|
/* save this away for future reference */
|
||||||
|
cl = xmalloc (sizeof (struct cpu_desc_list));
|
||||||
|
cl->cd = cd;
|
||||||
|
cl->isa = isa;
|
||||||
|
cl->mach = mach;
|
||||||
|
cl->endian = endian;
|
||||||
|
cl->next = cd_list;
|
||||||
|
cd_list = cl;
|
||||||
|
|
||||||
@arch@_cgen_init_dis (cd);
|
@arch@_cgen_init_dis (cd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user