On 10/25/22 12:51, Helge Deller wrote:
On 10/25/22 04:25, Richard Henderson wrote:
On 10/25/22 11:57, Helge Deller wrote:
On 10/25/22 00:35, Richard Henderson wrote:
On 10/25/22 06:18, Helge Deller wrote:
When the emulation stops with a hard exception it's very useful for
debugging purposes to dump the current guest memory layout (for an
example see /proc/self/maps) beside the CPU registers.

The open_self_maps() function provides such a memory dump, but since
it's located in the syscall.c file, various changes (add #includes, make
this function externally visible, ...) are needed to be able to call it
from the existing EXCP_DUMP() macro.

/proc/self/maps has all of the qemu mappings in it as well.

I'm not quite sure on how to understand your comments above.
Just comments or NAK to the patch?

A question.

Did you really wanted the host mappings included?

No.
I wanted just the guest mappings.

If so, fine.
If not, pointing out there's a better function to use.

I'm not sure if it's the better choice.
It depends on the targetted audience of such output.

This is linux-user, so if someone runs a program he would expect
output of crash dumps like as he would see them on a native machine.
Showing "external host emulation mappings" seems strange.

Oh, I see. My comments above confused read_self_maps (host) with open_self_maps (filtered guest).

I'll note that the output of page_dump() could be improved to exactly match /proc/self/maps format (which would probably be less confusing), and then re-implement open_self_maps in terms of that. This would avoid read_self_maps entirely.

It would also fix a bug in that the host page permissions do not exactly match guest page permissions, and you're reporting host page permissions.


r~

Reply via email to