aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparcl-tdep.c
diff options
context:
space:
mode:
authorMark Alexander <marka@cygnus>1998-04-15 00:25:58 +0000
committerMark Alexander <marka@cygnus>1998-04-15 00:25:58 +0000
commite50f526e68f36447f1e99fcfa79125b60a6b1a97 (patch)
treeb83bf8a486dea44db2f962535cef72e698fcb621 /gdb/sparcl-tdep.c
parent93f967158fdb53e468173f0a4947b3dd06442983 (diff)
downloadgdb-e50f526e68f36447f1e99fcfa79125b60a6b1a97.zip
gdb-e50f526e68f36447f1e99fcfa79125b60a6b1a97.tar.gz
gdb-e50f526e68f36447f1e99fcfa79125b60a6b1a97.tar.bz2
* sparc-tdep.c (sparc_extract_struct_value_address): Make it
work correctly on little-endian hosts. (sparc_push_arguments): New function. (gdb_print_insn_sparc): New function. (_initialize_sparc_tdep): Make gdb_print_insn_sparc the default disassembler, so that SPARClite-specific instructions will be recognized. * sparcl-tdep.c (readchar): Print debugging information. (debug_serial_write): New function, a replacement for SERIAL_WRITE that prints debugging information. * config/sparc/tm-sparc.h (PUSH_ARGUMENTS): Define. (sparc_push_arguments): Declare.
Diffstat (limited to 'gdb/sparcl-tdep.c')
-rw-r--r--gdb/sparcl-tdep.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/gdb/sparcl-tdep.c b/gdb/sparcl-tdep.c
index 10d3618..c590652 100644
--- a/gdb/sparcl-tdep.c
+++ b/gdb/sparcl-tdep.c
@@ -302,6 +302,7 @@ readchar (desc, timeout)
int timeout;
{
int ch;
+ char s[10];
ch = SERIAL_READCHAR (desc, timeout);
@@ -314,16 +315,42 @@ readchar (desc, timeout)
case SERIAL_TIMEOUT:
error ("SPARClite remote timeout");
default:
+ if (remote_debug > 0)
+ {
+ sprintf (s, "[%02x]", ch & 0xff);
+ puts_debug ("read -->", s, "<--");
+ }
return ch;
}
}
+static void
+debug_serial_write (desc, buf, len)
+ serial_t desc;
+ char *buf;
+ int len;
+{
+ char s[10];
+
+ SERIAL_WRITE (desc, buf, len);
+ if (remote_debug > 0)
+ {
+ while (len-- > 0)
+ {
+ sprintf (s, "[%02x]", *buf & 0xff);
+ puts_debug ("Sent -->", s, "<--");
+ buf++;
+ }
+ }
+}
+
+
static int
send_resp (desc, c)
serial_t desc;
char c;
{
- SERIAL_WRITE (desc, &c, 1);
+ debug_serial_write (desc, &c, 1);
return readchar (desc, 2);
}
@@ -659,7 +686,7 @@ sparclite_serial_start (entry)
buffer[0] = 0x03;
store_unsigned_integer (buffer + 1, 4, entry);
- SERIAL_WRITE (remote_desc, buffer, 1 + 4);
+ debug_serial_write (remote_desc, buffer, 1 + 4);
i = readchar (remote_desc, 2);
if (i != 0x55)
error ("Can't start SparcLite. Error code %d\n", i);
@@ -691,7 +718,7 @@ sparclite_serial_write (from_bfd, from_sec, from_addr, to_addr, len)
if (i != 0x5a)
error ("Bad response from load command (0x%x)", i);
- SERIAL_WRITE (remote_desc, buffer, 4 + 4 + len);
+ debug_serial_write (remote_desc, buffer, 4 + 4 + len);
i = readchar (remote_desc, 2);
if (i != checksum)