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