This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Fix inconsistent breakpoint kinds between breakpoints and tracepoints in GDBServer.
- From: Pedro Alves <palves at redhat dot com>
- To: Antoine Tremblay <antoine dot tremblay at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Thu, 22 Oct 2015 16:58:18 +0100
- Subject: Re: [PATCH v2] Fix inconsistent breakpoint kinds between breakpoints and tracepoints in GDBServer.
- Authentication-results: sourceware.org; auth=none
- References: <5628FE0C dot 5090309 at redhat dot com> <1445529414-11581-1-git-send-email-antoine dot tremblay at ericsson dot com>
On 10/22/2015 04:56 PM, Antoine Tremblay wrote:
> This patch fixes a regression introduced by :
> https://sourceware.org/ml/gdb-patches/2015-10/msg00369.html
>
> Tests : gdb.trace/trace-break.exp and gdb.trace/trace-mt.exp would fail on x86
> with gdbserver-{native,extended}.
>
> Before this patch, the breakpoint kind set by GDB with a Z packet and the one
> set in the case of a tracepoint would be inconsistent on targets that did not
> implement breakpoint_kind_from_pc. On x86 for example a breakpoint set by GDB
> would have a kind of 1 but a breakpoint set by a tracepoint would have a kind of
> 0.
>
> This created a missmatch when trying to insert a tracepoint and a breakpoint at
> the same location. One of the two breakpoints would be removed with debug
> message : "Inconsistent breakpoint kind".
>
> This patch fixes the issue by changing the default 0 breakpoint kind to be
> the size of the breakpoint according to sw_breakpoint_from_kind.
>
> The default breakpoint kind must be the breakpoint length to keep consistency
> between breakpoints set via GDB and the ones set internally by GDBServer.
>
> No regression on Ubuntu 14.04 x86-64 with gdbserver-{native-extended}
>
> gdb/gdbserver/ChangeLog:
>
> * linux-low.c (default_breakpoint_kind_from_pc): New function.
> (linux_breakpoint_kind_from_pc): Use default_breakpoint_kind_from_pc for
> the default breakpoint kind.
OK.
Thanks,
Pedro Alves