From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21498 invoked by alias); 11 Nov 2001 16:42:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 21476 invoked from network); 11 Nov 2001 16:42:19 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.114.42.213) by sourceware.cygnus.com with SMTP; 11 Nov 2001 16:42:19 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id 6B4303D86; Sun, 11 Nov 2001 11:42:14 -0500 (EST) Message-ID: <3BEEAA66.6010409@cygnus.com> Date: Thu, 01 Nov 2001 06:45:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.3) Gecko/20011020 X-Accept-Language: en-us MIME-Version: 1.0 To: Andrew Cagney Cc: Mark Kettenis , gdb-patches@sources.redhat.com, msnyder@redhat.com Subject: Re: [5.1/breakpoint] shlib patch? References: <3B47384A.3000300@cygnus.com> <3BB2AD4B.1040908@cygnus.com> <200109280939.f8S9dgG00358@delius.kettenis.local> <3BE074F9.7040902@cygnus.com> <3BEA11C9.9020702@cygnus.com> Content-Type: multipart/mixed; boundary="------------000102090201040508050001" X-SW-Source: 2001-11/txt/msg00000.txt.bz2 This is a multi-part message in MIME format. --------------000102090201040508050001 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 59 FYI, I've checked in the attached. 5.1 and trunk. Andrew --------------000102090201040508050001 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 2289 2001-11-11 Andrew Cagney From Mark Kettenis : * breakpoint.c (breakpoint_re_set_one): Don't discard SHLIB breakpoints when they fail. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.51.2.1 diff -p -r1.51.2.1 breakpoint.c *** breakpoint.c 2001/08/02 12:05:56 1.51.2.1 --- breakpoint.c 2001/11/11 16:33:51 *************** breakpoint_re_set_one (PTR bint) *** 7009,7018 **** delete_breakpoint (b); return 0; } ! /* In case we have a problem, disable this breakpoint. We'll restore ! its status if we succeed. */ save_enable = b->enable_state; ! b->enable_state = bp_disabled; set_language (b->language); input_radix = b->input_radix; --- 7009,7040 ---- delete_breakpoint (b); return 0; } ! /* HACK: cagney/2001-11-11: kettenis/2001-11-11: MarkK wrote: ! ! ``And a hack it is, although Apple's Darwin version of GDB ! contains an almost identical hack to implement a "future ! break" command. It seems to work in many real world cases, ! but it is easy to come up with a test case where the patch ! doesn't help at all.'' ! ! ``It seems that the way GDB implements breakpoints - in - ! shared - libraries was designed for a.out shared library ! systems (SunOS 4) where shared libraries were loaded at a ! fixed address in memory. Since ELF shared libraries can (and ! will) be loaded at any address in memory, things break. ! Fixing this is not trivial. Therefore, I'm not sure whether ! we should add this hack to the branch only. I cannot ! guarantee that things will be fixed on the trunk in the near ! future.'' ! ! In case we have a problem, disable this breakpoint. We'll ! restore its status if we succeed. Don't disable a ! shlib_disabled breakpoint though. There's a fair chance we ! can't re-set it if the shared library it's in hasn't been ! loaded yet. */ save_enable = b->enable_state; ! if (b->enable_state != bp_shlib_disabled) ! b->enable_state = bp_disabled; set_language (b->language); input_radix = b->input_radix; --------------000102090201040508050001--