From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18297 invoked by alias); 15 Oct 2003 00:15:11 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18062 invoked from network); 15 Oct 2003 00:15:04 -0000 Received: from unknown (HELO localhost.redhat.com) (65.49.0.121) by sources.redhat.com with SMTP; 15 Oct 2003 00:15:04 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 3CD592B89; Tue, 14 Oct 2003 20:14:52 -0400 (EDT) Message-ID: <3F8C917C.1080708@gnu.org> Date: Wed, 15 Oct 2003 00:15:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: RFA/RFC: vCont for the remote protocol [client] References: <20030929152831.GA23286@nevyn.them.org> <20030930211717.GB19869@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-10/txt/msg00480.txt.bz2 [I think my GNU e-mail is down] [I'm also having trouble reading this unified diff, so watch out :-)] +/* Check for the availability of vCont. This function should also check + the response. */ see below ... > static void > -remote_resume (ptid_t ptid, int step, enum target_signal siggnal) > +remote_vcont_probe (struct remote_state *rs, char *buf) > { > - struct remote_state *rs = get_remote_state (); > - char *buf = alloca (rs->remote_packet_size); > - int pid = PIDGET (ptid); > - char *p; > - > - if (pid == -1) > - set_thread (0, 0); /* run any thread */ > - else > - set_thread (pid, 0); /* run this thread */ > - > - last_sent_signal = siggnal; > - last_sent_step = step; > + strcpy (buf, "vCont?"); > + putpkt (buf); > + getpkt (buf, rs->remote_packet_size, 0); > + packet_ok (buf, &remote_protocol_vcont); > +} packet_ok will go through the path: /* The packet may or may not be OK. Just assume it is */ return PACKET_OK; Shouldn't remote_vcont_probe apply additional sanity checks. For instance that the response is well formed, and that all the letters [SCsc] appeared? If they are not all present, just mark the packet is not supported for now. (But also comment this). +static int +remote_vcont_resume (ptid_t ptid, int step, enum target_signal siggnal) What's the return value? +{ + struct remote_state *rs = get_remote_state (); + int pid = PIDGET (ptid); + char *buf = alloca (rs->remote_packet_size); Rather than ALLOCA here, can you ... + /* If we could generate a wider range of packets, we'd have to worry + about overflowing BUF. Should there be a generic + "multi-part-packet" packet? */ + + if (PIDGET (inferior_ptid) == MAGIC_NULL_PID) + { + /* MAGIC_NULL_PTID means that we don't have any active threads, so we + don't have any PID numbers the inferior will understand. Make sure + to only send forms that do not specify a PID. */ + if (step && siggnal != TARGET_SIGNAL_0) + sprintf (buf, "vCont;S%02x", siggnal); ... use XASPRINTF here (along with some sort of cleanup). Otherwize ok. Andrew