[Top][All Lists]

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

[Qemu-discuss] Core dumps and qemu-user

From: Christophe
Subject: [Qemu-discuss] Core dumps and qemu-user
Date: Wed, 16 Dec 2015 01:34:03 +0000

Hi all,

I recentrly tried to generate core dumps using qemu-user with the -g option, along with a remote gdb session. The core files I obtain contain lots of segments (way more than the guest program should contain), which makes it look like I am getting a dump of the entire qemu-user process instead. However, the segments I get don't seem to match those of /proc/pid/maps (where pid is the pid of the qemu-user process), and many segments are overlapping (i.e., several segments of the same size get mapped to the same virtual address).  If anyone has any insight about what is happening here, I would appreciate it.

You can easily reproduce this as follows with e.g. ls:
qemu-x86-64 -g 1234 /bin/ls
$ set architecture i386:x86-64
$ file /bin/ls
$ target remote localhost:1234
$ b *address_of_main (0x4028a0 on Debian Jessie's current 'ls')
$ continue
$ generate-core-file

By generating core dumps, my initial objective was to dump the stack and the heap (among other things) once the guest program reaches a certain program point (here, main). Alternatively, I could also use the `info proc mappings` command to get information about where the stack and heap are mapped, but this is not supported when attaching gdb to  qemu-user, and I don't know about any alternative way to get information other than directly looking at qemu's log (using the -d option) to get hints about it. It kind of works, but it feels a little bit hacky. Am I missing any better way to do this ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]