LLDB
mainline
llvm-project
lldb
source
Plugins
Process
Utility
RegisterContextOpenBSD_i386.cpp
Go to the documentation of this file.
1
//===-- RegisterContextOpenBSD_i386.cpp -----------------------------------===//
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
#include "
RegisterContextOpenBSD_i386.h
"
10
#include "
RegisterContextPOSIX_x86.h
"
11
12
using namespace
lldb_private
;
13
using namespace
lldb
;
14
15
// /usr/include/machine/reg.h
16
struct
GPR
{
17
uint32_t
eax
;
18
uint32_t
ecx
;
19
uint32_t
edx
;
20
uint32_t
ebx
;
21
uint32_t
esp
;
22
uint32_t
ebp
;
23
uint32_t
esi
;
24
uint32_t
edi
;
25
uint32_t
eip
;
26
uint32_t
eflags
;
27
uint32_t
cs
;
28
uint32_t
ss
;
29
uint32_t
ds
;
30
uint32_t
es
;
31
uint32_t
fs
;
32
uint32_t
gs
;
33
};
34
35
struct
dbreg
{
36
uint32_t
dr
[8];
/* debug registers */
37
/* Index 0-3: debug address registers */
38
/* Index 4-5: reserved */
39
/* Index 6: debug status */
40
/* Index 7: debug control */
41
};
42
43
using
FPR_i386
=
FXSAVE
;
44
45
struct
UserArea
{
46
GPR
gpr
;
47
FPR_i386
i387
;
48
};
49
50
#define DR_SIZE sizeof(uint32_t)
51
#define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index]))
52
53
// Include RegisterInfos_i386 to declare our g_register_infos_i386 structure.
54
#define DECLARE_REGISTER_INFOS_I386_STRUCT
55
#include "
RegisterInfos_i386.h
"
56
#undef DECLARE_REGISTER_INFOS_I386_STRUCT
57
58
RegisterContextOpenBSD_i386::RegisterContextOpenBSD_i386
(
59
const
ArchSpec
&target_arch)
60
:
RegisterInfoInterface
(target_arch) {}
61
62
size_t
RegisterContextOpenBSD_i386::GetGPRSize
()
const
{
return
sizeof
(
GPR
); }
63
64
const
RegisterInfo
*
RegisterContextOpenBSD_i386::GetRegisterInfo
()
const
{
65
switch
(
GetTargetArchitecture
().GetMachine()) {
66
case
llvm::Triple::x86:
67
return
g_register_infos_i386;
68
default
:
69
assert(
false
&&
"Unhandled target architecture."
);
70
return
nullptr
;
71
}
72
}
73
74
uint32_t
RegisterContextOpenBSD_i386::GetRegisterCount
()
const
{
75
return
static_cast<
uint32_t
>
(
sizeof
(g_register_infos_i386) /
76
sizeof
(g_register_infos_i386[0]));
77
}
ecx
@ ecx
Definition:
CompactUnwindInfo.cpp:974
eip
@ eip
Definition:
CompactUnwindInfo.cpp:981
eax
@ eax
Definition:
CompactUnwindInfo.cpp:973
edx
@ edx
Definition:
CompactUnwindInfo.cpp:975
esp
@ esp
Definition:
CompactUnwindInfo.cpp:978
edi
@ edi
Definition:
CompactUnwindInfo.cpp:980
ebx
@ ebx
Definition:
CompactUnwindInfo.cpp:976
esi
@ esi
Definition:
CompactUnwindInfo.cpp:979
ebp
@ ebp
Definition:
CompactUnwindInfo.cpp:977
RegisterContextOpenBSD_i386.h
RegisterContextPOSIX_x86.h
RegisterInfos_i386.h
RegisterContextOpenBSD_i386::GetGPRSize
size_t GetGPRSize() const override
Definition:
RegisterContextOpenBSD_i386.cpp:62
RegisterContextOpenBSD_i386::GetRegisterCount
uint32_t GetRegisterCount() const override
Definition:
RegisterContextOpenBSD_i386.cpp:74
RegisterContextOpenBSD_i386::GetRegisterInfo
const lldb_private::RegisterInfo * GetRegisterInfo() const override
Definition:
RegisterContextOpenBSD_i386.cpp:64
RegisterContextOpenBSD_i386::RegisterContextOpenBSD_i386
RegisterContextOpenBSD_i386(const lldb_private::ArchSpec &target_arch)
Definition:
RegisterContextOpenBSD_i386.cpp:58
lldb_private::ArchSpec
An architecture specification class.
Definition:
ArchSpec.h:31
lldb_private::RegisterInfoInterface
RegisterInfo interface to patch RegisterInfo structure for archs.
Definition:
RegisterInfoInterface.h:21
lldb_private::RegisterInfoInterface::GetTargetArchitecture
const lldb_private::ArchSpec & GetTargetArchitecture() const
Definition:
RegisterInfoInterface.h:40
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAddressRange.h:14
lldb
Definition:
SBAddress.h:15
FPR_i386
Definition:
RegisterContextLinux_i386.cpp:35
GPR
Definition:
RegisterContextFreeBSD_i386.cpp:16
GPR::cs
uint32_t cs
Definition:
RegisterContextFreeBSD_i386.cpp:31
GPR::eflags
uint32_t eflags
Definition:
RegisterContextFreeBSD_i386.cpp:32
GPR::ds
uint32_t ds
Definition:
RegisterContextFreeBSD_i386.cpp:19
GPR::ss
uint32_t ss
Definition:
RegisterContextFreeBSD_i386.cpp:34
GPR::fs
uint32_t fs
Definition:
RegisterContextFreeBSD_i386.cpp:17
GPR::es
uint32_t es
Definition:
RegisterContextFreeBSD_i386.cpp:18
GPR::gs
uint32_t gs
Definition:
RegisterContextFreeBSD_i386.cpp:35
UserArea
Definition:
RegisterContext_mips.h:368
UserArea::gpr
GPR_linux_mips gpr
Definition:
RegisterContext_mips.h:369
UserArea::i387
FPR_i386 i387
Definition:
RegisterContextFreeBSD_i386.cpp:50
dbreg
Definition:
RegisterContextOpenBSD_i386.cpp:35
dbreg::dr
uint32_t dr[8]
Definition:
RegisterContextOpenBSD_i386.cpp:36
lldb_private::FXSAVE
Definition:
RegisterContext_x86.h:269
lldb_private::RegisterInfo
Every register is described in detail including its name, alternate name (optional),...
Definition:
lldb-private-types.h:37
Generated on Sun Nov 3 2024 10:07:14 for LLDB by
1.9.6