[Simh] Problem with EXAMINE on the VAX simulator

Jan-Benedict Glaw jbglaw at lug-owl.de
Mon Nov 28 05:51:03 EST 2005


On Sun, 2005-11-27 21:40:48 +0100, Jan-Benedict Glaw <jbglaw at lug-owl.de> wrote:
> Hi!
> 
> I'm currently trying to nail down a bug in our (vax-linux) stat()
> implementation (which is probably a compiler bug). SIMH is a
> "supported" machine for Linux, so I tried to use SIMH for debugging,
> since is allows such a nice interface.
> 
> Linux runs with MAPEN=1. Userland's text segment is from 0x0000'0000
> upwards, userland stack is at 0x7fff'ffff downwards. I can EXAMINE
> the user text segment, but I cannot EXAMINE the userland stack area:
> 
> sim> exa 101a0
> 101A0:  EF01FB00
> sim> exa 7FEF7F1F
> Address space exceeded

I've debugged SIMH a bit. This is what happens:

  * scp.c takes the input and parses it (correctly).
  * The device's examine function is called and finally it tries to
    read the actual requested data:

t_stat cpu_ex (t_value *vptr, t_addr exta, UNIT *uptr, int32 sw)
{
int32 st;
uint32 addr = (uint32) exta;

if (vptr == NULL) return SCPE_ARG;
if (sw & SWMASK ('V')) addr = Test (addr, RD, &st);
else addr = addr & PAMASK;			******************
if (ADDR_IS_MEM (addr) || ADDR_IS_CDG (addr) ||
    ADDR_IS_ROM (addr) || ADDR_IS_NVR (addr)) {
    *vptr = (uint32) ReadB (addr);
    return SCPE_OK;
    }
return SCPE_NXM;
}

In the marked line, my examined address (0x7f946c6c) is truncated to
0x3f946c6c, because PAMASK is PASIZE-1, with is 512MB-1.

However, it seems I should have probably taken the

	addr = Test (addr, RD, &st);

branch.

Since I didn't find docs about it, I just tried

	examine -v 7f946c6c

which at least returns some data. So I explicitely need to tell that I
want to examine a *virtual* address. Maybe it would be a wise idea to
hack cpu_ex() to look at the $PR_MAPEN register if no physical/virtual
switch is given?

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw at lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20051128/f3f13abf/attachment.sig>


More information about the Simh mailing list