/src/libreoffice/include/sal/backtrace.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | */ |
9 | | |
10 | | #ifndef INCLUDED_SAL_BACKTRACE_HXX |
11 | | #define INCLUDED_SAL_BACKTRACE_HXX |
12 | | |
13 | | #include "sal/config.h" |
14 | | #include "sal/saldllapi.h" |
15 | | #include "sal/types.h" |
16 | | #include "rtl/ustring.hxx" |
17 | | |
18 | | /// @cond INTERNAL |
19 | | /** |
20 | | Two stage API for recording and then later decoding stack backtraces. |
21 | | Useful for debugging facilities where we are only interested in decoding |
22 | | a small handful of recorded stack traces. |
23 | | |
24 | | @param backtraceDepth value indicating the maximum backtrace depth; must be > 0 |
25 | | |
26 | | @since LibreOffice 6.0 |
27 | | */ |
28 | | #if defined LIBO_INTERNAL_ONLY |
29 | | |
30 | | namespace sal |
31 | | { |
32 | | struct BacktraceState |
33 | | { |
34 | | void** buffer; |
35 | | int nDepth; |
36 | 0 | ~BacktraceState() { delete[] buffer; } |
37 | | }; |
38 | | |
39 | | SAL_DLLPUBLIC std::unique_ptr<BacktraceState> backtrace_get(sal_uInt32 backtraceDepth); |
40 | | |
41 | | SAL_DLLPUBLIC OUString backtrace_to_string(BacktraceState* backtraceState); |
42 | | } |
43 | | |
44 | | #endif |
45 | | |
46 | | #endif |
47 | | |
48 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |