Message ID | 1483663326-32107-1-git-send-email-oohall@gmail.com |
---|---|
State | Accepted |
Headers | show |
Oliver O'Halloran <oohall@gmail.com> writes: > The HDAT has very fixed relationships between a parent and child > structures. When parsing the HDAT we always know what type of child > that we expect and we will error out if there is a mismatch between what > we get and what expect. This patch just prints out what we got in > addition to what we expected to help with debugging. > > Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Thanks, merged to master as of 8993ea78c27e6ebf5ac503cb23ed9b39abfc3490
diff --git a/hdata/hdif.c b/hdata/hdif.c index 25c00008138f..62ba69f2e887 100644 --- a/hdata/hdif.c +++ b/hdata/hdif.c @@ -131,8 +131,8 @@ struct HDIF_common_hdr *HDIF_child(const struct HDIF_common_hdr *hdif, ret = base + be32_to_cpu(child->offset) + be32_to_cpu(child->size) * idx; if (!HDIF_check(ret, eyecatcher)) { - prerror("HDIF: %s child #%i bad type\n", - eyecatcher, idx); + prerror("HDIF: #%i bad type (wanted %6s, got %6s)\n", + idx, eyecatcher, ret->id); return NULL; }
The HDAT has very fixed relationships between a parent and child structures. When parsing the HDAT we always know what type of child that we expect and we will error out if there is a mismatch between what we get and what expect. This patch just prints out what we got in addition to what we expected to help with debugging. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- hdata/hdif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)