aboutsummaryrefslogtreecommitdiff
path: root/scripts/dump-guest-memory.py
diff options
context:
space:
mode:
authorJon Doron <arilou@gmail.com>2019-01-09 10:22:03 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2019-02-06 15:51:12 +0100
commite17bebd049d78f489c2cff755e2b66a0536a156e (patch)
treee1cf5f23f963680662ed5dfe2f2b66004f9ceeae /scripts/dump-guest-memory.py
parent47994e16b1d66411953623e7c0bf0cdcd50bd507 (diff)
downloadqemu-e17bebd049d78f489c2cff755e2b66a0536a156e.zip
qemu-e17bebd049d78f489c2cff755e2b66a0536a156e.tar.gz
qemu-e17bebd049d78f489c2cff755e2b66a0536a156e.tar.bz2
dump: Set correct vaddr for ELF dump
vaddr needs to be equal to the paddr since the dump file represents the physical memory image. Without setting vaddr correctly, GDB would load all the different memory regions on top of each other to vaddr 0, thus making GDB showing the wrong memory data for a given address. Signed-off-by: Jon Doron <arilou@gmail.com> Message-Id: <20190109082203.27142-1-arilou@gmail.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'scripts/dump-guest-memory.py')
-rw-r--r--scripts/dump-guest-memory.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py
index 198cd0f..2c587cb 100644
--- a/scripts/dump-guest-memory.py
+++ b/scripts/dump-guest-memory.py
@@ -163,6 +163,7 @@ class ELF(object):
phdr = get_arch_phdr(self.endianness, self.elfclass)
phdr.p_type = p_type
phdr.p_paddr = p_paddr
+ phdr.p_vaddr = p_paddr
phdr.p_filesz = p_size
phdr.p_memsz = p_size
self.segments.append(phdr)