* [Qemu-devel] [PULL 0/1] Dump patches
@ 2019-02-06 14:58 Marc-André Lureau
2019-02-06 14:58 ` [Qemu-devel] [PULL 1/1] dump: Set correct vaddr for ELF dump Marc-André Lureau
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Marc-André Lureau @ 2019-02-06 14:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau, peter.maydell
The following changes since commit 47994e16b1d66411953623e7c0bf0cdcd50bd507:
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190205' into staging (2019-02-05 18:25:07 +0000)
are available in the Git repository at:
https://github.com/elmarco/qemu.git tags/dump-pull-request
for you to fetch changes up to e17bebd049d78f489c2cff755e2b66a0536a156e:
dump: Set correct vaddr for ELF dump (2019-02-06 15:51:12 +0100)
----------------------------------------------------------------
Pull request
----------------------------------------------------------------
Jon Doron (1):
dump: Set correct vaddr for ELF dump
scripts/dump-guest-memory.py | 1 +
dump.c | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
--
2.20.1.98.gecbdaf0899
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 1/1] dump: Set correct vaddr for ELF dump
2019-02-06 14:58 [Qemu-devel] [PULL 0/1] Dump patches Marc-André Lureau
@ 2019-02-06 14:58 ` Marc-André Lureau
2019-02-07 14:54 ` [Qemu-devel] [PULL 0/1] Dump patches Peter Maydell
2019-02-07 19:18 ` no-reply
2 siblings, 0 replies; 4+ messages in thread
From: Marc-André Lureau @ 2019-02-06 14:58 UTC (permalink / raw)
To: qemu-devel
Cc: Marc-André Lureau, peter.maydell, Jon Doron, Eduardo Habkost,
Cleber Rosa
From: Jon Doron <arilou@gmail.com>
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>
---
scripts/dump-guest-memory.py | 1 +
dump.c | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py
index 198cd0fe40..2c587cbefc 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)
diff --git a/dump.c b/dump.c
index ef1d8025c9..107a67165a 100644
--- a/dump.c
+++ b/dump.c
@@ -192,7 +192,7 @@ static void write_elf64_load(DumpState *s, MemoryMapping *memory_mapping,
phdr.p_paddr = cpu_to_dump64(s, memory_mapping->phys_addr);
phdr.p_filesz = cpu_to_dump64(s, filesz);
phdr.p_memsz = cpu_to_dump64(s, memory_mapping->length);
- phdr.p_vaddr = cpu_to_dump64(s, memory_mapping->virt_addr);
+ phdr.p_vaddr = cpu_to_dump64(s, memory_mapping->virt_addr) ?: phdr.p_paddr;
assert(memory_mapping->length >= filesz);
@@ -216,7 +216,8 @@ static void write_elf32_load(DumpState *s, MemoryMapping *memory_mapping,
phdr.p_paddr = cpu_to_dump32(s, memory_mapping->phys_addr);
phdr.p_filesz = cpu_to_dump32(s, filesz);
phdr.p_memsz = cpu_to_dump32(s, memory_mapping->length);
- phdr.p_vaddr = cpu_to_dump32(s, memory_mapping->virt_addr);
+ phdr.p_vaddr =
+ cpu_to_dump32(s, memory_mapping->virt_addr) ?: phdr.p_paddr;
assert(memory_mapping->length >= filesz);
--
2.20.1.98.gecbdaf0899
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/1] Dump patches
2019-02-06 14:58 [Qemu-devel] [PULL 0/1] Dump patches Marc-André Lureau
2019-02-06 14:58 ` [Qemu-devel] [PULL 1/1] dump: Set correct vaddr for ELF dump Marc-André Lureau
@ 2019-02-07 14:54 ` Peter Maydell
2019-02-07 19:18 ` no-reply
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2019-02-07 14:54 UTC (permalink / raw)
To: Marc-André Lureau; +Cc: QEMU Developers
On Wed, 6 Feb 2019 at 14:58, Marc-André Lureau
<marcandre.lureau@redhat.com> wrote:
>
> The following changes since commit 47994e16b1d66411953623e7c0bf0cdcd50bd507:
>
> Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190205' into staging (2019-02-05 18:25:07 +0000)
>
> are available in the Git repository at:
>
> https://github.com/elmarco/qemu.git tags/dump-pull-request
>
> for you to fetch changes up to e17bebd049d78f489c2cff755e2b66a0536a156e:
>
> dump: Set correct vaddr for ELF dump (2019-02-06 15:51:12 +0100)
>
> ----------------------------------------------------------------
> Pull request
>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/1] Dump patches
2019-02-06 14:58 [Qemu-devel] [PULL 0/1] Dump patches Marc-André Lureau
2019-02-06 14:58 ` [Qemu-devel] [PULL 1/1] dump: Set correct vaddr for ELF dump Marc-André Lureau
2019-02-07 14:54 ` [Qemu-devel] [PULL 0/1] Dump patches Peter Maydell
@ 2019-02-07 19:18 ` no-reply
2 siblings, 0 replies; 4+ messages in thread
From: no-reply @ 2019-02-07 19:18 UTC (permalink / raw)
To: marcandre.lureau; +Cc: fam, qemu-devel, peter.maydell
Patchew URL: https://patchew.org/QEMU/20190206145831.656-1-marcandre.lureau@redhat.com/
Hi,
This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-mingw@fedora SHOW_ENV=1 J=14
=== TEST SCRIPT END ===
The full log is available at
http://patchew.org/logs/20190206145831.656-1-marcandre.lureau@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-07 19:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-06 14:58 [Qemu-devel] [PULL 0/1] Dump patches Marc-André Lureau
2019-02-06 14:58 ` [Qemu-devel] [PULL 1/1] dump: Set correct vaddr for ELF dump Marc-André Lureau
2019-02-07 14:54 ` [Qemu-devel] [PULL 0/1] Dump patches Peter Maydell
2019-02-07 19:18 ` no-reply
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).