xref: /aosp_15_r20/external/pigweed/pw_hex_dump/docs.rst (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1.. _module-pw_hex_dump:
2
3===========
4pw_hex_dump
5===========
6.. pigweed-module::
7   :name: pw_hex_dump
8
9Sometimes on embedded systems there's a desire to view memory contents when
10debugging various issues. While in some cases this can be done by attaching an
11in-circuit debugger of some kind, form-factor hardware might not have this as an
12option due to size constraints. Additionally, there's often quite a bit more
13setup involved than simply adding a print statement.
14
15A common practice to address this is setting up print statements that dump data
16as logs when a certain event occurs. There's often value to formatting these
17dumps as human readable key-value pairs, but sometimes there's a need to see the
18raw binary data in different ways. This can help validate in memory/on flash
19binary structure of stored data, among other things.
20
21``pw_hex_dump`` is a handy toolbox that provides utilities to help dump data as
22hex to debug issues. Unless otherwise specified, avoid depending directly on the
23formatting of the output as it may change (unless otherwise specified). With
24that said, the ``FormattedHexDumper`` strives to be xxd compatible by default.
25
26.. toctree::
27   :hidden:
28   :maxdepth: 1
29
30   api
31