Path: utzoo!attcan!uunet!snorkelwacker!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.unix.questions Subject: Re: SysV.3 shared libs - not debugable ?! Message-ID: Date: 27 Jun 90 15:23:23 GMT References: <2835@uniol.UUCP> <13159@smoke.BRL.MIL> <1990Jun24.001636.20821@scuzzy.uucp> <451@mtndew.UUCP> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 27 In-reply-to: friedl@mtndew.UUCP's message of 26 Jun 90 04:28:29 GMT In article <451@mtndew.UUCP> friedl@mtndew.UUCP (Stephen J. Friedl) writes: | In article <1990Jun24.001636.20821@scuzzy.uucp>, src@scuzzy.uucp (Source Admin) writes: | > i tried to debug a program that uses the nsl_s (sp?) shared lib | > under ISC 2.0.3 with gdb version 3.4. of course it doesn't work - the program | > get's a SIGTRP in the middle of some lib routine. is this normal/intended or | > a bug in gdb ? | | With shared libraries, the text segment is not writable. This means | that you can't stuff a breakpoint instruction ( INT ? ) there for the | debugger to use, and there is not much you can do about it except | building in a very slow and laborious interpreter. Building an interpreter is not the only possible solution. Another solution if you can remap text pages with shmem or mmap, is to remap the pages into a shared memory segment. If the OS cooperates, the normal ptrace calls would not modify the read-only pages, but modify a copy of the pages. If you have mmap with copy on write, you just use that, and then all pages which do not have breakpoints set will be shared with other clients. Granted you will have to know exactly what your system does in dark corner type cases..... -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA Do apple growers tell their kids money doesn't grow on bushes?