• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_STACK_TRACE_H_
6 #define QUICHE_COMMON_PLATFORM_API_QUICHE_STACK_TRACE_H_
7 
8 #include <string>
9 
10 #include "quiche_platform_impl/quiche_stack_trace_impl.h"
11 
12 namespace quiche {
13 
14 // Returns a human-readable stack trace.  Mostly used in error logging and
15 // related features.
QuicheStackTrace()16 inline std::string QuicheStackTrace() { return QuicheStackTraceImpl(); }
17 
18 // Indicates whether the unit test for QuicheStackTrace() should be run.  The
19 // unit test calls QuicheStackTrace() from a specific function and checks
20 // whether that specific function is in the stack trace.  This function should
21 // return false if:
22 //   (1) QuicheStackTrace() is unimplemented,
23 //   (2) QuicheStackTrace() does not work on the current platform, or
24 //   (3) QuicheStackTrace() works, but the symbols are not guaranteed to be
25 //       available.
QuicheShouldRunStackTraceTest()26 inline bool QuicheShouldRunStackTraceTest() {
27   return QuicheShouldRunStackTraceTestImpl();
28 }
29 
30 }  // namespace quiche
31 
32 #endif  // QUICHE_COMMON_PLATFORM_API_QUICHE_STACK_TRACE_H_
33