contrib/elf2dmp: fix code style

Originally elf2dmp were added with some code style issues,
especially in pe.h header, and some were introduced by
2d0fc797fa. Fix them now.

Signed-off-by: Viktor Prutyanov <viktor@daynix.com>
Reviewed-by: Annie Li <annie.li@oracle.com>
Message-id: 20230222211246.883679-2-viktor@daynix.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Viktor Prutyanov 2023-02-23 00:12:44 +03:00 committed by Peter Maydell
parent 0c88f93788
commit 05adc48e1d
3 changed files with 57 additions and 53 deletions

View file

@ -11,6 +11,7 @@
static struct pa_block *pa_space_find_block(struct pa_space *ps, uint64_t pa) static struct pa_block *pa_space_find_block(struct pa_space *ps, uint64_t pa)
{ {
size_t i; size_t i;
for (i = 0; i < ps->block_nr; i++) { for (i = 0; i < ps->block_nr; i++) {
if (ps->block[i].paddr <= pa && if (ps->block[i].paddr <= pa &&
pa <= ps->block[i].paddr + ps->block[i].size) { pa <= ps->block[i].paddr + ps->block[i].size) {

View file

@ -282,14 +282,16 @@ static int fill_header(WinDumpHeader64 *hdr, struct pa_space *ps,
}; };
for (i = 0; i < ps->block_nr; i++) { for (i = 0; i < ps->block_nr; i++) {
h.PhysicalMemoryBlock.NumberOfPages += ps->block[i].size / ELF2DMP_PAGE_SIZE; h.PhysicalMemoryBlock.NumberOfPages +=
ps->block[i].size / ELF2DMP_PAGE_SIZE;
h.PhysicalMemoryBlock.Run[i] = (WinDumpPhyMemRun64) { h.PhysicalMemoryBlock.Run[i] = (WinDumpPhyMemRun64) {
.BasePage = ps->block[i].paddr / ELF2DMP_PAGE_SIZE, .BasePage = ps->block[i].paddr / ELF2DMP_PAGE_SIZE,
.PageCount = ps->block[i].size / ELF2DMP_PAGE_SIZE, .PageCount = ps->block[i].size / ELF2DMP_PAGE_SIZE,
}; };
} }
h.RequiredDumpSpace += h.PhysicalMemoryBlock.NumberOfPages << ELF2DMP_PAGE_BITS; h.RequiredDumpSpace +=
h.PhysicalMemoryBlock.NumberOfPages << ELF2DMP_PAGE_BITS;
*hdr = h; *hdr = h;
@ -300,6 +302,7 @@ static int fill_context(KDDEBUGGER_DATA64 *kdbg,
struct va_space *vs, QEMU_Elf *qe) struct va_space *vs, QEMU_Elf *qe)
{ {
int i; int i;
for (i = 0; i < qe->state_nr; i++) { for (i = 0; i < qe->state_nr; i++) {
uint64_t Prcb; uint64_t Prcb;
uint64_t Context; uint64_t Context;