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

does gtest support print callstack #1621

Closed
martin041313 opened this issue Jun 6, 2018 · 4 comments
Closed

does gtest support print callstack #1621

martin041313 opened this issue Jun 6, 2018 · 4 comments

Comments

@martin041313
Copy link

there is one cmd line option: stack_trace_depth
which in code is GTEST_FLAG(stack_trace_depth)
but I did not see the implement of CurrentStackTrace

@gennadiycivil
Copy link
Contributor

Sorry for the delay.
You can use GTEST_OS_STACK_TRACE_GETTER_ as described in https://github.com/google/googletest/blob/master/googletest/include/gtest/internal/custom/README.md
In addition , if you enable GTEST_HAS_ABSL you can use absl's stack trace library - see https://github.com/abseil/abseil-cpp/blob/master/absl/debugging/stacktrace.h

@Polybios90
Copy link

Polybios90 commented Mar 27, 2020

@gennadiycivil

You can use GTEST_OS_STACK_TRACE_GETTER_ as described in

There is actually no real description of how to use the GTEST_OS_STACK_TRACE_GETTER_ macro. Where should I define it?

I sincerely ask for further documentation on this matter. E.g. an example of how to define macros in the named custom directory in general.

@Polybios90
Copy link

So it is meant to define GTEST_OS_STACK_TRACE_GETTER_ in include/gtest/internal/custom/gtest.h right? However, to provide an implementation of OsStrackTraceGetterInterface one requires to include /src/gtest-internal-inl.h. Why is this particular header not also in the include/gtest/internal directory?

@gennadiycivil Could you provide clarification on this matter?

@gennadiycivil
Copy link
Contributor

@asoffer

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