Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit e6786ed

Browse files
Geod24dlang-bot
authored andcommitted
Trivial: Add documentation to LibunwindHandler about -L--export-dynamic
1 parent 665b353 commit e6786ed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/core/internal/backtrace/handler.d

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
* Runtime.traceHandler = &libunwindDefaultTraceHandler;
1111
* ---
1212
*
13+
* Note that this module uses `dladdr` to retrieve the function's name.
14+
* To ensure that local (non-library) functions have their name printed,
15+
* the flag `-L--export-dynamic` must be used while compiling,
16+
* otherwise only the executable name will be available.
17+
*
1318
* Authors: Mathias 'Geod24' Lang
1419
* Copyright: D Language Foundation - 2020
1520
* See_Also: https://www.nongnu.org/libunwind/man/libunwind(3).html
@@ -87,6 +92,7 @@ class LibunwindHandler : Throwable.TraceInfo
8792
static const(char)[] getFrameName (const(void)* ptr)
8893
{
8994
Dl_info info = void;
95+
// Note: See the module documentation about `-L--export-dynamic`
9096
if (dladdr(ptr, &info))
9197
{
9298
// Return symbol name if possible

0 commit comments

Comments
 (0)