* [RFC] gdb.server testcase
@ 2005-05-17 2:34 Manoj Iyer
0 siblings, 0 replies; only message in thread
From: Manoj Iyer @ 2005-05-17 2:34 UTC (permalink / raw)
To: gdb-patches
Here is another attempt at a gdb.server testcase patch. Please review &
comment.
==================== server-run.exp =======================
--- ./old/src/gdb/testsuite/gdb.server/server-run.exp 2005-05-16 11:42:45.000000000 -0500
+++ ./new/src/gdb/testsuite/gdb.server/server-run.exp 2005-05-16 11:44:30.000000000 -0500
@@ -38,5 +38,21 @@ gdb_start
gdbserver_load $binfile ""
gdb_reinitialize_dir $srcdir/$subdir
+# test setting a breakpoint
gdb_breakpoint main
-gdb_test "continue" "Breakpoint.* main .*" "continue to main"
+
+gdb_test "continue" ".*Continuing\\..*Breakpoint \[0-9\], main.*at .*$srcfile:\[0-9\]+.*"
+
+# test if list command displays source code
+gdb_test "list" ".*main.*\{.*\}"
+
+# set breakpoint at a function and test backtrace command
+gdb_test "break function3" "Breakpoint 2 at.*file .*$srcfile, line \[0-9\]+."
+
+gdb_test "continue" ".*Continuing\\..*Breakpoint \[0-9\]+, function3.*at.*$srcfile:\[0-9\]+.*"
+
+gdb_test "backtrace" "\#0.*function3.*at.*server.c:\[0-9\]+.*\#1.*function2.*at.*server.c:\[0-9\]+.*\#2.*function1.*at.*server.c:\[0-9\]+.*\#3.*main.*at.*server.c:\[0-9\]+"
+
+gdb_test "step" ".*function4.*at.*server.c:\[0-9\]+.*;"
+
+gdb_test "step 2" ".*\[0-9\]+.*x = y;"
====================================================================
=================== server.c =========================
--- ./old/src/gdb/testsuite/gdb.server/server.c 2005-05-16 11:42:45.000000000 -0500
+++ ./new/src/gdb/testsuite/gdb.server/server.c 2005-05-16 11:44:17.000000000 -0500
@@ -17,8 +17,40 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
+static void
+function4()
+{
+ int x = 1;
+ int y = 2;
+
+ x = y;
+ return;
+}
+
+
+static void
+function3()
+{
+ function4();
+}
+
+
+static void
+function2()
+{
+ function3();
+}
+
+
+static void
+function1()
+{
+ function2();
+}
+
int
main (int argc, char **argv)
{
- return 0;
+ function1();
+ return 0;
}
=============================================================
Thanks
-----
manjo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Cogito ergo sum +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-05-16 17:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-17 2:34 [RFC] gdb.server testcase Manoj Iyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox