aboutsummaryrefslogtreecommitdiff
path: root/gdb/i960-pinsn.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-07-10 01:35:53 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-07-10 01:35:53 +0000
commit34df79fc9d631a7cacdb2f9a9e12d5e3f8c6dd1c (patch)
tree90f72ebb31b2efb141be6ccc518e56eb37b0a701 /gdb/i960-pinsn.c
parentec1c752b34daada508decf3f978f0796f6008f77 (diff)
downloadgdb-34df79fc9d631a7cacdb2f9a9e12d5e3f8c6dd1c.zip
gdb-34df79fc9d631a7cacdb2f9a9e12d5e3f8c6dd1c.tar.gz
gdb-34df79fc9d631a7cacdb2f9a9e12d5e3f8c6dd1c.tar.bz2
* findvar.c, defs.h
({extract,store}_{signed_integer,unsigned_integer,address}): New routines to replace SWAP_TARGET_AND_HOST. All over: All uses of SWAP_TARGET_AND_HOST on integers replaced.
Diffstat (limited to 'gdb/i960-pinsn.c')
-rw-r--r--gdb/i960-pinsn.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gdb/i960-pinsn.c b/gdb/i960-pinsn.c
index 65446af..941a45c 100644
--- a/gdb/i960-pinsn.c
+++ b/gdb/i960-pinsn.c
@@ -135,17 +135,16 @@ next_insn (memaddr, pword1, pword2)
CORE_ADDR memaddr;
{
int len;
- unsigned long buf[2];
+ char buf[8];
/* Read the two (potential) words of the instruction at once,
to eliminate the overhead of two calls to read_memory ().
- TODO: read more instructions at once and cache them. */
+ FIXME: Loses if the first one is readable but the second is not
+ (e.g. last word of the segment). */
- read_memory (memaddr, buf, sizeof (buf));
- *pword1 = buf[0];
- SWAP_TARGET_AND_HOST (pword1, sizeof (long));
- *pword2 = buf[1];
- SWAP_TARGET_AND_HOST (pword2, sizeof (long));
+ read_memory (memaddr, buf, 8);
+ *pword1 = extract_unsigned_integer (buf, 4);
+ *pword2 = extract_unsigned_integer (buf + 4, 4);
/* Divide instruction set into classes based on high 4 bits of opcode*/