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

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

Open
Eternity1987 opened this issue Dec 2, 2024 · 4 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?

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

No branches or pull requests

2 participants