From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7969 invoked by alias); 28 Nov 2011 15:39:20 -0000 Received: (qmail 7894 invoked by uid 22791); 28 Nov 2011 15:39:18 -0000 X-SWARE-Spam-Status: No, hits=4.1 required=5.0 tests=AWL,BAYES_00,BOTNET,FROM_12LTRDOM,RDNS_DYNAMIC X-Spam-Check-By: sourceware.org Received: from bl22-166-20.dsl.telepac.pt (HELO localhost6.localdomain6) (2.83.166.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Nov 2011 15:39:02 +0000 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by localhost6.localdomain6 (8.14.4/8.14.4/Debian-2ubuntu1) with ESMTP id pASFcxBl017955 for ; Mon, 28 Nov 2011 15:38:59 GMT Subject: [RFC/WIP PATCH 01/14] Breakpoints always-inserted and the record target To: gdb-patches@sourceware.org From: Pedro Alves Date: Mon, 28 Nov 2011 15:39:00 -0000 Message-ID: <20111128153859.17761.87697.stgit@localhost6.localdomain6> In-Reply-To: <20111128153742.17761.21459.stgit@localhost6.localdomain6> References: <20111128153742.17761.21459.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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: 2011-11/txt/msg00761.txt.bz2 I tried running the testsuite with always-inserted forced on, and got a bunch of regressions on gdb.reverse/ with the record target. Breakpoints always-inserted and the record target don't play along well currently. E.g., if you set a breakpoint while recording, the breakpoint is installed in the live target. When the target stops, the breakpoint is left inserted (due to always-inserted). Now, if e.g., you rewind history, and replay, and the program needs to step over a breakpoint, infrun will try to remove the breakpoint temporarily to do the usual step-over-breakpoint dance. But, record.c is actually wired to ignore breakpoint insertions and removals when replaying. This means breakpoint.c now considers the breakpoint not-inserted, but the breakpoint insn is still planted on the target. If you set a new breakpoint at the same location, breakpoint.c (thinking there's no breakpoint inserted at that address), will happilly try to insert the new breakpoint, but, since the breakpoint insn from the other breakpoint is still planted in memory, breakpoint.c will think we're trying to set a breakpoint on top of a permanent breakpoint. Things go downhill from here. This happens e.g., sigall-reverse.exp. For now, simply disable always-inserted if record is on, exactly like we already disable displaced stepping. --- gdb/breakpoint.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index fa80018..37e177b 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -67,6 +67,7 @@ #include "continuations.h" #include "stack.h" #include "skip.h" +#include "record.h" /* readline include files */ #include "readline/readline.h" @@ -377,8 +378,9 @@ show_always_inserted_mode (struct ui_file *file, int from_tty, int breakpoints_always_inserted_mode (void) { - return (always_inserted_mode == always_inserted_on - || (always_inserted_mode == always_inserted_auto && non_stop)); + return ((always_inserted_mode == always_inserted_on + || (always_inserted_mode == always_inserted_auto && non_stop)) + && !RECORD_IS_USED); } void _initialize_breakpoint (void);