From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16195 invoked by alias); 9 Nov 2011 07:48:12 -0000 Received: (qmail 16184 invoked by uid 22791); 9 Nov 2011 07:48:11 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Nov 2011 07:47:59 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 7923CCB01E6; Wed, 9 Nov 2011 08:48:00 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MHS54AGS2YZv; Wed, 9 Nov 2011 08:47:50 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id C7A9BCB027F; Wed, 9 Nov 2011 08:47:50 +0100 (CET) Subject: Re: gdb on Mac OS bpt implementation question Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: Tristan Gingold In-Reply-To: <4EB9BE43.7050200@oracle.com> Date: Wed, 09 Nov 2011 07:48:00 -0000 Cc: gdb@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <4EB9BE43.7050200@oracle.com> To: Mick Jordan X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00073.txt.bz2 On Nov 9, 2011, at 12:41 AM, Mick Jordan wrote: > I'd be grateful if someone could point me to where in the gdb source code= that Mac OS specific breakpoint setting is done. The problem I am trying t= o resolve is how breakpoints are set in shared libraries, given that they a= re loaded read-only on Mac OS X (assuming the "write a bpt instruction" app= roach). The context for this is a custom debugger we have for a Java VM (Ma= xine) which uses "write a bpt instruction" and works fine setting breakpoin= ts in shared library code on Linux and Solaris, but not on MacOS (we get ac= cess faults trying to write the BPT instruction). >=20 See darwin-nat.c:darwin_read_write_inferior. If you want to write to a page, you have to make it writable. Tristan.