From owner-freebsd-current Mon Oct 21 08:09:20 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA17432 for current-outgoing; Mon, 21 Oct 1996 08:09:20 -0700 (PDT) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id IAA17426 for ; Mon, 21 Oct 1996 08:09:17 -0700 (PDT) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.7.6/8.7.3) with ESMTP id IAA08924; Mon, 21 Oct 1996 08:09:00 -0700 (PDT) Message-Id: <199610211509.IAA08924@austin.polstra.com> To: msmith@atrad.adelaide.edu.au Cc: freebsd-current@freebsd.org Subject: Re: kern/1848: breakpoints in shared libraries don't fire In-reply-to: <199610210204.LAA04119@genesis.atrad.adelaide.edu.au> References: <199610210204.LAA04119@genesis.atrad.adelaide.edu.au> Date: Mon, 21 Oct 1996 08:09:00 -0700 From: John Polstra Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > What about pages mmapped MAP_PRIVATE, couldn't the page be copied for > > private use when the breakpoint is set? > > I'm sure it _could_, after all it's just software. However ld.so most > likely maps pages as readonly, so you would have to make some changes > there (to detect whether a program was being debugged etc.), or teach > gdb to change the mappings on shared libraries. Actually, ld.so maps everything MAP_COPY (same as MAP_PRIVATE) already. The text segment starts out read-only. GDB does (or at least did) change the protections to read/write as needed when it has to insert a breakpoint. As John-Mark Gurney pointed out in a different posting, this all used to work just fine. If it's broken now in -current, then it's probably a problem with gdb. I just checked it on a current from just a few days ago, and it works fine for me. I was able to set a breakpoint on gethostbyname() in libc, and the debugger really stopped when it got there. This is with the standard gdb in /usr/bin. I don't have the version from the ports collection installed at the moment. This all sounds like a bunch of todo over a problem that never existed in the first place. -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth