2021-11-21 23:59:44 +00:00
|
|
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
2021-04-03 09:10:35 +01:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2020-05-13 07:21:50 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* Stack trace internals
|
|
|
|
*
|
|
|
|
* See @ref StackTraceInternals.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DRGN_STACK_TRACE_H
|
|
|
|
#define DRGN_STACK_TRACE_H
|
|
|
|
|
2021-11-10 23:09:29 +00:00
|
|
|
#include <elfutils/libdw.h>
|
2021-02-23 22:31:01 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
|
2020-05-13 07:21:50 +01:00
|
|
|
/**
|
|
|
|
* @ingroup Internals
|
|
|
|
*
|
|
|
|
* @defgroup StackTraceInternals Stack traces
|
|
|
|
*
|
|
|
|
* Stack trace internals.
|
|
|
|
*
|
|
|
|
* This provides the internal data structures used for stack traces.
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2021-03-10 09:51:33 +00:00
|
|
|
struct drgn_stack_frame {
|
|
|
|
struct drgn_register_state *regs;
|
2020-12-02 19:24:05 +00:00
|
|
|
Dwarf_Die *scopes;
|
|
|
|
size_t num_scopes;
|
|
|
|
size_t function_scope;
|
2021-03-10 09:51:33 +00:00
|
|
|
};
|
|
|
|
|
2020-05-13 07:21:50 +01:00
|
|
|
struct drgn_stack_trace {
|
|
|
|
struct drgn_program *prog;
|
|
|
|
size_t num_frames;
|
2021-03-10 09:51:33 +00:00
|
|
|
struct drgn_stack_frame frames[];
|
2020-05-13 07:21:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
#endif /* DRGN_STACK_TRACE_H */
|