2021-02-04 19:59:56 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-02-04 19:59:56 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-12-16 17:49:34 +03:30
|
|
|
#include <AK/ByteString.h>
|
2021-06-19 13:21:04 +02:00
|
|
|
#include <LibDebug/DebugInfo.h>
|
2021-02-04 19:59:56 +01:00
|
|
|
|
2021-05-22 18:23:51 +02:00
|
|
|
namespace Symbolication {
|
2021-02-04 19:59:56 +01:00
|
|
|
|
|
|
|
|
struct Symbol {
|
|
|
|
|
FlatPtr address { 0 };
|
2023-12-16 17:49:34 +03:30
|
|
|
ByteString name {};
|
|
|
|
|
ByteString object {};
|
2021-02-04 19:59:56 +01:00
|
|
|
u32 offset { 0 };
|
2021-06-19 13:21:04 +02:00
|
|
|
Vector<Debug::DebugInfo::SourcePosition> source_positions;
|
2021-10-13 23:22:58 +08:00
|
|
|
bool operator==(Symbol const&) const = default;
|
2021-02-04 19:59:56 +01:00
|
|
|
};
|
|
|
|
|
|
2021-10-14 21:36:22 +08:00
|
|
|
enum class IncludeSourcePosition {
|
|
|
|
|
Yes,
|
|
|
|
|
No
|
|
|
|
|
};
|
|
|
|
|
|
2021-07-22 18:41:52 +02:00
|
|
|
Optional<FlatPtr> kernel_base();
|
2021-10-14 21:36:22 +08:00
|
|
|
Vector<Symbol> symbolicate_thread(pid_t pid, pid_t tid, IncludeSourcePosition = IncludeSourcePosition::Yes);
|
2023-12-16 17:49:34 +03:30
|
|
|
Optional<Symbol> symbolicate(ByteString const& path, FlatPtr address, IncludeSourcePosition = IncludeSourcePosition::Yes);
|
2021-02-04 19:59:56 +01:00
|
|
|
|
|
|
|
|
}
|