MINOR: debug: place a magic pattern at the beginning of post_mortem
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Oct 2024 09:56:07 +0000 (11:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Oct 2024 14:55:20 +0000 (16:55 +0200)
commitc4b1c0b2760d78ad0d425605c11e1e27d8410c3f
treeed50e5bfa2ebee7c94611d644a2643b57cfe39b8
parent3f31155977f94558b0ef4638dee29962c2df6b2c
MINOR: debug: place a magic pattern at the beginning of post_mortem

In order to ease finding of the post_mortem struct in core dumps, let's
make it start with a recognizable pattern of exactly 32 chars (to
preserve alignment):

  "POST-MORTEM STARTS HERE+7654321\0"

It can then be found like this from gdb:

  (gdb) find 0x000000012345678, 0x0000000100000000, 'P','O','S','T','-','M','O','R','T','E','M'
  0xcfd300 <post_mortem>
  1 pattern found.

Or easier with any other more practical tool (who as ever used "find" in
gdb, given that it cannot iterate over maps and is 100% useless?).

(cherry picked from commit 989b02e1930d7ecd1a728c3d18ccfba095cdd636)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/debug.c