From owner-freebsd-emulation Tue Sep 9 17:33:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA19338 for emulation-outgoing; Tue, 9 Sep 1997 17:33:21 -0700 (PDT) Received: from sumatra.americantv.com (sumatra.americantv.com [207.170.17.37]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id RAA19332 for ; Tue, 9 Sep 1997 17:33:19 -0700 (PDT) Received: from right.PCS (right.PCS [148.105.10.31]) by sumatra.americantv.com (8.8.5/8.8.5) with ESMTP id TAA08105; Tue, 9 Sep 1997 19:33:01 -0500 (CDT) Received: (from jlemon@localhost) by right.PCS (8.6.13/8.6.4) id TAA23408; Tue, 9 Sep 1997 19:32:30 -0500 Message-ID: <19970909193229.57912@right.PCS> Date: Tue, 9 Sep 1997 19:32:29 -0500 From: Jonathan Lemon To: "Helmut F. Wirth" Cc: Bruce Evans , emulation@FreeBSD.ORG Subject: Re: Doscmd, debugging with gdb References: <199709090457.OAA28185@godzilla.zeta.org.au> <3415A6B4.41C67EA6@ping.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61.1 In-Reply-To: <3415A6B4.41C67EA6@ping.at>; from Helmut F. Wirth on Sep 09, 1997 at 09:42:44PM +0200 Sender: owner-freebsd-emulation@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Sep 09, 1997 at 09:42:44PM +0200, Helmut F. Wirth wrote: > Here is the map from /proc/PID/map (map is from doscmd, not gdb): > > 0x0 0x10000 7 0 rwx vnode > 0x10000 0xe0000 11 0 rwx default > 0xe0000 0xf0000 0 0 rwx none > 0xf0000 0x100000 1 0 rwx default > 0x100000 0x110000 14 0 rwx vnode > 0x110000 0x1ef000 52 0 rwx default > 0x8003000 0x8013000 13 0 r-x COW vnode > 0x8013000 0x8015000 0 2 rwx COW vnode > 0x8015000 0x801f000 0 10 rwx default [.. snip ..] The problem appears to be that gdb is unable to write to any region that is of type OBJT_DEFAULT (default) in the above map, even though it is marked writable. gdb doesn't have any problems reading from the address, though. A simple test case: > echo 'main() {}' > test.c > cc -g test.c > gdb a.out (gdb) b main (gdb) r > cat /proc//map [.. snip ..] 0x8012000 0x8014000 0 2 rwx COW vnode 0x8014000 0x801c000 0 8 rwx default [.. snip ..] (gdb) set *0x8012000 = 0 (gdb) set *0x8014000 = 0 Error accessing memory address 0x8014000: Bad address. I'm not sure where to look; this seems more like a vm problem. -- Jonathan