xref: /freebsd-src/contrib/llvm-project/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
1d409305fSDimitry Andric //===-- NativeRegisterContextDBReg_x86.h ------------------------*- C++ -*-===//
2d409305fSDimitry Andric //
3d409305fSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4d409305fSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5d409305fSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6d409305fSDimitry Andric //
7d409305fSDimitry Andric //===----------------------------------------------------------------------===//
8d409305fSDimitry Andric 
9d409305fSDimitry Andric #ifndef lldb_NativeRegisterContextDBReg_x86_h
10d409305fSDimitry Andric #define lldb_NativeRegisterContextDBReg_x86_h
11d409305fSDimitry Andric 
12d409305fSDimitry Andric #include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
13d409305fSDimitry Andric 
14d409305fSDimitry Andric namespace lldb_private {
15d409305fSDimitry Andric 
16d409305fSDimitry Andric class NativeRegisterContextDBReg_x86
17d409305fSDimitry Andric     : public virtual NativeRegisterContextRegisterInfo {
18d409305fSDimitry Andric public:
19fe6060f1SDimitry Andric   // NB: This constructor is here only because gcc<=6.5 requires a virtual base
20fe6060f1SDimitry Andric   // class initializer on abstract class (even though it is never used). It can
21fe6060f1SDimitry Andric   // be deleted once we move to gcc>=7.0.
NativeRegisterContextDBReg_x86(NativeThreadProtocol & thread)22fe6060f1SDimitry Andric   NativeRegisterContextDBReg_x86(NativeThreadProtocol &thread)
23fe6060f1SDimitry Andric       : NativeRegisterContextRegisterInfo(thread, nullptr) {}
24fe6060f1SDimitry Andric 
25d409305fSDimitry Andric   Status IsWatchpointHit(uint32_t wp_index, bool &is_hit) override;
26d409305fSDimitry Andric 
27d409305fSDimitry Andric   Status GetWatchpointHitIndex(uint32_t &wp_index,
28d409305fSDimitry Andric                                lldb::addr_t trap_addr) override;
29d409305fSDimitry Andric 
30d409305fSDimitry Andric   Status IsWatchpointVacant(uint32_t wp_index, bool &is_vacant) override;
31d409305fSDimitry Andric 
32d409305fSDimitry Andric   bool ClearHardwareWatchpoint(uint32_t wp_index) override;
33d409305fSDimitry Andric 
34d409305fSDimitry Andric   Status ClearWatchpointHit(uint32_t wp_index) override;
35d409305fSDimitry Andric 
36d409305fSDimitry Andric   Status ClearAllHardwareWatchpoints() override;
37d409305fSDimitry Andric 
38d409305fSDimitry Andric   Status SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size,
39d409305fSDimitry Andric                                         uint32_t watch_flags,
40d409305fSDimitry Andric                                         uint32_t wp_index);
41d409305fSDimitry Andric 
42d409305fSDimitry Andric   uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size,
43d409305fSDimitry Andric                                  uint32_t watch_flags) override;
44d409305fSDimitry Andric 
45d409305fSDimitry Andric   lldb::addr_t GetWatchpointAddress(uint32_t wp_index) override;
46d409305fSDimitry Andric 
47d409305fSDimitry Andric   uint32_t NumSupportedHardwareWatchpoints() override;
48d409305fSDimitry Andric 
49*06c3fb27SDimitry Andric   virtual const RegisterInfo *GetDR(int num) const;
50d409305fSDimitry Andric };
51d409305fSDimitry Andric 
52d409305fSDimitry Andric } // namespace lldb_private
53d409305fSDimitry Andric 
54d409305fSDimitry Andric #endif // #ifndef lldb_NativeRegisterContextDBReg_x86_h
55