From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1372 invoked by alias); 25 Apr 2006 20:40:18 -0000 Received: (qmail 1363 invoked by uid 22791); 25 Apr 2006 20:40:17 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 25 Apr 2006 20:40:11 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k3PKdaTO031452; Tue, 25 Apr 2006 22:39:36 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6) with ESMTP id k3PKdafi030998; Tue, 25 Apr 2006 22:39:36 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k3PKdaZ5020227; Tue, 25 Apr 2006 22:39:36 +0200 (CEST) Date: Tue, 25 Apr 2006 20:40:00 -0000 Message-Id: <200604252039.k3PKdaZ5020227@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: gdb-patches@sourceware.org Subject: single-step breakpoints Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00340.txt.bz2 Hi Daniel, There a slight problem with insert_single_step_breakpoint() and remove_single_step_breakpoints(). On OpenBSD, inserting a breakpoint into the kernel-provided signal trampoline, may fail. Unfortunately, the caller of insert_single_step_breakpoint() never notices this, and calls remove_single_step_breakpoints() to remove the breakpoints. Unfortunately that makes us hit the gdb_assert() in there. This patch makes us avoid this while still making an attempt to catch misuse of the interface. Index: ChangeLog from Mark Kettenis * breakpoint.c (remove_single_step_breakpoints): Bail out early if no breakpoints are inserted. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.225 diff -u -p -r1.225 breakpoint.c --- breakpoint.c 18 Apr 2006 19:20:06 -0000 1.225 +++ breakpoint.c 25 Apr 2006 20:03:21 -0000 @@ -7726,6 +7726,9 @@ insert_single_step_breakpoint (CORE_ADDR void remove_single_step_breakpoints (void) { + if (single_step_breakpoints[0] == NULL && single_step_breakpoints[1] == NULL) + return; + gdb_assert (single_step_breakpoints[0] != NULL); /* See insert_single_step_breakpoint for more about this deprecated