simpletrace: improved error handling on struct unpack
authorMads Ynddal <m.ynddal@samsung.com>
Tue, 26 Sep 2023 10:34:28 +0000 (12:34 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 26 Sep 2023 16:28:51 +0000 (12:28 -0400)
commitd1f9259014317baa3bce7db7d4c2e927341e3cae
treefe2a96fcafdda90c153f5a4656633ae3bf66d7ee
parentce96eb334dc0a3a7f570f422e8a578495f34e4f2
simpletrace: improved error handling on struct unpack

A failed call to `read_header` wouldn't be handled the same for the two
different code paths (one path would try to use `None` as a list).
Changed to raise exception to be handled centrally. This also allows for
easier unpacking, as errors has been filtered out.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Mads Ynddal <m.ynddal@samsung.com>
Message-id: 20230926103436.25700-7-mads@ynddal.dk
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
scripts/simpletrace.py