linux-mips-fnet
[Top] [All Lists]

Platform-independent hack in ptrace.c

To: linux-mips@fnet.fr
Subject: Platform-independent hack in ptrace.c
From: "Vladimir A. Roganov" <roganov@niisi.msk.ru>
Date: Thu, 27 May 1999 16:17:42 +0400
Organization: NIISI
Sender: vladimir@niisi.msk.ru
Hello,

Does anybody know which kind of protection is encoded in ptrace.c:69:
(function get_long)

        /* This is a hack for non-kernel-mapped video buffers and similar */
        if (MAP_NR(page) >= MAP_NR(high_memory))
                return 0;

By this reason gdb shows all user-mapped io as zeros.

Same time, put_long enable to write to such memory !
So when You enter something like 'set *p = 0xff' gdb'ing program 
which has p->video_memory, You will see appearing pixels, but 'p *p' 
prints only zeros.

Elimination of this check does not destroy something: gdb shows right
values.

It looks clean  that above problem is not very important, but just
imagine 
programmer debugging some application for Linux used to control some
device 
on MIPS embedded computer, which mmap'ed to device registers and don't
understand 
why they are all clean :-)

Regards,
Vladimir.

<Prev in Thread] Current Thread [Next in Thread>