From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32166 invoked by alias); 20 Oct 2010 09:11:40 -0000 Received: (qmail 32155 invoked by uid 22791); 20 Oct 2010 09:11:39 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_FAIL X-Spam-Check-By: sourceware.org Received: from gate.lvk.cs.msu.su (HELO mail.lvk.cs.msu.su) (158.250.17.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Oct 2010 09:11:32 +0000 Received: from mail.lvk.cs.msu.su (localhost [127.0.0.1]) by mail.lvk.cs.msu.su (Postfix) with ESMTP id 785CB3E17; Wed, 20 Oct 2010 13:11:25 +0400 (MSD) X-Spam-ASN: Received: from thunder.localnet (gate.lvknet [192.168.128.254]) by mail.lvk.cs.msu.su (Postfix) with ESMTPSA id 64FD839F2; Wed, 20 Oct 2010 13:11:25 +0400 (MSD) From: Vladimir Prus To: Pedro Alves Subject: Re: Don't warn if target reports no threads Date: Wed, 20 Oct 2010 09:11:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-22-generic-pae; KDE/4.5.1; i686; ; ) Cc: gdb-patches@sourceware.org References: <201010191852.03421.vladimir@codesourcery.com> <201010191601.26042.pedro@codesourcery.com> In-Reply-To: <201010191601.26042.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_8IrvMMjjm2825z8" Message-Id: <201010201311.24935.vladimir@codesourcery.com> X-AV-Checked: ClamAV using ClamSMTP 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: 2010-10/txt/msg00314.txt.bz2 --Boundary-00=_8IrvMMjjm2825z8 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-length: 1010 On Tuesday, October 19, 2010 19:01:25 Pedro Alves wrote: > On Tuesday 19 October 2010 15:52:03, Vladimir Prus wrote: > > In the case when stub refuses to understand all modern thread-listing > > packets, GDB falls back to qL packet, if if stub refuses to handle that > > either, > > > > reports: > > RMT ERROR : failed to get remote thread list. > > > > The further operation continues normally, and qL is really optional > > packet, so there's no point scaring a user like that. Is the patch below > > OK? > > remote_get_threadlist has this: > > getpkt (&rs->buf, &rs->buf_size, 0); > > if (*rs->buf == '\0') > *result_count = 0; > else > ... > > would it work to just make that: > > if (*rs->buf == '\0') > return 0; > > instead? That'd be easier to read, and leave the warning if > something did go bust with the thread listing for targets > that do support the packet (not sure there are any though). This appears to work just fine. I've checked in the below patch. - Volodya --Boundary-00=_8IrvMMjjm2825z8 Content-Type: text/x-patch; charset="UTF-8"; name="ql.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ql.diff" Content-length: 1125 Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.12274 diff -u -p -r1.12274 ChangeLog --- ChangeLog 19 Oct 2010 21:30:53 -0000 1.12274 +++ ChangeLog 20 Oct 2010 09:10:22 -0000 @@ -1,3 +1,9 @@ +2010-10-20 Vladimir Prus + + * remote.c (remote_get_threadlist): If we got empty + response, bail out immediately, and don't emit any + warnings. + 2010-10-19 Ulrich Weigand * arm-tdep.c (thumb_get_next_pc_raw): Handle Thumb-16 encoding Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.422 diff -u -p -r1.422 remote.c --- remote.c 17 Oct 2010 18:24:47 -0000 1.422 +++ remote.c 20 Oct 2010 09:10:23 -0000 @@ -2353,7 +2353,7 @@ remote_get_threadlist (int startflag, th getpkt (&rs->buf, &rs->buf_size, 0); if (*rs->buf == '\0') - *result_count = 0; + return 0; else *result_count = parse_threadlist_response (rs->buf + 2, result_limit, &echo_nextthread, --Boundary-00=_8IrvMMjjm2825z8--