Examining mmaped addresses using GDB

Posted by Mikeage on Stack Overflow See other posts from Stack Overflow or by Mikeage
Published on 2009-03-17T14:01:32Z Indexed on 2010/05/07 8:28 UTC
Read the original article Hit count: 317

Filed under:
|

I'm using the driver I posted at http://stackoverflow.com/questions/647783/direct-memory-access-in-linux/ to mmap some physical ram into a userspace address. However, I can't use GDB to look at any of the address; i.e., x 0x12345678 (where 0x12345678 is the return value of mmap) fails with an error "Cannot access memory at address 0x12345678".

Is there any way to tell GDB that this memory can be viewed? Alternatively, is there something different I can do in the mmap (either the call or the implementation of foo_mmap there) that will allow it to access this memory?

Note that I'm not asking about /dev/mem (as in the first snippet there) but amount a mmap to memory acquired via ioremap(), virt_to_phys() and remap_pfn_range()

© Stack Overflow or respective owner

Related posts about gdb

Related posts about mmap