From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14199 invoked by alias); 7 Jul 2011 09:19:41 -0000 Received: (qmail 14187 invoked by uid 22791); 7 Jul 2011 09:19:40 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jul 2011 09:19:16 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p679JFBP013467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Jul 2011 05:19:15 -0400 Received: from host1.jankratochvil.net (ovpn-113-91.phx2.redhat.com [10.3.113.91]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p679JDbV029293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 7 Jul 2011 05:19:15 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p679JCac014045; Thu, 7 Jul 2011 11:19:12 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p679JBG0014042; Thu, 7 Jul 2011 11:19:11 +0200 Date: Thu, 07 Jul 2011 11:35:00 -0000 From: Jan Kratochvil To: Hui Zhu Cc: gdb-patches ml Subject: Re: [RFA/tracepoint] Make GDB can work with some old GDB server Message-ID: <20110707091911.GA8747@host1.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00232.txt.bz2 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. Then all connect process stop. Why not to just put it more close to the error invocation? Still some calls to target_get_trace_status would remain unprotected otherwise. Thanks, Jan gdb/ 2011-07-07 Jan Kratochvil Work around kgdb. * remote.c (remote_get_trace_status): New variable ex. Put remote_get_noisy_reply into TRY_CATCH. Call exception_fprintf for it. --- a/gdb/remote.c +++ b/gdb/remote.c @@ -10045,11 +10045,21 @@ remote_get_trace_status (struct trace_status *ts) char *p; /* FIXME we need to get register block size some other way. */ extern int trace_regblock_size; + volatile struct gdb_exception ex; trace_regblock_size = get_remote_arch_state ()->sizeof_g_packet; putpkt ("qTStatus"); - p = remote_get_noisy_reply (&target_buf, &target_buf_size); + + TRY_CATCH (ex, RETURN_MASK_ERROR) + { + p = remote_get_noisy_reply (&target_buf, &target_buf_size); + } + if (ex.reason < 0) + { + exception_fprintf (gdb_stderr, ex, "qTStatus: "); + return -1; + } /* If the remote target doesn't do tracing, flag it. */ if (*p == '\0')