aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-tdep.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/mips-tdep.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/mips-tdep.c')
-rw-r--r--gdb/mips-tdep.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 8da1f8a..136c0c1 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -178,12 +178,14 @@ heuristic_proc_desc(start_pc, limit_pc, next_frame)
restart:
frame_size = 0;
for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += 4) {
+ char buf[4];
unsigned long word;
int status;
- status = read_memory_nobpt (cur_pc, (char *)&word, 4);
- if (status) memory_error (status, cur_pc);
- SWAP_TARGET_AND_HOST (&word, sizeof (word));
+ status = read_memory_nobpt (cur_pc, buf, 4);
+ if (status) memory_error (status, cur_pc);
+ word = extract_unsigned_integer (buf, 4);
+
if ((word & 0xFFFF0000) == 0x27bd0000) /* addiu $sp,$sp,-i */
frame_size += (-word) & 0xFFFF;
else if ((word & 0xFFFF0000) == 0x23bd0000) /* addu $sp,$sp,-i */
@@ -636,8 +638,9 @@ mips_print_register (regnum, all)
{
long val;
- bcopy (raw_buffer, &val, sizeof (long));
- SWAP_TARGET_AND_HOST ((char *)&val, sizeof (long));
+ val = extract_signed_integer (raw_buffer,
+ REGISTER_RAW_SIZE (regnum));
+
if (val == 0)
printf_filtered ("0");
else if (all)