如何使用 QA 版本在 Cobol 中打印函数调用序列的回溯?
How to Print the backtrace of the fucntion call suquence in Cobalt with QA version?
Cobalt QA 版本的 base::debug::StackTrace
无法通过接口 PrintBacktrace()
或 OutputToStream()
打印函数调用序列的 Backtrace
,所以有没有办法使用 Cobalt QA 版本打印回溯?
在src/base/debug/stack_trace_starboard.cc
中,StackTrace::PrintBacktrace()
将堆栈传递到PrintBacktraceOutputHandler
,最终输出到SbLogRaw()
,在src/starboard/shared/posix/log_raw.cc
中应该write()
到 STDERR_FILENO
,无论构建类型如何。
当我在 linux-x64x11_qa Cobalt 中尝试这个时:
base::debug::StackTrace().PrintBacktrace();
LOG(INFO) << base::debug::StackTrace().ToString();
我打印了两个堆栈跟踪:
SbEventHandle [0x4158e4]
starboard::shared::starboard::Application::DispatchStart() [0x4933b8]
starboard::shared::starboard::Application::Run() [0x49330e]
main [0x48c248]
<unknown> [0x7f272613cf45]
<unknown> [0x4156b9]
<unknown> [0x4156b9]
[0113/132642:INFO:main.cc(37)] SbEventHandle [0x415950]
starboard::shared::starboard::Application::DispatchStart() [0x4933b8]
starboard::shared::starboard::Application::Run() [0x49330e]
main [0x48c248]
<unknown> [0x7f272613cf45]
<unknown> [0x4156b9]
<unknown> [0x4156b9]
由于这最终会写到 SbLogRaw()
,我会看看它在 QA 构建中的表现,看看您的问题是什么。
Cobalt QA 版本的 base::debug::StackTrace
无法通过接口 PrintBacktrace()
或 OutputToStream()
打印函数调用序列的 Backtrace
,所以有没有办法使用 Cobalt QA 版本打印回溯?
在src/base/debug/stack_trace_starboard.cc
中,StackTrace::PrintBacktrace()
将堆栈传递到PrintBacktraceOutputHandler
,最终输出到SbLogRaw()
,在src/starboard/shared/posix/log_raw.cc
中应该write()
到 STDERR_FILENO
,无论构建类型如何。
当我在 linux-x64x11_qa Cobalt 中尝试这个时:
base::debug::StackTrace().PrintBacktrace();
LOG(INFO) << base::debug::StackTrace().ToString();
我打印了两个堆栈跟踪:
SbEventHandle [0x4158e4]
starboard::shared::starboard::Application::DispatchStart() [0x4933b8]
starboard::shared::starboard::Application::Run() [0x49330e]
main [0x48c248]
<unknown> [0x7f272613cf45]
<unknown> [0x4156b9]
<unknown> [0x4156b9]
[0113/132642:INFO:main.cc(37)] SbEventHandle [0x415950]
starboard::shared::starboard::Application::DispatchStart() [0x4933b8]
starboard::shared::starboard::Application::Run() [0x49330e]
main [0x48c248]
<unknown> [0x7f272613cf45]
<unknown> [0x4156b9]
<unknown> [0x4156b9]
由于这最终会写到 SbLogRaw()
,我会看看它在 QA 构建中的表现,看看您的问题是什么。