From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21967 invoked by alias); 7 Jul 2011 13:40:41 -0000 Received: (qmail 21950 invoked by uid 22791); 7 Jul 2011 13:40:40 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f54.google.com (HELO mail-fx0-f54.google.com) (209.85.161.54) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jul 2011 13:40:23 +0000 Received: by fxe4 with SMTP id 4so1112918fxe.13 for ; Thu, 07 Jul 2011 06:40:22 -0700 (PDT) Received: by 10.223.145.78 with SMTP id c14mr1252006fav.75.1310046022083; Thu, 07 Jul 2011 06:40:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.112.3 with HTTP; Thu, 7 Jul 2011 06:39:42 -0700 (PDT) In-Reply-To: <20110707091911.GA8747@host1.jankratochvil.net> References: <20110707091911.GA8747@host1.jankratochvil.net> From: Hui Zhu Date: Thu, 07 Jul 2011 13:46:00 -0000 Message-ID: Subject: Re: [RFA/tracepoint] Make GDB can work with some old GDB server To: Jan Kratochvil Cc: gdb-patches ml Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00235.txt.bz2 On Thu, Jul 7, 2011 at 17:19, Jan Kratochvil wr= ote: > On Fri, 24 Jun 2011 10:46:58 +0200, Hui Zhu wrote: >> Sending packet: $qTStatus#49...Ack >> Packet received: E22 >> trace API error 0x2. > [...] >> This is because this kgdb(I think trunk have fixed this bug) don't >> support qtstatus and reply -0x22. >> So gdb throw a error. =A0Then all connect process stop. > > Why not to just put it more close to the error invocation? =A0Still some = calls > to target_get_trace_status would remain unprotected otherwise. > > > Thanks, > Jan > > > gdb/ > 2011-07-07 =A0Jan Kratochvil =A0 > > =A0 =A0 =A0 =A0Work around kgdb. > =A0 =A0 =A0 =A0* remote.c (remote_get_trace_status): New variable ex. =A0= Put > =A0 =A0 =A0 =A0remote_get_noisy_reply into TRY_CATCH. =A0Call exception_f= printf for it. > > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -10045,11 +10045,21 @@ remote_get_trace_status (struct trace_status *t= s) > =A0 char *p; > =A0 /* FIXME we need to get register block size some other way. =A0*/ > =A0 extern int trace_regblock_size; > + =A0volatile struct gdb_exception ex; > > =A0 trace_regblock_size =3D get_remote_arch_state ()->sizeof_g_packet; > > =A0 putpkt ("qTStatus"); > - =A0p =3D remote_get_noisy_reply (&target_buf, &target_buf_size); > + > + =A0TRY_CATCH (ex, RETURN_MASK_ERROR) > + =A0 =A0{ > + =A0 =A0 =A0p =3D remote_get_noisy_reply (&target_buf, &target_buf_size); > + =A0 =A0} > + =A0if (ex.reason < 0) > + =A0 =A0{ > + =A0 =A0 =A0exception_fprintf (gdb_stderr, ex, "qTStatus: "); > + =A0 =A0 =A0return -1; > + =A0 =A0} > > =A0 /* If the remote target doesn't do tracing, flag it. =A0*/ > =A0 if (*p =3D=3D '\0') > Cool. This one is more better. I have reverted my patch. Suggest this patch can check in to both 7.3 and trunk. Thanks, Hui