From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66405 invoked by alias); 21 Nov 2018 09:40:32 -0000 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 Received: (qmail 66374 invoked by uid 89); 21 Nov 2018 09:40:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1062, Tarral, ProtonMail, protonmail X-HELO: mail-40130.protonmail.ch Received: from mail-40130.protonmail.ch (HELO mail-40130.protonmail.ch) (185.70.40.130) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Nov 2018 09:40:26 +0000 Date: Wed, 21 Nov 2018 09:40:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1542793224; bh=iIu4YMZ+v52y1mUVhgTuA2TwNkiMwegzIx7hvydcI4Y=; h=Date:To:From:Reply-To:Subject:Feedback-ID:From; b=SKVERO7RgoW5k7y1vzqGcR1Feo4Onb1V7tloOnmsfGod3BQ/djFACIB3UYR+albv6 1/qBJiBnfAvomP3gWHLhqm6cMj8kftt7868b8KmvCQmw1nFC634BPAT2RPEw/ILzij BC3G8kzOOJ930EWdWZr+ttH4KYSdrRMrNQhn4O+8= To: "gdb@sourceware.org" From: Mathieu Tarral Reply-To: Mathieu Tarral Subject: Force software breakpoint on read-only memory Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-11/txt/msg00018.txt.bz2 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 abort= ed: $ 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.