From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27238 invoked by alias); 6 Dec 2011 18:53:56 -0000 Received: (qmail 27229 invoked by uid 22791); 6 Dec 2011 18:53:55 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Dec 2011 18:53:42 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pB6IrEYW012724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Dec 2011 13:53:20 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pB6Ia0fi020989; Tue, 6 Dec 2011 13:36:00 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pB6IZxaR032420; Tue, 6 Dec 2011 13:35:59 -0500 From: Tom Tromey To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: creating the gdb-7.4 branch tomorrow (?) References: <20111205081911.GG28486@adacore.com> Date: Tue, 06 Dec 2011 18:54:00 -0000 In-Reply-To: <20111205081911.GG28486@adacore.com> (Joel Brobecker's message of "Mon, 5 Dec 2011 09:19:11 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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-12/txt/msg00191.txt.bz2 --=-=-= Content-Type: text/plain Content-length: 118 Here is patch #1, to remove bp_startup_disabled. It hasn't changed in a while, I'm sending it for completeness. Tom --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-remove-bp_startup_disabled.patch Content-Description: patch 1 Content-length: 4607 diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index c6b8e05..f0a351f 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1574,6 +1574,9 @@ should_be_inserted (struct bp_location *bl) if (!bl->enabled || bl->shlib_disabled || bl->duplicate) return 0; + if (user_breakpoint_p (bl->owner) && bl->pspace->executing_startup) + return 0; + /* This is set for example, when we're attached to the parent of a vfork, and have detached from the child. The child is running free, and we expect it to do an exec or exit, at which point the @@ -5341,8 +5344,7 @@ describe_other_breakpoints (struct gdbarch *gdbarch, printf_filtered (" (thread %d)", b->thread); printf_filtered ("%s%s ", ((b->enable_state == bp_disabled - || b->enable_state == bp_call_disabled - || b->enable_state == bp_startup_disabled) + || b->enable_state == bp_call_disabled) ? " (disabled)" : b->enable_state == bp_permanent ? " (permanent)" @@ -7009,53 +7011,15 @@ enable_watchpoints_after_interactive_call_stop (void) void disable_breakpoints_before_startup (void) { - struct breakpoint *b; - int found = 0; - - ALL_BREAKPOINTS (b) - { - if (b->pspace != current_program_space) - continue; - - if ((b->type == bp_breakpoint - || b->type == bp_hardware_breakpoint) - && breakpoint_enabled (b)) - { - b->enable_state = bp_startup_disabled; - found = 1; - } - } - - if (found) - update_global_location_list (0); - current_program_space->executing_startup = 1; + update_global_location_list (0); } void enable_breakpoints_after_startup (void) { - struct breakpoint *b; - int found = 0; - current_program_space->executing_startup = 0; - - ALL_BREAKPOINTS (b) - { - if (b->pspace != current_program_space) - continue; - - if ((b->type == bp_breakpoint - || b->type == bp_hardware_breakpoint) - && b->enable_state == bp_startup_disabled) - { - b->enable_state = bp_enabled; - found = 1; - } - } - - if (found) - breakpoint_re_set (); + breakpoint_re_set (); } @@ -7344,11 +7308,6 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, "tracepoint marker to probe")); } - if (enabled && b->pspace->executing_startup - && (b->type == bp_breakpoint - || b->type == bp_hardware_breakpoint)) - b->enable_state = bp_startup_disabled; - loc = b->loc; } else @@ -8079,11 +8038,6 @@ create_breakpoint (struct gdbarch *gdbarch, b->enable_state = enabled ? bp_enabled : bp_disabled; b->pspace = current_program_space; - if (enabled && b->pspace->executing_startup - && (b->type == bp_breakpoint - || b->type == bp_hardware_breakpoint)) - b->enable_state = bp_startup_disabled; - install_breakpoint (internal, b, 0); } @@ -10748,11 +10702,7 @@ update_global_location_list (int should_insert) struct breakpoint *b = loc->owner; struct bp_location **loc_first_p; - if (b->enable_state == bp_disabled - || b->enable_state == bp_call_disabled - || b->enable_state == bp_startup_disabled - || !loc->enabled - || loc->shlib_disabled + if (!should_be_inserted (loc) || !breakpoint_address_is_meaningful (b) /* Don't detect duplicate for tracepoint locations because they are never duplicated. See the comments in field `duplicate' of @@ -11038,8 +10988,7 @@ static struct breakpoint_ops base_breakpoint_ops = static void bkpt_re_set (struct breakpoint *b) { - /* Do not attempt to re-set breakpoints disabled during startup. */ - if (b->enable_state == bp_startup_disabled) + if (current_program_space->executing_startup) return; /* FIXME: is this still reachable? */ diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 438f347..17e65d6 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -186,14 +186,6 @@ enum enable_state automatically enabled and reset when the call "lands" (either completes, or stops at another eventpoint). */ - bp_startup_disabled, /* The eventpoint has been disabled during - inferior startup. This is necessary on - some targets where the main executable - will get relocated during startup, making - breakpoint addresses invalid. The - eventpoint will be automatically enabled - and reset once inferior startup is - complete. */ bp_permanent /* There is a breakpoint instruction hard-wired into the target's code. Don't try to write another breakpoint -- 1.7.6.4 --=-=-=--