From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32245 invoked by alias); 24 Feb 2014 06:47:26 -0000 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 Received: (qmail 32234 invoked by uid 89); 24 Feb 2014 06:47:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Feb 2014 06:47:23 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WHpJt-0001BQ-MJ from Yao_Qi@mentor.com ; Sun, 23 Feb 2014 22:47:17 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 23 Feb 2014 22:47:17 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Sun, 23 Feb 2014 22:46:17 -0800 Message-ID: <530AEA6C.8050002@codesourcery.com> Date: Mon, 24 Feb 2014 06:47:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: CC: Subject: Re: [Windows]Fix a bug which cause GDB.exe assert when try to run the inferior References: <530612A8.4000903@gmail.com> <5306A9BC.4080701@codesourcery.com> <5306EE2A.2060103@gmail.com> <5306FA43.1070408@codesourcery.com> <83sirc532m.fsf@gnu.org> <530706DD.8060605@codesourcery.com> In-Reply-To: <530706DD.8060605@codesourcery.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00719.txt.bz2 On 02/21/2014 03:57 PM, Yao Qi wrote: > On 02/21/2014 03:37 PM, Eli Zaretskii wrote: >>> Date: Fri, 21 Feb 2014 15:03:31 +0800 >>> From: Yao Qi >>> CC: >>> >>> 2014-02-21 Yuanhui Zhang >>> >>> * windows-nat.c (windows_xfer_shared_libraries): Return >>> TARGET_XFER_EOF if LEN is zero. >> >> Indeed. May I also suggest to point to the details of the underlying >> problem, or include its summary, in the ChangeLog entry? >> > > I prefer to put the details of the underlying problem in commit log, > but I am fine to include its summary in the ChangeLog entry. > > How about this? > > In commit log: > > A GDB internal error is found on native mingw32 target. > > (gdb) run > ../../binutils-gdb/gdb/target.c:1483: internal-error: > target_xfer_partial: Assertion `*xfered_len > 0' failed. > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Quit this debugging session? (y or n) > > This error was introduced by the following snippet in commit > 9b409511d07fe375284701af34909fb539029caf > >> @@ -2536,27 +2538,30 @@ windows_xfer_shared_libraries (struct target_ops *ops, >> } >> >> obstack_free (&obstack, NULL); >> - return len; >> + *xfered_len = (ULONGEST) len; >> + return TARGET_XFER_OK; >> } > > In the original code, len is returned, which could be 0, but after that > commit, only TARGET_XFER_OK is returned, which is wrong. If len is 0, > TARGET_XFER_EOF should be returned. (it is 0 in enum > target_xfer_status declaration). > > gdb: > > 2014-02-21 Yuanhui Zhang > > * windows-nat.c (windows_xfer_shared_libraries): Return > TARGET_XFER_EOF if LEN is zero to fix an assert failure when > requested object is TARGET_OBJECT_LIBRARIES. > Please update your patch to replace "len ?" with "len != 0 ?" and commit log we discussed here. You can push it in. Let me know if you don't have a commit access or have trouble on committing, I can commit this patch for you. -- Yao (齐尧)