aboutsummaryrefslogtreecommitdiff
path: root/gdb/rdi-share
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/rdi-share')
-rw-r--r--gdb/rdi-share/ardi.c6
-rw-r--r--gdb/rdi-share/devsw.c30
-rw-r--r--gdb/rdi-share/devsw.h2
-rw-r--r--gdb/rdi-share/etherdrv.c7
4 files changed, 39 insertions, 6 deletions
diff --git a/gdb/rdi-share/ardi.c b/gdb/rdi-share/ardi.c
index f7a391e..d1dc191 100644
--- a/gdb/rdi-share/ardi.c
+++ b/gdb/rdi-share/ardi.c
@@ -392,6 +392,7 @@ static void (*old_handler)();
#endif
static bool boot_interrupted = FALSE;
+static volatile bool interrupt_request = FALSE;
static void ardi_sigint_handler(int sig) {
#ifdef DEBUG
@@ -401,6 +402,7 @@ static void ardi_sigint_handler(int sig) {
IGNORE(sig);
#endif
boot_interrupted = TRUE;
+ interrupt_request = TRUE;
#ifndef __unix
signal(SIGINT, ardi_sigint_handler);
#endif
@@ -1306,7 +1308,6 @@ static int HandleStoppedMessage(Packet *packet, void *stateptr) {
return RDIError_NoError;
}
-static volatile bool interrupt_request = FALSE;
static void interrupt_target( void )
{
@@ -1397,6 +1398,7 @@ static int angel_RDI_ExecuteOrStep(PointHandle *handle, word type,
angel_DebugPrint("Waiting for program to finish...\n");
#endif
+ signal(SIGINT, ardi_sigint_handler);
while( executing )
{
if (interrupt_request)
@@ -1406,6 +1408,8 @@ static int angel_RDI_ExecuteOrStep(PointHandle *handle, word type,
}
Adp_AsynchronousProcessing( async_block_on_nothing );
}
+ signal(SIGINT, SIG_IGN);
+
#ifdef TEST_DC_APPL
Adp_Install_DC_Appl_Handler( NULL );
diff --git a/gdb/rdi-share/devsw.c b/gdb/rdi-share/devsw.c
index b48c337..ea666a1 100644
--- a/gdb/rdi-share/devsw.c
+++ b/gdb/rdi-share/devsw.c
@@ -17,6 +17,7 @@
#include <string.h>
#include "adp.h"
+#include "sys.h"
#include "hsys.h"
#include "rxtx.h"
#include "drivers.h"
@@ -107,6 +108,7 @@ static void dumpPacket(FILE *fp, char *label, struct data_packet *p)
{
unsigned r;
int i;
+ unsigned char channel;
if (!fp)
return;
@@ -116,12 +118,14 @@ static void dumpPacket(FILE *fp, char *label, struct data_packet *p)
fprintf(fp,"%02x ",p->data[i]);
fprintf(fp,"\n");
+ channel = p->data[0];
+
r = WordAt(p->data+4);
fprintf(fp,"R=%08x ",r);
fprintf(fp,"%s ", r&0x80000000 ? "H<-T" : "H->T");
- switch ((r>>16) & 0xff)
+ switch (channel)
{
case CI_PRIVATE: fprintf(fp,"CI_PRIVATE: "); break;
case CI_HADP: fprintf(fp,"CI_HADP: "); break;
@@ -176,6 +180,28 @@ static void dumpPacket(FILE *fp, char *label, struct data_packet *p)
case ADP_Stopped: fprintf(fp," ADP_Stopped "); break;
case ADP_TDCC_ToHost: fprintf(fp," ADP_TDCC_ToHost "); break;
case ADP_TDCC_FromHost: fprintf(fp," ADP_TDCC_FromHost "); break;
+
+ case CL_Unrecognised: fprintf(fp," CL_Unrecognised "); break;
+ case CL_WriteC: fprintf(fp," CL_WriteC "); break;
+ case CL_Write0: fprintf(fp," CL_Write0 "); break;
+ case CL_ReadC: fprintf(fp," CL_ReadC "); break;
+ case CL_System: fprintf(fp," CL_System "); break;
+ case CL_GetCmdLine: fprintf(fp," CL_GetCmdLine "); break;
+ case CL_Clock: fprintf(fp," CL_Clock "); break;
+ case CL_Time: fprintf(fp," CL_Time "); break;
+ case CL_Remove: fprintf(fp," CL_Remove "); break;
+ case CL_Rename: fprintf(fp," CL_Rename "); break;
+ case CL_Open: fprintf(fp," CL_Open "); break;
+ case CL_Close: fprintf(fp," CL_Close "); break;
+ case CL_Write: fprintf(fp," CL_Write "); break;
+ case CL_WriteX: fprintf(fp," CL_WriteX "); break;
+ case CL_Read: fprintf(fp," CL_Read "); break;
+ case CL_ReadX: fprintf(fp," CL_ReadX "); break;
+ case CL_Seek: fprintf(fp," CL_Seek "); break;
+ case CL_Flen: fprintf(fp," CL_Flen "); break;
+ case CL_IsTTY: fprintf(fp," CL_IsTTY "); break;
+ case CL_TmpNam: fprintf(fp," CL_TmpNam "); break;
+
default: fprintf(fp," BadReason "); break;
}
@@ -410,7 +436,7 @@ AdpErrs DevSW_Match(const DeviceDescr *device, const char *name,
return (device->DeviceMatch(name, arg) == -1) ? adp_failed : adp_ok;
}
-AdpErrs DevSW_Close(const DeviceDescr *device, const DevChanID type)
+AdpErrs DevSW_Close (DeviceDescr *device, const DevChanID type)
{
DevSWState *ds = (DevSWState *)(device->SwitcherState);
Packet *pk;
diff --git a/gdb/rdi-share/devsw.h b/gdb/rdi-share/devsw.h
index 749e7e6..6a2279d 100644
--- a/gdb/rdi-share/devsw.h
+++ b/gdb/rdi-share/devsw.h
@@ -160,7 +160,7 @@ AdpErrs DevSW_Match(const DeviceDescr *device, const char *name,
* OK: adp_ok
* Error: adp_device_not_open
*/
-AdpErrs DevSW_Close(const DeviceDescr *device, const DevChanID type);
+AdpErrs DevSW_Close(DeviceDescr *device, const DevChanID type);
/*
* Function: DevSW_Read
diff --git a/gdb/rdi-share/etherdrv.c b/gdb/rdi-share/etherdrv.c
index d9c5c0f..b3156b2 100644
--- a/gdb/rdi-share/etherdrv.c
+++ b/gdb/rdi-share/etherdrv.c
@@ -266,9 +266,12 @@ static int open_socket(void)
static void fetch_ports(void)
{
int i;
- const char ctrlpacket[] = CTRL_MAGIC;
- CtrlResponse response;
+ char ctrlpacket[10];
+ CtrlResponse response;
+ memset (ctrlpacket, 0, 10);
+ strcpy (ctrlpacket, CTRL_MAGIC);
+ memset (response, 0, sizeof(CtrlResponse));
/*
* we will try 3 times to elicit a response from the target
*/