Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Process/Utility/NativeRegisterContextRegisterInfo.cpp
96380 views
//===-- NativeRegisterContextRegisterInfo.cpp -----------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "NativeRegisterContextRegisterInfo.h"9#include "lldb/lldb-private-forward.h"10#include "lldb/lldb-types.h"1112using namespace lldb_private;1314NativeRegisterContextRegisterInfo::NativeRegisterContextRegisterInfo(15NativeThreadProtocol &thread,16RegisterInfoInterface *register_info_interface)17: NativeRegisterContext(thread),18m_register_info_interface_up(register_info_interface) {19assert(register_info_interface && "null register_info_interface");20}2122uint32_t NativeRegisterContextRegisterInfo::GetRegisterCount() const {23return m_register_info_interface_up->GetRegisterCount();24}2526uint32_t NativeRegisterContextRegisterInfo::GetUserRegisterCount() const {27return m_register_info_interface_up->GetUserRegisterCount();28}2930const RegisterInfo *NativeRegisterContextRegisterInfo::GetRegisterInfoAtIndex(31uint32_t reg_index) const {32if (reg_index <= GetRegisterCount())33return m_register_info_interface_up->GetRegisterInfo() + reg_index;34else35return nullptr;36}3738const RegisterInfoInterface &39NativeRegisterContextRegisterInfo::GetRegisterInfoInterface() const {40return *m_register_info_interface_up;41}424344