aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/backtrace/cursors/interop/interop.h
blob: 62e7177107c101c71c390a501023f72c313b0570 (plain) (blame)
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
#pragma once

#include <library/cpp/yt/backtrace/cursors/frame_pointer/frame_pointer_cursor.h>

#include <contrib/libs/libunwind/include/libunwind.h>

#include <util/system/context.h>

#include <optional>

namespace NYT::NBacktrace {

////////////////////////////////////////////////////////////////////////////////

TFramePointerCursorContext FramePointerCursorContextFromUcontext(const ucontext_t& ucontext);

std::optional<unw_context_t> TrySynthesizeLibunwindContextFromMachineContext(
    const TContMachineContext& machineContext);

TFramePointerCursorContext FramePointerCursorContextFromLibunwindCursor(
    const unw_cursor_t& uwCursor);

////////////////////////////////////////////////////////////////////////////////

} // namespace NYT::NBacktrace