07-11-2012 09:31 AM
If I know the location of a memory buffer (in HP-UX 11.00), how can I display the memory contents. I would prefer to display a number of memory locations if possibel. Are ther any tools, scripts, etc. to allow me to view memory at specific locations?
Solved! Go to Solution.
07-11-2012 02:41 PM
No I'm not talking about GDB. I wish I had an object code debugger like OllyDbg for PARISC, but alas I don't. All I want to be able to do is point to a memory address and then read one to 256 words of memory -- much like one would see with a hex editor -- but not for a file, but for memory locations. Is that clearer? I hope I'm saying it right!
07-11-2012 03:13 PM
>I want to be able to do is point to a memory address and then read one to 256 words of memory
Again, are you talking about a user process or the kernel?
gdb's x command can dump memory of a user process. For the kernel, you need to use adb.
07-12-2012 06:32 AM
In Unix, "everything is a file".
With /dev/mem and /dev/kmem, you can access the main memory if you are root or a member of the "sys" group. Just open the device, seek to the location you want and read. /dev/mem gives access to physical memory, and /dev/kmem to kernel virtual memory.
However, the big challenge will be knowing the right address (which translates into file position when reading the /dev/(k)mem device file). Any memory addresses you might get from the debug output of an application will normally refer to the virtual address space of that particular process: a mapping operation is required to find the corresponding address in the kernel virtual address space, and another mapping operation to find the corresponding physical address.
But if you're debugging hardware that is located in a known physical memory address and/or can read the kernel data structures to find the necessary information to translate the addresses, more power to you.
07-12-2012 11:27 AM
Thanks Matti and also Dennis Handly -- points to both of you. I will try the easiest first, but I doubt it will work since I am trying to look at locations populated by kernel system calls. This leads me to believe I will have to use ADB (do not know if I have it) or try your method Matti. Thanks to both of you.