Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libdwfl based implementation #187

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

kanje
Copy link

@kanje kanje commented Sep 19, 2024

This commit adds an implementation based on libdwfl from elfutils.

Implements #176

@kanje
Copy link
Author

kanje commented Sep 19, 2024

@apolukhin, please have a look at this draft. Note, I was using CMake and b2 support is still missing. I would appreciate some help here as I know nothing about how to write Jamfiles.

@apolukhin
Copy link
Member

Tests are missing. You will need to write some b2 scripts: follow this sample

lib boost_stacktrace_backtrace
: # sources
../src/backtrace.cpp
: # requirements
<warnings>all
<target-os>linux:<library>dl
<library>backtrace
<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
[ check-target-builds libbacktrace : : <build>no ]
: # default build
: # usage-requirements
#<link>shared:<define>BOOST_STACKTRACE_DYN_LINK=1
<define>BOOST_STACKTRACE_NO_LIB=1
;
and add code to search for libdwfl
local LIBBACKTRACE_PATH = [ modules.peek : LIBBACKTRACE_PATH ] ;
lib backtrace
:
: <search>$(LIBBACKTRACE_PATH)/lib <link>static
:
: <include>$(LIBBACKTRACE_PATH)/include
;

After that adjust https://github.com/boostorg/stacktrace/blob/develop/test/Jamfile.v2 by adding each of the tests with libdwfl

This commit adds an implementation based on libdwfl from
elfutils.

Implements boostorg#176
@kanje kanje marked this pull request as ready for review November 24, 2024 17:16
Copy link
Member

@apolukhin apolukhin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the long delay. The PR looks very good!

A few more things to fix:

  • As I see in CI runs the dw library is not found and the new functionality is not tested. Please adjust the content of .github/workflows/ directory to test the new implementation
  • One of the Boost specific linters complains that the build/has_dwfl.cpp, include/boost/stacktrace/detail/libdwfl_impls.hpp, src/dwfl.cpp files have no Copyright notes. Copypaste the Copyright message and place your name in it (or place my name if you wish to remain anonymous)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants