diff options
author | Jason Molenda <jmolenda@apple.com> | 1999-12-07 03:56:43 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 1999-12-07 03:56:43 +0000 |
commit | c2d11a7da0372ef052af1c74d56e264d8aae4743 (patch) | |
tree | b2ceadb275bb9a170315ab66111c1f643c9ebf71 /gdb/arc-tdep.c | |
parent | 1e37c28164d4f504b2ae8189d0b82a862cfa323d (diff) | |
download | gdb-c2d11a7da0372ef052af1c74d56e264d8aae4743.zip gdb-c2d11a7da0372ef052af1c74d56e264d8aae4743.tar.gz gdb-c2d11a7da0372ef052af1c74d56e264d8aae4743.tar.bz2 |
import gdb-1999-12-06 snapshot
Diffstat (limited to 'gdb/arc-tdep.c')
-rw-r--r-- | gdb/arc-tdep.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index c8e4cc7..2a1f000 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -97,6 +97,7 @@ static unsigned int codestream_fill PARAMS ((int)); #define CODESTREAM_BUFSIZ 16 static CORE_ADDR codestream_next_addr; static CORE_ADDR codestream_addr; +/* FIXME assumes sizeof (int) == 32? */ static unsigned int codestream_buf[CODESTREAM_BUFSIZ]; static int codestream_off; static int codestream_cnt; @@ -124,16 +125,15 @@ codestream_fill (peek_flag) CODESTREAM_BUFSIZ * sizeof (codestream_buf[0])); /* FIXME: check return code? */ - /* Handle byte order differences. */ - if (HOST_BYTE_ORDER != TARGET_BYTE_ORDER) - { - register unsigned int i, j, n = sizeof (codestream_buf[0]); - register char tmp, *p; - for (i = 0, p = (char *) codestream_buf; i < CODESTREAM_BUFSIZ; - ++i, p += n) - for (j = 0; j < n / 2; ++j) - tmp = p[j], p[j] = p[n - 1 - j], p[n - 1 - j] = tmp; - } + + /* Handle byte order differences -> convert to host byte ordering. */ + { + int i; + for (i = 0; i < CODESTREAM_BUFSIZ; i++) + codestream_buf[i] = + extract_unsigned_integer (&codestream_buf[i], + sizeof (codestream_buf[i])); + } if (peek_flag) return codestream_peek (); |