This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] new GDB server testcase


Daniel,


> > +gdb_test "step" "function4.*at .*$srcfile:\[0-9\]+.*"
> > +
> > +gdb_test "step 3" ".*${decimal}.*y = x.* y;.*"
>
> That's a lot of wildcards.  Can't you put a marker comment on the lines
> you want to reach?
>

I want to test vanilla step and step with value separately, this is why I
did what I did. Also, I referred some of the existing testcases and
followed the style of doing things there. Anyways here is the patch with
most of the mods.

2005-05-05  Manoj Iyer  <manjo@austin.ibm.com>

        * gdb.server/server-run.exp: Added new testcases
        * gdb.server/server.c: Added nested function call for backtrace
        testing.

Common subdirectories: ./new/src/gdb/testsuite/gdb.server/CVS and ./old/src/gdb/testsuite/gdb.server/CVS
diff ./new/src/gdb/testsuite/gdb.server/server-run.exp ./old/src/gdb/testsuite/gdb.server/server-run.exp
41d40
< # test setting a breakpoint
43,65c42
<
< gdb_test "continue" ".*Continuing\\..*Breakpoint \[0-9\]+, main.*at.*$srcfile:\[0-9\].*"
<
< # test if list command displays source code
< gdb_test "list\n" ".*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\]+"
<
< # test vanilla step
< gdb_test "step" "function4.*at .*$srcfile:\[0-9\]+.*"
<
< # test step with a count
< gdb_test "step 3" ".*${decimal}.*y = x.* y;.*"
<
< # test if print command can display value of variable.
< gdb_test "print x" ".\[0-9\]* = 3.*"
<
< gdb_exit
---
> gdb_test "continue" "Breakpoint.* main .*" "continue to main"
diff ./new/src/gdb/testsuite/gdb.server/server.c ./old/src/gdb/testsuite/gdb.server/server.c
20,52d19
< static void
< function4()
< {
<
<    int x = 1;
<    int y = 2;
<
<    x = x + y;
<    y = x * y;
<    return;
< }
<
<
< static void
< function3()
< {
<    function4();
< }
<
<
< static void
< function2()
< {
<     function3();
< }
<
<
< static void
< function1()
< {
<     function2();
< }
<
56,57c23
<     function1();
<     return 0;
---
>   return 0;


Thanks
Manjo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]