summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.hp/attach2.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@apple.com>1999-04-16 01:35:26 +0000
committerStan Shebs <shebs@apple.com>1999-04-16 01:35:26 +0000
commit14cd51f7793a9ce07bc435069f57269450141363 (patch)
tree280a2da48f771d61be5b451ddbacdf9ef8e9ad13 /gdb/testsuite/gdb.hp/attach2.c
downloadgdb-14cd51f7793a9ce07bc435069f57269450141363.tar.gz
Initial revision
Diffstat (limited to 'gdb/testsuite/gdb.hp/attach2.c')
-rw-r--r--gdb/testsuite/gdb.hp/attach2.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.hp/attach2.c b/gdb/testsuite/gdb.hp/attach2.c
new file mode 100644
index 00000000000..8eb7a056746
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/attach2.c
@@ -0,0 +1,23 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
+ is exited when & if the variable 'should_exit' is non-zero. (It
+ is initialized to zero in this program, so the loop will never
+ exit unless/until gdb sets the variable to non-zero.)
+ */
+#include <stdio.h>
+#include <stdlib.h>
+
+int should_exit = 0;
+
+main ()
+{
+ int local_i = 0;
+
+ sleep( 10 ); /* System call causes register fetch to fail */
+ /* This is a known HPUX "feature" */
+ while (! should_exit)
+ {
+ local_i++;
+ }
+ return (0);
+}