]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: debug: make ABORT_NOW() store the caller's line number when using abort
authorWilly Tarreau <w@1wt.eu>
Fri, 2 Feb 2024 16:09:09 +0000 (17:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 2 Feb 2024 16:12:06 +0000 (17:12 +0100)
commitd480b7be9663643025174eae5e047e42f7bdfc37
tree413feb5d52eeb6e0c5da537551d91d2ed31658c6
parent2bb192ba911a00d554db592bd5d80ab56e9c7398
MINOR: debug: make ABORT_NOW() store the caller's line number when using abort

Placing DO_NOT_FOLD() before abort() only works in -O2 but not in -Os which
continues to place only 5 calls to abort() in h3.o for call places. The
approach taken here is to replace abort() with a new function that wraps
it and stores the line number in the stack. This slightly increases the
code size (+0.1%) but when unwinding a crash, the line number remains
present now. This is a very low cost, especially if we consider that
DEBUG_USE_ABORT is almost only used by code coverage tools and occasional
debugging sessions.
include/haproxy/bug.h