]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
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:12:46 +0000 (16:12 +0200)
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

src/debug.c

index 6e5148e300d3e40b9d4c91ade71eb7ebcde5fb66..fb4d7847fd3243772c017557785f64f818efdc3c 100644 (file)
@@ -156,7 +156,7 @@ struct post_mortem {
         */
        uint nb_components;              // # of components below
        struct post_mortem_component *components; // NULL or array
-} post_mortem ALIGNED(256) = { };
+} post_mortem ALIGNED(256) HA_SECTION("_post_mortem") = { };
 
 unsigned int debug_commands_issued = 0;