From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11503 invoked by alias); 2 Jun 2014 22:32:56 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 11327 invoked by uid 55); 2 Jun 2014 22:32:55 -0000 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/15180] Agent style dprintf does not respect conditions Date: Mon, 02 Jun 2014 22:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: teawater at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q2/txt/msg00361.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=15180 --- Comment #6 from 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 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 * 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 * 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 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 * 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 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 * 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.