diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-07-10 01:35:53 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-07-10 01:35:53 +0000 |
commit | 34df79fc9d631a7cacdb2f9a9e12d5e3f8c6dd1c (patch) | |
tree | 90f72ebb31b2efb141be6ccc518e56eb37b0a701 /gdb/a29k-tdep.c | |
parent | ec1c752b34daada508decf3f978f0796f6008f77 (diff) | |
download | gdb-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/a29k-tdep.c')
-rw-r--r-- | gdb/a29k-tdep.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/gdb/a29k-tdep.c b/gdb/a29k-tdep.c index e07148f..42232ce 100644 --- a/gdb/a29k-tdep.c +++ b/gdb/a29k-tdep.c @@ -570,10 +570,9 @@ read_register_stack_integer (memaddr, len) CORE_ADDR memaddr; int len; { - long buf; - read_register_stack (memaddr, &buf, NULL, NULL); - SWAP_TARGET_AND_HOST (&buf, 4); - return buf; + char buf[4]; + read_register_stack (memaddr, buf, NULL, NULL); + return extract_signed_integer (buf, 4); } /* Copy 4 bytes from GDB memory at MYADDR into inferior memory @@ -647,9 +646,7 @@ get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp) { if (raw_buffer != NULL) { - *(CORE_ADDR *)raw_buffer = fi->frame; - /* Put it back in target byte order. */ - SWAP_TARGET_AND_HOST (raw_buffer, sizeof (CORE_ADDR)); + store_address (raw_buffer, REGISTER_RAW_BYTES (regnum), fi->frame); } if (lvalp != NULL) *lvalp = not_lval; @@ -659,9 +656,7 @@ get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp) { if (raw_buffer != NULL) { - *(CORE_ADDR *)raw_buffer = fi->pc; - /* Put it back in target byte order. */ - SWAP_TARGET_AND_HOST (raw_buffer, sizeof (CORE_ADDR)); + store_address (raw_buffer, REGISTER_RAW_BYTES (regnum), fi->pc); } /* Not sure we have to do this. */ @@ -676,9 +671,8 @@ get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp) { if (fi->next != NULL) { - *(CORE_ADDR *)raw_buffer = fi->next->saved_msp; - /* Put it back in target byte order. */ - SWAP_TARGET_AND_HOST (raw_buffer, sizeof (CORE_ADDR)); + store_address (raw_buffer, REGISTER_RAW_BYTES (regnum), + fi->next->saved_msp); } else read_register_gen (MSP_REGNUM, raw_buffer); |