diff options
author | Dave Brolley <brolley@redhat.com> | 2000-08-28 18:18:49 +0000 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2000-08-28 18:18:49 +0000 |
commit | 0e266e5cc57494a2f9fcb39fe4be615fdf4a9521 (patch) | |
tree | 5a2c2c316470728c45c864e8d8b9032dcc4c287d /sim/common | |
parent | 6bb95a0ff8ead058dbfff87384fd379f6f8aeb05 (diff) | |
download | gdb-0e266e5cc57494a2f9fcb39fe4be615fdf4a9521.zip gdb-0e266e5cc57494a2f9fcb39fe4be615fdf4a9521.tar.gz gdb-0e266e5cc57494a2f9fcb39fe4be615fdf4a9521.tar.bz2 |
2000-08-28 Dave Brolley <brolley@redhat.com>
* cgen-trace.c (sim_cgen_disassemble_insn): Make sure entire insn is
in insn_value if it will fit.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/ChangeLog | 5 | ||||
-rw-r--r-- | sim/common/cgen-trace.c | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index e69dccf..3f13ea6 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +2000-08-28 Dave Brolley <brolley@redhat.com> + + * cgen-trace.c (sim_cgen_disassemble_insn): Make sure entire insn is + in insn_value if it will fit. + 2000-08-21 Frank Ch. Eigler <fche@redhat.com> * Make-common.in, cgen.sh: Contribute CGEN-related build targets/rules. diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c index 4e382d4..8b084f4 100644 --- a/sim/common/cgen-trace.c +++ b/sim/common/cgen-trace.c @@ -354,6 +354,7 @@ sim_cgen_disassemble_insn (SIM_CPU *cpu, const CGEN_INSN *insn, const ARGBUF *abuf, IADDR pc, char *buf) { unsigned int length; + unsigned int base_length; unsigned long insn_value; struct disassemble_info disasm_info; SFILE sfile; @@ -380,7 +381,13 @@ sim_cgen_disassemble_insn (SIM_CPU *cpu, const CGEN_INSN *insn, length = sim_core_read_buffer (sd, cpu, read_map, &insn_buf, pc, insn_length); - switch (min (cd->base_insn_bitsize, insn_bit_length)) + /* If the entire insn will fit into an integer, then do it. Otherwise, just + use the bits of the base_insn. */ + if (insn_bit_length <= 32) + base_length = insn_bit_length; + else + base_length = min (cd->base_insn_bitsize, insn_bit_length); + switch (base_length) { case 0 : return; /* fake insn, typically "compile" (aka "invalid") */ case 8 : insn_value = insn_buf.bytes[0]; break; |