LLDB  mainline
RegisterContextFreeBSD_i386.cpp
Go to the documentation of this file.
1 //===-- RegisterContextFreeBSD_i386.cpp ------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===---------------------------------------------------------------------===//
8 
11 
12 using namespace lldb_private;
13 using namespace lldb;
14 
15 // http://svnweb.freebsd.org/base/head/sys/x86/include/reg.h
16 struct GPR {
36 };
37 
38 struct dbreg {
39  uint32_t dr[8]; /* debug registers */
40  /* Index 0-3: debug address registers */
41  /* Index 4-5: reserved */
42  /* Index 6: debug status */
43  /* Index 7: debug control */
44 };
45 
46 using FPR_i386 = FXSAVE;
47 
48 struct UserArea {
51 };
52 
53 #define DR_SIZE sizeof(uint32_t)
54 #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index]))
55 
56 // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure.
57 #define DECLARE_REGISTER_INFOS_I386_STRUCT
58 #include "RegisterInfos_i386.h"
59 #undef DECLARE_REGISTER_INFOS_I386_STRUCT
60 
62  const ArchSpec &target_arch)
63  : RegisterInfoInterface(target_arch) {}
64 
65 size_t RegisterContextFreeBSD_i386::GetGPRSize() const { return sizeof(GPR); }
66 
67 const RegisterInfo *RegisterContextFreeBSD_i386::GetRegisterInfo() const {
68  switch (m_target_arch.GetMachine()) {
69  case llvm::Triple::x86:
70  return g_register_infos_i386;
71  default:
72  assert(false && "Unhandled target architecture.");
73  return NULL;
74  }
75 }
76 
78  return static_cast<uint32_t>(sizeof(g_register_infos_i386) /
79  sizeof(g_register_infos_i386[0]));
80 }
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
RegisterInfo interface to patch RegisterInfo structure for archs.
An architecture specification class.
Definition: ArchSpec.h:32
const lldb_private::RegisterInfo * GetRegisterInfo() const override
uint32_t GetRegisterCount() const override
RegisterContextFreeBSD_i386(const lldb_private::ArchSpec &target_arch)
struct _GPR GPR
Definition: SBAddress.h:15
llvm::Triple::ArchType GetMachine() const
Returns a machine family for the current architecture.
Definition: ArchSpec.cpp:726