This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug breakpoints/15180] Agent style dprintf does not respect conditions
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 02 Jun 2014 22:32:51 +0000
- Subject: [Bug breakpoints/15180] Agent style dprintf does not respect conditions
- Auto-submitted: auto-generated
- References: <bug-15180-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=15180
--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, master has been updated
via 41fac0cf495b84994046901e3293d54e8eef3534 (commit)
via cd1608cc4ed6e657deb405283011a6c2a795fb80 (commit)
via 0a261ed82e9b5f6fbc3725258a742515df8f4b42 (commit)
from 96ae5695ce2512600524915ace0bfef95a9734fc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=41fac0cf495b84994046901e3293d54e8eef3534
commit 41fac0cf495b84994046901e3293d54e8eef3534
Author: Pedro Alves <palves@redhat.com>
Date: Mon Jun 2 22:27:33 2014 +0100
Installing a breakpoint on top of a dprintf makes GDB lose control.
While the full fix for PR 15180 isn't in, it's best if we at least
make sure that GDB doesn't lose control when a breakpoint is set at
the same address as a dprintf.
gdb/
2014-06-02 Pedro Alves <palves@redhat.com>
* breakpoint.c (build_target_command_list): Don't build a command
list if we have any duplicate location that isn't a dprintf.
gdb/testsuite/
2014-06-02 Pedro Alves <palves@redhat.com>
* gdb.base/dprintf-bp-same-addr.c: New file.
* gdb.base/dprintf-bp-same-addr.exp: New file.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cd1608cc4ed6e657deb405283011a6c2a795fb80
commit cd1608cc4ed6e657deb405283011a6c2a795fb80
Author: Pedro Alves <palves@redhat.com>
Date: Mon Jun 2 22:27:32 2014 +0100
dprintf-style agent can't explain a trap.
If some event happens to trigger at the same address as a dprintf-style
agent dprintf is installed, GDB will complain, like:
(gdb) continue
Continuing.
May only run agent-printf on the target
(gdb)
Such dprintfs are completely handled on the target side, so they can't
explain a stop, but GDB is currently putting then on the bpstat chain
anyway, because they currently unconditionally use bkpt_breakpoint_hit
as breakpoint_hit method.
gdb/
2014-06-02 Pedro Alves <palves@redhat.com>
* breakpoint.c (dprintf_breakpoint_hit): New function.
(initialize_breakpoint_ops): Install it as dprintf's
breakpoint_hit method.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0a261ed82e9b5f6fbc3725258a742515df8f4b42
commit 0a261ed82e9b5f6fbc3725258a742515df8f4b42
Author: Pedro Alves <palves@redhat.com>
Date: Mon Jun 2 22:27:32 2014 +0100
gdbserver: on GDB breakpoint reinsertion, also delete the breakpoint's
commands.
If GDB decides to change the breakpoint's conditions or commands,
it'll reinsert the same breakpoint again, with the new options
attached, without deleting the previous breakpoint. E.g.,
(gdb) set breakpoint always-inserted on
(gdb) b main if 0
Breakpoint 1 at 0x400594: file foo.c, line 21.
Sending packet: $Z0,400594,1;X3,220027#68...Packet received: OK
(gdb) b main
Breakpoint 15 at 0x400594: file foo.c, line 21.
Sending packet: $Z0,400594,1#49...Packet received: OK
GDBserver understands this and deletes the breakpoint's previous
conditions. But, it forgets to delete the previous commands.
gdb/gdbserver/
2014-06-02 Pedro Alves <palves@redhat.com>
* ax.c (gdb_free_agent_expr): New function.
* ax.h (gdb_free_agent_expr): New declaration.
* mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
list.
(clear_breakpoint_conditions, clear_breakpoint_commands): Make
static.
(clear_breakpoint_conditions_and_commands): New function.
* mem-break.h (clear_breakpoint_conditions): Delete declaration.
(clear_breakpoint_conditions_and_commands): New declaration.
-----------------------------------------------------------------------
Summary of changes:
gdb/ChangeLog | 11 ++++
gdb/breakpoint.c | 38 ++++++++++++--
gdb/gdbserver/ChangeLog | 12 ++++
gdb/gdbserver/ax.c | 10 ++++
gdb/gdbserver/ax.h | 3 +
gdb/gdbserver/mem-break.c | 43 +++++++++++++--
gdb/gdbserver/mem-break.h | 5 +-
gdb/gdbserver/server.c | 2 +-
gdb/testsuite/ChangeLog | 5 ++
gdb/testsuite/gdb.base/dprintf-bp-same-addr.c | 28 ++++++++++
gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp | 66 +++++++++++++++++++++++
11 files changed, 210 insertions(+), 13 deletions(-)
create mode 100644 gdb/testsuite/gdb.base/dprintf-bp-same-addr.c
create mode 100644 gdb/testsuite/gdb.base/dprintf-bp-same-addr.exp
--
You are receiving this mail because:
You are on the CC list for the bug.