aboutsummaryrefslogtreecommitdiff
path: root/contrib/elf2dmp/main.c
diff options
context:
space:
mode:
authorViktor Prutyanov <viktor@daynix.com>2023-09-15 20:01:50 +0300
committerPeter Maydell <peter.maydell@linaro.org>2023-09-21 16:07:15 +0100
commitd5c27a53d51175a2b89208b050488aaba74de131 (patch)
tree3c11f1e6db8f595d7cc12259691f7a92fb43ab93 /contrib/elf2dmp/main.c
parent3c407ec67f94f8dc189f3e47a6419431d15ff084 (diff)
downloadqemu-d5c27a53d51175a2b89208b050488aaba74de131.zip
qemu-d5c27a53d51175a2b89208b050488aaba74de131.tar.gz
qemu-d5c27a53d51175a2b89208b050488aaba74de131.tar.bz2
elf2dmp: introduce physical block alignment
Physical memory ranges may not be aligned to page size in QEMU ELF, but DMP can only contain page-aligned runs. So, align them. Signed-off-by: Viktor Prutyanov <viktor@daynix.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-id: 20230915170153.10959-3-viktor@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'contrib/elf2dmp/main.c')
-rw-r--r--contrib/elf2dmp/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c
index bb6744c..b7e3930 100644
--- a/contrib/elf2dmp/main.c
+++ b/contrib/elf2dmp/main.c
@@ -400,9 +400,10 @@ static int write_dump(struct pa_space *ps,
for (i = 0; i < ps->block_nr; i++) {
struct pa_block *b = &ps->block[i];
- printf("Writing block #%zu/%zu to file...\n", i, ps->block_nr);
+ printf("Writing block #%zu/%zu of %"PRIu64" bytes to file...\n", i,
+ ps->block_nr, b->size);
if (fwrite(b->addr, b->size, 1, dmp_file) != 1) {
- eprintf("Failed to write dump header\n");
+ eprintf("Failed to write block\n");
fclose(dmp_file);
return 1;
}