diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2015-11-04 16:09:57 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-11-12 16:13:32 -0800 |
commit | 13f70177511d825a71991d542925ce97c5e370d3 (patch) | |
tree | f1c81530cccc889bd608cc2dff36c7d36ca510fb | |
parent | bd83bb8f368f6b7285567090b51663b50f494671 (diff) | |
download | chrome-ec-13f70177511d825a71991d542925ce97c5e370d3.tar.gz |
util: signer: improve debug output readability
Assorted modifications which make it easier to follow debug output,
when enabled.
BRANCH=none
BUG=none
TEST=ran signer in verbose mode, observe improved debug output.
Change-Id: Ieb2e7012342480217388dd5001b61ea95adf71a4
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/311312
Reviewed-by: Nagendra Modadugu <ngm@google.com>
-rw-r--r-- | util/signer/codesigner.cc | 8 | ||||
-rw-r--r-- | util/signer/image.cc | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/util/signer/codesigner.cc b/util/signer/codesigner.cc index 547c829c8f..35056570fc 100644 --- a/util/signer/codesigner.cc +++ b/util/signer/codesigner.cc @@ -486,8 +486,10 @@ int main(int argc, char* argv[]) { } // Print out fuse hash input. - VERBOSE("expected fuse state:\n"); + VERBOSE("expected fuse state:"); for (size_t i = 0; i < FUSE_MAX; ++i) { + if (! (i % 8)) + VERBOSE("\n"); VERBOSE("%08x ", fuse_values[i]); } VERBOSE("\n"); @@ -509,8 +511,10 @@ int main(int argc, char* argv[]) { // TODO: read values from JSON or implement version logic here. // Print out info hash input. - VERBOSE("expected info state:\n"); + VERBOSE("expected info state:"); for (size_t i = 0; i < INFO_MAX; ++i) { + if (! (i % 8)) + VERBOSE("\n"); VERBOSE("%08x ", info_values[i]); } VERBOSE("\n"); diff --git a/util/signer/image.cc b/util/signer/image.cc index ac84957492..d5e67db297 100644 --- a/util/signer/image.cc +++ b/util/signer/image.cc @@ -107,25 +107,30 @@ bool Image::fromElf(const string& filename) { gelf_getshdr(scn, &shdr); VERBOSE("type %08x; flags %08lx ", shdr.sh_type, shdr.sh_flags); - VERBOSE("%08lx(@%08lx)[%08lx] align %lu\n", + VERBOSE("%08lx(@%08lx)[%08lx] align %lu ", shdr.sh_addr, shdr.sh_offset, shdr.sh_size, shdr.sh_addralign); // Ignore sections that are not alloc if (!(shdr.sh_flags & SHF_ALLOC)) { + VERBOSE("non aloc, ignored\n"); continue; } // Ignore sections that are not exec if (!(shdr.sh_flags & SHF_EXECINSTR)) { + VERBOSE("non exec, ignored\n"); continue; } // Ignore sections outside our flash range if (shdr.sh_addr < FLASH_START * 16 || shdr.sh_addr + shdr.sh_size >= FLASH_END * 16) { + VERBOSE("out of bounds, ignored\n"); continue; } + VERBOSE("\n"); + // Track rx boundaries if (shdr.sh_addr < rx_base_) { rx_base_ = shdr.sh_addr; @@ -141,13 +146,14 @@ bool Image::fromElf(const string& filename) { phdr.p_vaddr, phdr.p_paddr, phdr.p_filesz, phdr.p_memsz); if (phdr.p_filesz != phdr.p_memsz) { - VERBOSE(" (not loading)\n"); + VERBOSE(" (size mismatch, not loading)\n"); continue; } // Ignore sections outside our flash range if (phdr.p_paddr < FLASH_START * 16 || phdr.p_paddr + phdr.p_memsz >= FLASH_END * 16) { + VERBOSE(" (out of bounds, not loading)\n"); continue; } |