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

Looks like this doesn't work with more recent versions of libdwarf #298

Open
fzakaria opened this issue Jun 16, 2023 · 3 comments
Open

Looks like this doesn't work with more recent versions of libdwarf #298

fzakaria opened this issue Jun 16, 2023 · 3 comments

Comments

@fzakaria
Copy link

I am seeing a bunch of failures with a recent version of libdwarf

In file included from third_party/backward-cpp/suicide.cc:38:
bazel-out/k8-dbg/bin/external/backward-cpp/_virtual_includes/backward-cpp/backward/backward.hpp:2252:12: error: no matching function for call to 'dwarf_finish'
    return dwarf_finish(dwarf, NULL);
           ^~~~~~~~~~~~
bazel-out/k8-dbg/bin/external/libdwarf/_virtual_includes/libdwarf/libdwarf.h:1578:12: note: candidate function not viable: requires single argument 'dw_dbg', but 2 arguments were provided
DW_API int dwarf_finish(Dwarf_Debug dw_dbg);
           ^
In file included from third_party/backward-cpp/suicide.cc:38:
bazel-out/k8-dbg/bin/external/backward-cpp/_virtual_includes/backward-cpp/backward/backward.hpp:2467:57: error: use of undeclared identifier 'DW_DLC_READ'
    int dwarf_result = dwarf_elf_init(elf_handle.get(), DW_DLC_READ, NULL, NULL,
                                                        ^
bazel-out/k8-dbg/bin/external/backward-cpp/_virtual_includes/backward-cpp/backward/backward.hpp:2570:21: error: no matching function for call to 'dwarf_formref'
                if (dwarf_formref(attr_mem, &spec_offset, &error) ==
                    ^~~~~~~~~~~~~
bazel-out/k8-dbg/bin/external/libdwarf/_virtual_includes/libdwarf/libdwarf.h:2694:12: note: candidate function not viable: requires 4 arguments, but 3 were provided
DW_API int dwarf_formref(Dwarf_Attribute dw_attr,
           ^
In file included from third_party/backward-cpp/suicide.cc:38:
bazel-out/k8-dbg/bin/external/backward-cpp/_virtual_includes/backward-cpp/backward/backward.hpp:2584:22: error: use of undeclared identifier 'dwarf_siblingof'
        int result = dwarf_siblingof(dwarf, current_die, &sibling_die, &error);
                     ^
bazel-out/k8-dbg/bin/external/backward-cpp/_virtual_includes/backward-cpp/backward/backward.hpp:2614:18: error: no matching function for call to 'dwarf_formref'
        result = dwarf_formref(attr_mem, &offset, &error);
@okeuday
Copy link
Contributor

okeuday commented Jun 16, 2023

@fzakaria Yes, the issue for that is #232 . The newer versions have a completely different API, so it would require a different macro for the support. However, there may not be a significant increase in information when compared to using libbfd instead, to justify adding the new libdwarf API.

@fzakaria
Copy link
Author

Cool thanks.
Maybe worth a disclaimer..

I also finally got this all working in my own repo with Bazel....not sure if all that effort for Bazel is worth the cost. Love everything about it except third party stuff.

@flagarde
Copy link

Recent libdwarf seems to skip libelf as dependency which would simplify compilation from strach of the lib

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

No branches or pull requests

3 participants