From c49d1c37d89a2ea994861600859b7dcd3ffa4ede Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 12 Apr 2024 00:33:23 -0700 Subject: util/hexdump: Add unit_len and block_len to qemu_hexdump_line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generalize the current 1 byte unit and 4 byte blocking within the output. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240412073346.458116-5-richard.henderson@linaro.org> --- include/qemu/cutils.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/qemu') diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 14a3285..da15547 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -287,12 +287,16 @@ int parse_debug_env(const char *name, int max, int initial); * @str: GString into which to append * @buf: buffer to dump * @len: number of bytes to dump + * @unit_len: add a space between every @unit_len bytes + * @block_len: add an extra space between every @block_len bytes * * Append @len bytes of @buf as hexadecimal into @str. + * Add spaces between every @unit_len and @block_len bytes. * If @str is NULL, allocate a new string and return it; * otherwise return @str. */ -GString *qemu_hexdump_line(GString *str, const void *buf, size_t len); +GString *qemu_hexdump_line(GString *str, const void *buf, size_t len, + size_t unit_len, size_t block_len); /* * Hexdump a buffer to a file. An optional string prefix is added to every line -- cgit v1.1