Skip to content
New issue

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

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

Already on GitHub? # to your account

When the compilation option is set to -DCMAKE_BUILD_TYPE=RelWithDebInfo, it appears to have some issues. #192

Closed
Eternity1987 opened this issue Dec 2, 2024 · 5 comments

Comments

@Eternity1987
Copy link

When the compilation option is set to -DCMAKE_BUILD_TYPE=RelWithDebInfo, cpptrace cannot collect specific stack information, but gdb can. However, when set to -DCMAKE_BUILD_TYPE=DEBUG, both cpptrace and gdb can collect the stack information. Why is this the case?

@Eternity1987
Copy link
Author

cpptrace tag : 0.7.1
compilation option
cmake-args:
- -DCMAKE_BUILD_TYPE=Release
- -DCPPTRACE_BUILD_SHARED=ON
- -DCPPTRACE_GET_SYMBOLS_WITH_LIBDWARF=ON
- -DCPPTRACE_UNWIND_WITH_UNWIND=ON
- -DCPPTRACE_DEMANGLE_WITH_CXXABI=ON
- -DCPPTRACE_USE_EXTERNAL_ZSTD=ON
- -DCPPTRACE_USE_EXTERNAL_LIBDWARF=ON

@jeremy-rifkin
Copy link
Owner

Hi,
I threw a quick test together locally but I see traces produced as expected -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCPPTRACE_BUILD_SHARED=ON -DCPPTRACE_UNWIND_WITH_UNWIND=ON -DCPPTRACE_DEMANGLE_WITH_CXXABI=ON:

image

Could you provide some more information?

I see in your followup comment you mentioned

-DCMAKE_BUILD_TYPE=Release

It's not unexpected that a stack trace would be empty under -DCMAKE_BUILD_TYPE=Release as debug symbols aren't included by default under Release.

@Eternity1987
Copy link
Author

The option -DCMAKE_BUILD_TYPE=Release is used to compile the cpptrace dynamic library, while the executable is linked with cpptrace using -DCMAKE_BUILD_TYPE=RelWithDebInfo.

@jeremy-rifkin
Copy link
Owner

Thanks for clarifying. Is there any additional information you can provide to help me reproduce?

What platform are you on? What output are you seeing? What version of libdwarf are you using?

@jeremy-rifkin
Copy link
Owner

I'm closing for now since I have been unable to reproduce. Please feel free to re-open if there's additional info or anything that could help with reproduction. If you run into any more issues please let me know.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants