This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] new GDB server testcase
- From: Daniel Jacobowitz <drow at false dot org>
- To: Manoj Iyer <manjo at austin dot ibm dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 4 May 2005 10:40:44 -0400
- Subject: Re: [RFC] new GDB server testcase
- References: <Pine.LNX.4.58.0505040918090.30511@lazy>
On Wed, May 04, 2005 at 09:24:20AM -0500, Manoj Iyer wrote:
>
> I wrote a testcase for testing basic gdbserver functionality over TCP
> connection. I will add more cases like step, print, etc once the testcase
> is approved.
Thanks for doing this.
Can you find a better name than "basictest.exp"? Is there a reason not
to add these basic tests to server-run.exp?
> /* File: test basic remote debug functionality through TCP connection. */
> /* Author: Manoj Iyer <manjo@austin.ibm.com> */
This needs a copyright notice.
> #include <stdio.h>
> #include <stdlib.h>
Why are you using stdio? We have no easy way to get at the program's
output.
>
> main()
> {
> printf("hello gdb\n");
> function1();
> }
That's not valid C, though many compilers will accept it. "int main"
and "return 0" please.
>
> ======================================================================
>
> ======================= basictest.exp ===============================
Please use server-run.exp as a template instead of whatever you were
using. For instance, use skip_gdbserver_tests, and don't use
gdb_suppress_entire_file.
> gdb_exit
> global gdbport
>
> set ret [gdbserver_spawn $binfile ""]
> set gdbport [lindex $ret 1]
>
> gdb_start
>
> send_gdb "file $binfile \n "
>
> gdb_target_cmd "remote" $gdbport
... and don't duplicate any of that. gdbserver_load. I went to a lot
of trouble to write the infrastructure, so please use it :-)
--
Daniel Jacobowitz
CodeSourcery, LLC