MINOR: debug: place the post_mortem struct in its own section.
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Oct 2024 09:59:32 +0000 (11:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Oct 2024 14:55:20 +0000 (16:55 +0200)
commit9e0fc2a8c5cf45c7ae8021edbb18bfdcdec0988f
treed5721fd18d0be8f7630c1163bde45d3898c96cf5
parentc4b1c0b2760d78ad0d425605c11e1e27d8410c3f
MINOR: debug: place the post_mortem struct in its own section.

Placing it in its own section will ease its finding, particularly in
gdb which is too dumb to find anything in memory. Now it will be
sufficient to issue this:

  $ gdb -ex "info files" -ex "quit" ./haproxy core 2>/dev/null |grep _post_mortem
  0x0000000000cfd300 - 0x0000000000cfe780 is _post_mortem

or this:

   $ objdump -h haproxy|grep post
    34 _post_mortem  00001480  0000000000cfd300  0000000000cfd300  008fc300  2**8

to spot the symbol's address. Then it can be read this way:

   (gdb) p *(struct post_mortem *)0x0000000000cfd300

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