This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] breakpoint remove fail handle bug fix


On Wed, Apr 11, 2012 at 1:35 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> 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 ?Jan Kratochvil ?<jan.kratochvil@redhat.com>
>
> ? ? ? ?* linux-nat.c (linux_proc_xfer_partial): Do not check for LEN size and
> ? ? ? ?support also WRITEBUF.
> ? ? ? ?(linux_xfer_partial): Move here the LEN check from
> ? ? ? ?linux_proc_xfer_partial but also call linux_proc_xfer_partial as a last
> ? ? ? ?resort if super_xfer_partial fails.

fwiw,
This comment:

+  /* PTRACE_* of super_xfer_partial may not work if the inferior is running.
+     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.]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]