aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi/mi-syn-frame.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-02-02 05:51:09 +0000
committerAndrew Cagney <cagney@redhat.com>2003-02-02 05:51:09 +0000
commit075559bc196f31237cf09c3eda0757f493f4dc25 (patch)
tree9ef8613d89aaf077d9c5d9488ce001bfc183bfcb /gdb/testsuite/gdb.mi/mi-syn-frame.c
parent6789195b4218084c38719f3c44e09eaa8108fc12 (diff)
downloadgdb-075559bc196f31237cf09c3eda0757f493f4dc25.zip
gdb-075559bc196f31237cf09c3eda0757f493f4dc25.tar.gz
gdb-075559bc196f31237cf09c3eda0757f493f4dc25.tar.bz2
2003-02-01 Andrew Cagney <ac131313@redhat.com>
From 2002-11-09 Jason Molenda (jason-cl@molenda.com) * stack.c (print_frame_info_base): Output complete FRAME tuple for synthesized frames. 2003-02-01 Andrew Cagney <ac131313@redhat.com> From 2002-11-09 Jason Molenda (jason-cl@molenda.com): * gdb.mi/mi-syn-frame.exp: New tests for synthetic frames in stack backtraces. * gdb.mi/mi-syn-frame.c: Part of same.
Diffstat (limited to 'gdb/testsuite/gdb.mi/mi-syn-frame.c')
-rw-r--r--gdb/testsuite/gdb.mi/mi-syn-frame.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.c b/gdb/testsuite/gdb.mi/mi-syn-frame.c
new file mode 100644
index 0000000..83d2d46
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.c
@@ -0,0 +1,61 @@
+#include <signal.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+void foo (void);
+void bar (void);
+
+void subroutine (int);
+void handler (int);
+void have_a_very_merry_interrupt (void);
+
+main ()
+{
+ puts ("Starting up");
+
+ foo (); /* Put a breakpoint on foo() and call it to see a dummy frame */
+
+
+ have_a_very_merry_interrupt ();
+
+ puts ("Shutting down");
+}
+
+void
+foo (void)
+{
+ puts ("hi in foo");
+}
+
+void
+bar (void)
+{
+ char *nuller = 0;
+
+ puts ("hi in bar");
+
+ *nuller = 'a'; /* try to cause a segfault */
+}
+
+void
+handler (int sig)
+{
+ subroutine (sig);
+}
+
+void
+subroutine (int in)
+{
+ while (in < 100)
+ in++;
+}
+
+void
+have_a_very_merry_interrupt (void)
+{
+ puts ("Waiting to get a signal");
+ signal (SIGALRM, handler);
+ alarm (1);
+ sleep (2); /* We'll receive that signal while sleeping */
+}
+