2021-11-21 23:59:44 +00:00
|
|
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
2022-11-02 00:05:16 +00:00
|
|
|
// SPDX-License-Identifier: LGPL-2.1-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 */
|