LLDB  mainline
RegisterContextPOSIX_x86.h
Go to the documentation of this file.
1 //===-- RegisterContextPOSIX_x86.h ------------------------------*- 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 
9 #ifndef liblldb_RegisterContextPOSIX_x86_h_
10 #define liblldb_RegisterContextPOSIX_x86_h_
11 
12 #include "RegisterContext_x86.h"
13 #include "RegisterInfoInterface.h"
16 #include "lldb/Utility/Log.h"
17 
18 class ProcessMonitor;
19 
21 public:
23  uint32_t concrete_frame_idx,
25 
26  ~RegisterContextPOSIX_x86() override;
27 
28  void Invalidate();
29 
30  void InvalidateAllRegisters() override;
31 
32  size_t GetRegisterCount() override;
33 
34  virtual size_t GetGPRSize();
35 
36  virtual size_t GetFXSAVEOffset();
37 
38  virtual unsigned GetRegisterSize(unsigned reg);
39 
40  virtual unsigned GetRegisterOffset(unsigned reg);
41 
42  const lldb_private::RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override;
43 
44  size_t GetRegisterSetCount() override;
45 
46  const lldb_private::RegisterSet *GetRegisterSet(size_t set) override;
47 
48  const char *GetRegisterName(unsigned reg);
49 
51  uint32_t num) override;
52 
53  // Note: prefer kernel definitions over user-land
54  enum FPRType {
55  eNotValid = 0,
56  eFSAVE, // TODO
58  eSOFT, // TODO
60  };
61 
70 
79 
96 
113 
114 protected:
115  struct RegInfo {
120 
124 
133 
136  };
137 
139  // general
140  // purpose
141  // registers.
143  FPRType
144  m_fpr_type; // determines the type of data stored by union FPR, if any.
145  lldb_private::FPR m_fpr; // floating-point registers including extended
146  // register sets.
147  lldb_private::YMM m_ymm_set; // copy of ymmh and xmm register halves.
148  std::unique_ptr<lldb_private::RegisterInfoInterface>
149  m_register_info_up; // Register Info Interface (FreeBSD or Linux)
150 
151  // Determines if an extended register set is supported on the processor
152  // running the inferior process.
153  virtual bool IsRegisterSetAvailable(size_t set_index);
154 
155  virtual const lldb_private::RegisterInfo *GetRegisterInfo();
156 
157  bool IsGPR(unsigned reg);
158 
159  bool IsFPR(unsigned reg);
160 
161  bool IsAVX(unsigned reg);
162 
164 
165  bool CopyXSTATEtoYMM(uint32_t reg, lldb::ByteOrder byte_order);
166  bool CopyYMMtoXSTATE(uint32_t reg, lldb::ByteOrder byte_order);
167  bool IsFPR(unsigned reg, FPRType fpr_type);
169 
170  virtual bool ReadGPR() = 0;
171  virtual bool ReadFPR() = 0;
172  virtual bool WriteGPR() = 0;
173  virtual bool WriteFPR() = 0;
174 };
175 
176 #endif // liblldb_RegisterContextPOSIX_x86_h_
virtual unsigned GetRegisterOffset(unsigned reg)
virtual const lldb_private::RegisterInfo * GetRegisterInfo()
virtual bool WriteGPR()=0
std::unique_ptr< lldb_private::RegisterInfoInterface > m_register_info_up
RegisterInfo interface to patch RegisterInfo structure for archs.
virtual bool ReadGPR()=0
virtual bool WriteFPR()=0
RegisterContextPOSIX_x86(lldb_private::Thread &thread, uint32_t concrete_frame_idx, lldb_private::RegisterInfoInterface *register_info)
uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override
Convert from a given register numbering scheme to the lldb register numbering scheme.
Manages communication with the inferior (debugee) process.
virtual unsigned GetRegisterSize(unsigned reg)
virtual bool IsRegisterSetAvailable(size_t set_index)
const char * GetRegisterName(unsigned reg)
uint64_t m_gpr_x86_64[lldb_private::k_num_gpr_registers_x86_64]
bool CopyYMMtoXSTATE(uint32_t reg, lldb::ByteOrder byte_order)
virtual bool ReadFPR()=0
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
bool CopyXSTATEtoYMM(uint32_t reg, lldb::ByteOrder byte_order)