This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: : How to access physical memory in GDB?


"Lawrence Lee (Shanghai)" <LawrenceLee@viatech.com.cn> writes:
> -----原始邮件-----
> 发件人: Lawrence Lee (Shanghai) 
> 发送时间: 2002年7月18日 9:19
> 收件人: 'Jim Blandy'
> 主题: 答复: How to access physical memory in GDB?
> 
> 
> Sorry.
> 
> My operating system is RedHat Linux7.2. And processor is i386
> family.  I'm using gdb to debug the graphics card driver. Sometimes
> I have to write something to the MMIO of the card directly. I know
> the physics address of that memory in the card.  So how can I access
> that memory?  In fact, I also know the virtual address of the
> memory, because the memory in the card is mapped into the Xserver's
> address space. But I can't access that memory through the virtual
> address in gdb. I think that memory is protected by kernel, so the
> gdb can't access it through ptrace.

There isn't any special GDB command for accessing memory via physical
addresses.  The kernel prevents GDB from doing so, as this would be a
security hole.

Doesn't the user-level driver map the card into its own address space,
by calling mmap on the device FD or some magic like that?  If it does
that, then you can access the memory (albiet at a virtual address) via
your X server's virtual address space.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]