From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17476 invoked by alias); 12 Apr 2012 04:35:19 -0000 Received: (qmail 17465 invoked by uid 22791); 12 Apr 2012 04:35:17 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vb0-f41.google.com (HELO mail-vb0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Apr 2012 04:35:04 +0000 Received: by vbbey12 with SMTP id ey12so1363326vbb.0 for ; Wed, 11 Apr 2012 21:35:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=9pX114TpK+ssZAewNCZdZ2fCeG98WSgMsDfBP6cHX4k=; b=BXDmh7To8ow0GEUc608SKThCDq3QycRTGDICXWvfYQMMQyPx1OTIPgzxlwqSQQYSzw JrbKTo/sl7ZJcwxw74y5o6VYA554s81/TwqDR3Vwrz3oIsVLCWLEREuSRQt+8g2FQhtr hCkFiMIUgtKO6RGd7FgLbWWumMDTifTDMFRNymT2gs8iT7l0GiUodCV4DfKJdG1bDYXG ro1qXdO7g8zUsDS38jPf5yn0CYWt/OUOd1NVNsC1BwZlwIAvVTOfzUEcj+YfDqFonBEW 0Ck08lD1YqG5YNQ0mSBQcaujppB70kRspTa/lNE1Plph/ETCevkzIHibLZitHGATPEdt +vzg== Received: by 10.52.180.38 with SMTP id dl6mr403076vdc.105.1334205303743; Wed, 11 Apr 2012 21:35:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.180.38 with SMTP id dl6mr403067vdc.105.1334205303576; Wed, 11 Apr 2012 21:35:03 -0700 (PDT) Received: by 10.220.7.74 with HTTP; Wed, 11 Apr 2012 21:35:03 -0700 (PDT) In-Reply-To: <20120411203549.GA4715@host2.jankratochvil.net> References: <4F8549BC.3050003@mentor.com> <20120411203549.GA4715@host2.jankratochvil.net> Date: Thu, 12 Apr 2012 04:45:00 -0000 Message-ID: Subject: Re: [PATCH] breakpoint remove fail handle bug fix From: Doug Evans To: Jan Kratochvil Cc: Hui Zhu , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQmFMdWKkKQir0dmtg+KMsjmvk+E75pYhySbKRlikh2mgNIDzCRMTgJtYOAJkF6BExJh8COrWiEbTRjNR5/mRYtOkF1JIcEbEZsvRps6Cc3UNJ7KSi3WtgqFJZ/kWYPGNxIkDGWoqUhtqwJUQjV1+ATGNpgg4Q== 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: 2012-04/txt/msg00274.txt.bz2 On Wed, Apr 11, 2012 at 1:35 PM, Jan Kratochvil wrote: > On Wed, 11 Apr 2012 11:07:08 +0200, Hui Zhu wrote: >> (gdb) d >> Delete all breakpoints? (y or n) y >> warning: Error removing breakpoint 2 > > I would propose the attached patch instead. > > It needs a testcase, would you write one? > > Not sure if gdbserver also needs a fix or not. > > No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu. > > > Thanks, > Jan > > > gdb/ > 2012-04-11 =A0Jan Kratochvil =A0 > > =A0 =A0 =A0 =A0* linux-nat.c (linux_proc_xfer_partial): Do not check for = LEN size and > =A0 =A0 =A0 =A0support also WRITEBUF. > =A0 =A0 =A0 =A0(linux_xfer_partial): Move here the LEN check from > =A0 =A0 =A0 =A0linux_proc_xfer_partial but also call linux_proc_xfer_part= ial as a last > =A0 =A0 =A0 =A0resort if super_xfer_partial fails. fwiw, This comment: + /* PTRACE_* of super_xfer_partial may not work if the inferior is runnin= g. + linux_proc_xfer_partial still may work in such case. */ is not sufficient, to me anyway, to tell me why the code is the way it is. [E.g., *why* is it important that the write succeed?] The reader of the code a year from now will have no idea of connection between this code and breakpoint handling issues. [Setting aside the fact that recording an operation as having succeeded when it did not (and even knowing it did not) is just asking for recurring trouble, and any patch that doesn't fix that underlying problem is just papering over the real problem.]