Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Sep 1997 19:32:29 -0500
From:      Jonathan Lemon <jlemon@americantv.com>
To:        "Helmut F. Wirth" <hfwirth@ping.at>
Cc:        Bruce Evans <bde@zeta.org.au>, emulation@FreeBSD.ORG
Subject:   Re: Doscmd, debugging with gdb
Message-ID:  <19970909193229.57912@right.PCS>
In-Reply-To: <3415A6B4.41C67EA6@ping.at>; from Helmut F. Wirth on Sep 09, 1997 at 09:42:44PM %2B0200
References:  <199709090457.OAA28185@godzilla.zeta.org.au> <3415A6B4.41C67EA6@ping.at>

next in thread | previous in thread | raw e-mail | index | archive | help
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/<pid>/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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970909193229.57912>