MINOR: tools: add new function dump_addr_and_bytes()
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Mar 2020 14:57:10 +0000 (15:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 May 2020 15:09:20 +0000 (17:09 +0200)
commit77526f6728faad43f25359d107419081640b2b18
treeaea88afd2d38ebc14178ea8c3ff1f0fa27335fae
parent2e44201fcf194fe4cb28a5eb2d19c9f36b797a7b
MINOR: tools: add new function dump_addr_and_bytes()

This function dumps <n> bytes from <addr> in hex form into buffer <buf>
enclosed in brackets after the address itself, formatted on 14 chars
including the "0x" prefix. This is meant to be used as a prefix for code
areas. For example: "0x7f10b6557690 [48 c7 c0 0f 00 00 00 0f]: "
It relies on may_access() to know if the bytes are dumpable, otherwise "--"
is emitted. An optional prefix is supported.

(cherry picked from commit 762fb3ec8e05ca7a61b28e8a876c194c9db591ef)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/common/standard.h
src/standard.c