如何在QBA版本的Cobalt中打印fucntion call suquence的回溯?

时间:2017-01-13 05:25:11

标签: cobalt

base::debug::StackTrace无法通过具有Cobalt QA版本的界面BacktracePrintBacktrace()打印OutputToStream()函数调用序列,因此有没有办法打印使用Cobalt QA版本回溯?

1 个答案:

答案 0 :(得分:0)

src/base/debug/stack_trace_starboard.cc中,StackTrace::PrintBacktrace()将堆栈传递给PrintBacktraceOutputHandler,最终输出到SbLogRaw()src/starboard/shared/posix/log_raw.ccwrite() 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版本中的表现如何,看看你的问题是什么。