browsing process memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I don't think this post is strictly on-topic, so I apologize in advance.
I'm not sure where else to ask this question.


I understand that /proc/<pid>/maps gives a list of memory maps for
process <pid>:

   08048000-080bf000 r-xp 00000000 03:05 645180     /bin/bash
   080bf000-080c5000 rw-p 00077000 03:05 645180     /bin/bash
   080c5000-080dd000 rwxp 00000000 00:00 0
   40000000-40013000 r-xp 00000000 03:05 225830     /lib/ld-2.2.5.so
   40013000-40014000 rw-p 00013000 03:05 225830     /lib/ld-2.2.5.so
   (snip)

Hypothetical question: Just suppose, for some reason, I wanted to browse
a process's memory maps.  To be concrete, suppose I wanted to list the
contents of the process's memory between offsets 08048000 and 080bf000.

What would the mechanism be for a user space program to do something
like this?

I think it would start with ptrace() to make this process a child
process of the program I wrote to browse memory.

Once this process becomes a child process, how can I step through the
first memory map, byte by byte?

I don't know much about memory, but I'm hoping to learn.   :)

Thanks!
Pete

-- 
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux