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>
Tue, 3 Mar 2020 16:46:37 +0000 (17:46 +0100)
commit762fb3ec8e05ca7a61b28e8a876c194c9db591ef
tree58f6355905dfb83c1b1cfcf15c45681cd15fac43
parent55a6c4f34de59cc3d5d5079968e382c6fc303ef9
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.
include/common/standard.h
src/standard.c