This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Patch: Enable target "stop" for RDI
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: Patch: Enable target "stop" for RDI
- From: Grant Edwards <grante at visi dot com>
- Date: Fri, 25 Aug 2000 11:17:41 -0500
The attached patch agains 5.0 sources addsa to_stop() method to
the rdi target, and calls ui_loop_hook() while target is
executing. These changes are required for the "stop" button in
the Insight GUI to work.
--
Grant Edwards
grante@visi.com
diff -Naur insight-5.0/gdb/rdi-share/ardi.c insight-5.0-mod/gdb/rdi-share/ardi.c
--- insight-5.0/gdb/rdi-share/ardi.c Mon Jan 17 18:54:36 2000
+++ insight-5.0-mod/gdb/rdi-share/ardi.c Thu Aug 24 13:09:01 2000
@@ -396,6 +396,7 @@
static bool boot_interrupted = FALSE;
static volatile bool interrupt_request = FALSE;
+static volatile bool stop_request = FALSE;
static void ardi_sigint_handler(int sig) {
#ifdef DEBUG
@@ -1343,10 +1344,16 @@
Packet *packet );
#endif
+void angel_RDI_stop_request(void)
+{
+ stop_request = 1;
+}
+
/* Core functionality for execute and step */
static int angel_RDI_ExecuteOrStep(PointHandle *handle, word type,
unsigned ninstr)
{
+ extern int (*ui_loop_hook) (int);
int err;
adp_stopped_struct stopped_info;
void* stateptr = (void *)&stopped_info;
@@ -1401,15 +1408,22 @@
angel_DebugPrint("Waiting for program to finish...\n");
#endif
+ interrupt_request = FALSE;
+ stop_request = FALSE;
+
signal(SIGINT, ardi_sigint_handler);
while( executing )
{
- if (interrupt_request)
+ if (ui_loop_hook)
+ ui_loop_hook(0);
+
+ if (interrupt_request || stop_request)
{
interrupt_target();
interrupt_request = FALSE;
+ stop_request = FALSE;
}
- Adp_AsynchronousProcessing( async_block_on_nothing );
+ Adp_AsynchronousProcessing( async_block_on_nothing );
}
signal(SIGINT, SIG_IGN);
diff -Naur insight-5.0/gdb/rdi-share/ardi.h insight-5.0-mod/gdb/rdi-share/ardi.h
--- insight-5.0/gdb/rdi-share/ardi.h Thu Apr 15 20:34:27 1999
+++ insight-5.0-mod/gdb/rdi-share/ardi.h Thu Aug 24 12:47:30 2000
@@ -60,6 +60,8 @@
int angel_RDI_execute(PointHandle *handle);
+void angel_RDI_stop_request(void);
+
int angel_RDI_step(unsigned ninstr, PointHandle *handle);
int angel_RDI_info(unsigned type, ARMword *arg1, ARMword *arg2);
diff -Naur insight-5.0/gdb/remote-rdi.c insight-5.0-mod/gdb/remote-rdi.c
--- insight-5.0/gdb/remote-rdi.c Wed Mar 1 05:25:51 2000
+++ insight-5.0-mod/gdb/remote-rdi.c Fri Aug 25 10:44:03 2000
@@ -972,6 +972,12 @@
return TARGET_SIGNAL_UNKNOWN;
}
}
+
+static void arm_rdi_stop(void)
+{
+ angel_RDI_stop_request();
+}
+
/* Define the target operations structure. */
@@ -987,6 +993,7 @@
arm_rdi_ops.to_detach = arm_rdi_detach;
arm_rdi_ops.to_resume = arm_rdi_resume;
arm_rdi_ops.to_wait = arm_rdi_wait;
+ arm_rdi_ops.to_stop = arm_rdi_stop;
arm_rdi_ops.to_fetch_registers = arm_rdi_fetch_registers;
arm_rdi_ops.to_store_registers = arm_rdi_store_registers;
arm_rdi_ops.to_prepare_to_store = arm_rdi_prepare_to_store;