This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdb on Mac OS bpt implementation question
- From: Tristan Gingold <gingold at adacore dot com>
- To: Mick Jordan <mick dot jordan at oracle dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 9 Nov 2011 08:47:47 +0100
- Subject: Re: gdb on Mac OS bpt implementation question
- References: <4EB9BE43.7050200@oracle.com>
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 to resolve is how breakpoints are set in shared libraries, given that they are loaded read-only on Mac OS X (assuming the "write a bpt instruction" approach). The context for this is a custom debugger we have for a Java VM (Maxine) which uses "write a bpt instruction" and works fine setting breakpoints in shared library code on Linux and Solaris, but not on MacOS (we get access faults trying to write the BPT instruction).
>
See darwin-nat.c:darwin_read_write_inferior.
If you want to write to a page, you have to make it writable.
Tristan.