19#include "llvm/Support/Endian.h"
21#if defined(__FreeBSD__) && defined(__aarch64__)
22#include <machine/pcb.h>
30 Thread &thread, std::unique_ptr<RegisterInfoPOSIX_arm64> register_info_up,
56 llvm::support::ulittle64_t x[12];
57 llvm::support::ulittle64_t
sp;
60#if defined(__FreeBSD__) && defined(__aarch64__) && __FreeBSD_version >= 1400084
61 static_assert(offsetof(
struct pcb, pcb_x) == offsetof(
decltype(pcb), x));
62 static_assert(offsetof(
struct pcb, pcb_sp) == offsetof(
decltype(pcb),
sp));
67 llvm::support::ulittle64_t x[30];
68 llvm::support::ulittle64_t lr;
69 llvm::support::ulittle64_t _reserved;
70 llvm::support::ulittle64_t
sp;
73#if defined(__FreeBSD__) && defined(__aarch64__) && __FreeBSD_version < 1400084
74 static_assert(offsetof(
struct pcb, pcb_x) == offsetof(
decltype(pcb13), x));
75 static_assert(offsetof(
struct pcb, pcb_lr) == offsetof(
decltype(pcb13), lr));
76 static_assert(offsetof(
struct pcb, pcb_sp) == offsetof(
decltype(pcb13),
sp));
80 constexpr int FBSD14 = 1400084;
81 int osreldate = FBSD14;
84 osreldate = *osreldate_or_null;
87 "Cannot find osreldate. Defaulting to %d.", FBSD14);
90 if (osreldate >= FBSD14) {
91 constexpr uint32_t pcb_fp = 10;
92 constexpr uint32_t pcb_lr = 11;
95 if (rd !=
sizeof(pcb))
112 "nonconsecutive arm64 register numbers");
121 "nonconsecutive arm64 register numbers");
129 sizeof(pcb13),
error);
130 if (rd !=
sizeof(pcb13))
166 "nonconsecutive arm64 register numbers");
193 Target &target = process_sp->GetTarget();
213 process_sp->ReadMemory(addr, &osreldate,
sizeof(osreldate),
error);
214 if (bytes_read ==
sizeof(osreldate) &&
error.Success())
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOGF(log,...)
std::optional< int > GetOsreldate()
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
RegisterContextFreeBSDKernelCore_arm64(lldb_private::Thread &thread, std::unique_ptr< RegisterInfoPOSIX_arm64 > register_info_up, lldb::addr_t pcb_addr)
RegisterContextPOSIX_arm64(lldb_private::Thread &thread, std::unique_ptr< RegisterInfoPOSIX_arm64 > register_info)
A uniqued constant string class.
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
Defines a list of symbol context objects.
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
uint32_t GetSize() const
Get accessor for a symbol context list size.
Defines a symbol context baton that can be handed other debug core functions.
Symbol * symbol
The Symbol for a given query.
lldb::addr_t GetLoadAddress(Target *target) const
const ModuleList & GetImages() const
Get accessor for the images for this process.
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::shared_ptr< lldb_private::Process > ProcessSP
@ eRegisterKindLLDB
lldb's internal register numbers
Every register is described in detail including its name, alternate name (optional),...
uint32_t kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.