summaryrefslogtreecommitdiff
path: root/include/libcamera/base/backtrace.h
blob: bb77c73b67e3c739ae2707e7236d067f8d41180c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2021, Ideas on Board Oy
 *
 * backtrace.h - Call stack backtraces
 */
#ifndef __LIBCAMERA_BASE_BACKTRACE_H__
#define __LIBCAMERA_BASE_BACKTRACE_H__

#include <string>
#include <vector>

#include <libcamera/base/private.h>

#include <libcamera/base/class.h>

namespace libcamera {

class Backtrace
{
public:
	Backtrace();

	std::string toString(unsigned int skipLevels = 0) const;

private:
	LIBCAMERA_DISABLE_COPY(Backtrace)

	bool backtraceTrace();
	bool unwindTrace();

	std::vector<void *> backtrace_;
	std::vector<std::string> backtraceText_;
};

} /* namespace libcamera */

#endif /* __LIBCAMERA_BASE_BACKTRACE_H__ */