Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mathieu Tarral <mathieu.tarral@protonmail.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Force software breakpoint on read-only memory
Date: Wed, 21 Nov 2018 09:40:00 -0000	[thread overview]
Message-ID: <UpeoDeMdWlsVJSDXnbjmxHp8zp3Qx_idZKmlMb5AElmjUCmP7cMVlZJSRhhgpoKUqTPFSVGBAuiyYnlu8PkQnA_1cjC6gGwELiT5pQqXPGY=@protonmail.com> (raw)

Hi,

I'm trying to set a software breakpoint on a read-only memory page.
GDB automatically sets the breakpoint as hardware, but I would like to
keep using software breakpoints.

I found the `set breakpoint auto-hw off option in` in the
documentation:
"If the target provides a memory map, GDB will warn when
trying to set software breakpoint at a read-only address."

However, even when I set it, GDB gives me a warning and my command is aborted:

$ gdb -x gdbinit ~/tmp/ntoskrnl.exe
0x80545c9f in ?? ()
(gdb) set breakpoint auto-hw off
(gdb) b NtOpenFile
Breakpoint 1 at 0x4a30b1
(gdb) continue
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot set software breakpoint at read-only address 0x4a30b1

Command aborted.
(gdb)



My stub interacts directly with the guest hardware, from the
hypervisor, so I can bypass the read-only protections.
That's why i wanted to force the software breakpoint
and ignore the memory map.

Is this a bug in GDB ?

Thanks !
--
Mathieu Tarral

Sent with ProtonMail Secure Email.


             reply	other threads:[~2018-11-21  9:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21  9:40 Mathieu Tarral [this message]
2018-11-21 15:02 ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='UpeoDeMdWlsVJSDXnbjmxHp8zp3Qx_idZKmlMb5AElmjUCmP7cMVlZJSRhhgpoKUqTPFSVGBAuiyYnlu8PkQnA_1cjC6gGwELiT5pQqXPGY=@protonmail.com' \
    --to=mathieu.tarral@protonmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox