From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1120 invoked by alias); 9 Jul 2004 20:05:09 -0000 Mailing-List: contact rda-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: rda-owner@sources.redhat.com Received: (qmail 1100 invoked from network); 9 Jul 2004 20:05:08 -0000 Message-ID: <40EEFA70.7040806@redhat.com> Date: Fri, 09 Jul 2004 20:05:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.4.2) Gecko/20040301 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com, binutils@sources.redhat.com, rda@sources.redhat.com, Andrew Cagney Subject: [rfa] rda / samples: Allow multiple connections. Content-Type: multipart/mixed; boundary="------------080706090404020702030806" X-SW-Source: 2004-q3/txt/msg00002.txt.bz2 This is a multi-part message in MIME format. --------------080706090404020702030806 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 78 Allocate gdbserv_target only once, so that gdb can disconnect and reconnect. --------------080706090404020702030806 Content-Type: text/plain; name="diff4" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff4" Content-length: 1506 2004-07-09 Michael Snyder * samples/demo-target.c (demo_target): Call malloc only once, so that gdb can detach and re-attach repeatedly. Index: demo-target.c =================================================================== RCS file: /cvs/cvsfiles/devo/rda/samples/demo-target.c,v retrieving revision 1.19 diff -p -r1.19 demo-target.c *** demo-target.c 21 Aug 2002 22:43:14 -0000 1.19 --- demo-target.c 9 Jul 2004 19:54:04 -0000 *************** static struct gdbserv* sole_connection = *** 136,142 **** struct gdbserv_target * demo_target (struct gdbserv *serv, void *context) { ! struct gdbserv_target *target; if (sole_connection != NULL) { --- 161,167 ---- struct gdbserv_target * demo_target (struct gdbserv *serv, void *context) { ! static struct gdbserv_target *target = NULL; if (sole_connection != NULL) { *************** demo_target (struct gdbserv *serv, void *** 147,153 **** fprintf (stderr, "Accepted gdb connection.\n"); sole_connection = serv; ! target = malloc (sizeof (struct gdbserv_target)); memset (target, sizeof (*target), 0); /* Callback structure for function pointers that handle processed --- 172,179 ---- fprintf (stderr, "Accepted gdb connection.\n"); sole_connection = serv; ! if (target == NULL) ! target = malloc (sizeof (struct gdbserv_target)); memset (target, sizeof (*target), 0); /* Callback structure for function pointers that handle processed --------------080706090404020702030806--