From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19894 invoked by alias); 6 Aug 2008 23:10:03 -0000 Received: (qmail 19883 invoked by uid 22791); 6 Aug 2008 23:10:02 -0000 X-Spam-Check-By: sourceware.org Received: from hiauly1.hia.nrc.ca (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Aug 2008 23:09:24 +0000 Received: by hiauly1.hia.nrc.ca (Postfix, from userid 1000) id 55BB3431A; Wed, 6 Aug 2008 19:09:21 -0400 (EDT) Subject: Re: [patch] Don't set DT_HP_DEBUG_PRIVATE in solib-pa64.c To: mark.kettenis@xs4all.nl (Mark Kettenis) Date: Wed, 06 Aug 2008 23:10:00 -0000 From: "John David Anglin" Cc: drow@false.org, gdb-patches@sourceware.org, randolph@tausq.org In-Reply-To: <200808061948.m76JmOdf028185@brahms.sibelius.xs4all.nl> from "Mark Kettenis" at Aug 6, 2008 09:48:24 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20080806230922.55BB3431A@hiauly1.hia.nrc.ca> 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: 2008-08/txt/msg00143.txt.bz2 > Otherwise, I think this is ok (but perhaps the message that suggests > using chatr can be improved). How does this look? The best online documentation for the methods to privately map shared library text is . This is for 11i v3 but the same features are available on all HP-UX 11 versions with a recent linker patch. On HP-UX 11.11, chatr +dbg support was added in PHSS_32864. Using _HP_DLDOPTS, it is possible to map privately all or specific libraries without modifying the libraries or executable. It is also possible to use "pxdb -s on" to privately map the text segments of shared libraries. See . Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) 2008-08-06 John David Anglin * solib-pa64.c (pa64_solib_create_inferior_hook): Don't set DT_HP_DEBUG_PRIVATE. Add warning if DT_HP_DEBUG_PRIVATE is not set. Revise comment. (pa64_current_sos): Remove map private warning warning. Index: solib-pa64.c =================================================================== RCS file: /cvs/src/src/gdb/solib-pa64.c,v retrieving revision 1.12 diff -u -3 -p -r1.12 solib-pa64.c --- solib-pa64.c 6 Aug 2008 20:17:21 -0000 1.12 +++ solib-pa64.c 6 Aug 2008 22:49:28 -0000 @@ -322,13 +322,12 @@ bfd_lookup_symbol (bfd *abfd, char *symn to tell the dynamic linker that a private copy of the library is needed (so GDB can set breakpoints in the library). - We need to set two flag bits in this routine. - - DT_HP_DEBUG_PRIVATE to indicate that shared libraries should be - mapped private. - - DT_HP_DEBUG_CALLBACK to indicate that we want the dynamic linker to - call the breakpoint routine for significant events. */ + We need to set DT_HP_DEBUG_CALLBACK to indicate that we want the + dynamic linker to call the breakpoint routine for significant events. + We used to set DT_HP_DEBUG_PRIVATE to indicate that shared libraries + should be mapped private. However, this flag can be set using + "chatr +dbg enable". Not setting DT_HP_DEBUG_PRIVATE allows debugging + with shared libraries mapped shareable. */ static void pa64_solib_create_inferior_hook (void) @@ -360,8 +359,15 @@ pa64_solib_create_inferior_hook (void) if (! read_dynamic_info (shlib_info, &dld_cache)) error (_("Unable to read the .dynamic section.")); + /* If the libraries were not mapped private, warn the user. */ + if ((dld_cache.dld_flags & DT_HP_DEBUG_PRIVATE) == 0) + warning + (_("Private mapping of shared library text was not specified\n" + "by the executable; setting a breakpoint in a shared library which\n" + "is not privately mapped will not work. See the HP-UX 11i v3 chatr\n" + "manpage for methods to privately map shared library text.\n")); + /* Turn on the flags we care about. */ - dld_cache.dld_flags |= DT_HP_DEBUG_PRIVATE; dld_cache.dld_flags |= DT_HP_DEBUG_CALLBACK; status = target_write_memory (dld_cache.dld_flags_addr, (char *) &dld_cache.dld_flags, @@ -454,12 +460,6 @@ pa64_current_sos (void) if (! read_dld_descriptor ()) return NULL; - /* If the libraries were not mapped private, warn the user. */ - if ((dld_cache.dld_flags & DT_HP_DEBUG_PRIVATE) == 0) - warning (_("The shared libraries were not privately mapped; setting a\n" - "breakpoint in a shared library will not work until you rerun " - "the program.\n")); - for (dll_index = -1; ; dll_index++) { struct load_module_desc dll_desc;