From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26899 invoked by alias); 6 Dec 2011 18:53:49 -0000 Received: (qmail 26862 invoked by uid 22791); 6 Dec 2011 18:53:47 -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:31 +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 pB6IrEYU012724 (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 pB6IaUOV021146; Tue, 6 Dec 2011 13:36:30 -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 pB6IaSmE032433; Tue, 6 Dec 2011 13:36:29 -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:53: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/msg00190.txt.bz2 --=-=-= Content-Type: text/plain Content-length: 124 Here is patch #2, to make breakpoint->pspace optional. It hasn't changed in a while, I'm sending it for completeness. Tom --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-make-pspace-optional.patch Content-Description: patch 2 Content-length: 3479 diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f0a351f..a26c933 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5819,9 +5819,11 @@ init_raw_breakpoint (struct breakpoint *b, struct gdbarch *gdbarch, if (bptype != bp_catchpoint) gdb_assert (sal.pspace != NULL); - /* Store the program space that was used to set the breakpoint, for - breakpoint resetting. */ - b->pspace = sal.pspace; + /* Store the program space that was used to set the breakpoint, + except for ordinary breakpoints, which are independent of the + program space. */ + if (bptype != bp_breakpoint && bptype != bp_hardware_breakpoint) + b->pspace = sal.pspace; if (sal.symtab == NULL) b->source_file = NULL; @@ -7268,7 +7270,6 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch, b->ignore_count = ignore_count; b->enable_state = enabled ? bp_enabled : bp_disabled; b->disposition = disposition; - b->pspace = sals.sals[0].pspace; if (type == bp_static_tracepoint) { @@ -8036,7 +8037,8 @@ create_breakpoint (struct gdbarch *gdbarch, b->disposition = tempflag ? disp_del : disp_donttouch; b->condition_not_parsed = 1; b->enable_state = enabled ? bp_enabled : bp_disabled; - b->pspace = current_program_space; + if (type_wanted != bp_breakpoint && type_wanted != bp_hardware_breakpoint) + b->pspace = current_program_space; install_breakpoint (internal, b, 0); } @@ -10988,9 +10990,6 @@ static struct breakpoint_ops base_breakpoint_ops = static void bkpt_re_set (struct breakpoint *b) { - if (current_program_space->executing_startup) - return; - /* FIXME: is this still reachable? */ if (b->addr_string == NULL) { @@ -11925,6 +11924,7 @@ addr_string_to_sals (struct breakpoint *b, char *addr_string, int *found) if (e.error == NOT_FOUND_ERROR && (b->condition_not_parsed || (b->loc && b->loc->shlib_disabled) + || (b->loc && b->loc->pspace->executing_startup) || b->enable_state == bp_disabled)) not_found_and_ok = 1; @@ -12013,7 +12013,8 @@ prepare_re_set_context (struct breakpoint *b) input_radix = b->input_radix; cleanups = save_current_space_and_thread (); - switch_to_program_space_and_thread (b->pspace); + if (b->pspace != NULL) + switch_to_program_space_and_thread (b->pspace); set_language (b->language); return cleanups; diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 17e65d6..de1491e 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -567,7 +567,9 @@ struct breakpoint equals this. */ struct frame_id frame_id; - /* The program space used to set the breakpoint. */ + /* The program space used to set the breakpoint. This is only set + for breakpoints which are specific to a program space; for + ordinary breakpoints this is NULL. */ struct program_space *pspace; /* String we used to set the breakpoint (malloc'd). */ diff --git a/gdb/elfread.c b/gdb/elfread.c index a309a2c..067c77f 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -1032,7 +1032,7 @@ elf_gnu_ifunc_resolver_return_stop (struct breakpoint *b) } gdb_assert (b->type == bp_gnu_ifunc_resolver); - gdb_assert (current_program_space == b->pspace); + gdb_assert (current_program_space == b->pspace || b->pspace == NULL); elf_gnu_ifunc_record_cache (b->addr_string, resolved_pc); sal = find_pc_line (resolved_pc, 0); -- 1.7.6.4 --=-=-=--