Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d1e9694e
Commit
d1e9694e
authored
Jan 14, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg/gdbproxy: Add support for floating-point registers on x86 and x86_64.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
77d65c39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
1 deletion
+70
-1
gdbproxy.c
programs/winedbg/gdbproxy.c
+70
-1
No files found.
programs/winedbg/gdbproxy.c
View file @
d1e9694e
...
@@ -214,6 +214,30 @@ struct cpu_register
...
@@ -214,6 +214,30 @@ struct cpu_register
#define REG(r,gs,m) {FIELD_OFFSET(CONTEXT, r), sizeof(((CONTEXT*)NULL)->r), gs, m}
#define REG(r,gs,m) {FIELD_OFFSET(CONTEXT, r), sizeof(((CONTEXT*)NULL)->r), gs, m}
#ifdef __i386__
#ifdef __i386__
typedef
struct
DECLSPEC_ALIGN
(
16
)
_M128A
{
ULONGLONG
Low
;
LONGLONG
High
;
}
M128A
,
*
PM128A
;
typedef
struct
_XMM_SAVE_AREA32
{
WORD
ControlWord
;
/* 000 */
WORD
StatusWord
;
/* 002 */
BYTE
TagWord
;
/* 004 */
BYTE
Reserved1
;
/* 005 */
WORD
ErrorOpcode
;
/* 006 */
DWORD
ErrorOffset
;
/* 008 */
WORD
ErrorSelector
;
/* 00c */
WORD
Reserved2
;
/* 00e */
DWORD
DataOffset
;
/* 010 */
WORD
DataSelector
;
/* 014 */
WORD
Reserved3
;
/* 016 */
DWORD
MxCsr
;
/* 018 */
DWORD
MxCsr_Mask
;
/* 01c */
M128A
FloatRegisters
[
8
];
/* 020 */
M128A
XmmRegisters
[
16
];
/* 0a0 */
BYTE
Reserved4
[
96
];
/* 1a0 */
}
XMM_SAVE_AREA32
,
*
PXMM_SAVE_AREA32
;
static
const
char
target_xml
[]
=
""
;
static
const
char
target_xml
[]
=
""
;
static
struct
cpu_register
cpu_register_map
[]
=
{
static
struct
cpu_register
cpu_register_map
[]
=
{
REG
(
Eax
,
4
,
CONTEXT_INTEGER
),
REG
(
Eax
,
4
,
CONTEXT_INTEGER
),
...
@@ -248,6 +272,15 @@ static struct cpu_register cpu_register_map[] = {
...
@@ -248,6 +272,15 @@ static struct cpu_register cpu_register_map[] = {
{
FIELD_OFFSET
(
CONTEXT
,
FloatSave
.
DataSelector
),
2
,
4
,
CONTEXT_FLOATING_POINT
},
{
FIELD_OFFSET
(
CONTEXT
,
FloatSave
.
DataSelector
),
2
,
4
,
CONTEXT_FLOATING_POINT
},
REG
(
FloatSave
.
DataOffset
,
4
,
CONTEXT_FLOATING_POINT
),
REG
(
FloatSave
.
DataOffset
,
4
,
CONTEXT_FLOATING_POINT
),
{
FIELD_OFFSET
(
CONTEXT
,
FloatSave
.
ErrorSelector
)
+
2
,
2
,
4
,
CONTEXT_FLOATING_POINT
},
{
FIELD_OFFSET
(
CONTEXT
,
FloatSave
.
ErrorSelector
)
+
2
,
2
,
4
,
CONTEXT_FLOATING_POINT
},
{
FIELD_OFFSET
(
CONTEXT
,
ExtendedRegisters
)
+
FIELD_OFFSET
(
XMM_SAVE_AREA32
,
XmmRegisters
[
0
]),
16
,
16
,
CONTEXT_EXTENDED_REGISTERS
},
{
FIELD_OFFSET
(
CONTEXT
,
ExtendedRegisters
)
+
FIELD_OFFSET
(
XMM_SAVE_AREA32
,
XmmRegisters
[
1
]),
16
,
16
,
CONTEXT_EXTENDED_REGISTERS
},
{
FIELD_OFFSET
(
CONTEXT
,
ExtendedRegisters
)
+
FIELD_OFFSET
(
XMM_SAVE_AREA32
,
XmmRegisters
[
2
]),
16
,
16
,
CONTEXT_EXTENDED_REGISTERS
},
{
FIELD_OFFSET
(
CONTEXT
,
ExtendedRegisters
)
+
FIELD_OFFSET
(
XMM_SAVE_AREA32
,
XmmRegisters
[
3
]),
16
,
16
,
CONTEXT_EXTENDED_REGISTERS
},
{
FIELD_OFFSET
(
CONTEXT
,
ExtendedRegisters
)
+
FIELD_OFFSET
(
XMM_SAVE_AREA32
,
XmmRegisters
[
4
]),
16
,
16
,
CONTEXT_EXTENDED_REGISTERS
},
{
FIELD_OFFSET
(
CONTEXT
,
ExtendedRegisters
)
+
FIELD_OFFSET
(
XMM_SAVE_AREA32
,
XmmRegisters
[
5
]),
16
,
16
,
CONTEXT_EXTENDED_REGISTERS
},
{
FIELD_OFFSET
(
CONTEXT
,
ExtendedRegisters
)
+
FIELD_OFFSET
(
XMM_SAVE_AREA32
,
XmmRegisters
[
6
]),
16
,
16
,
CONTEXT_EXTENDED_REGISTERS
},
{
FIELD_OFFSET
(
CONTEXT
,
ExtendedRegisters
)
+
FIELD_OFFSET
(
XMM_SAVE_AREA32
,
XmmRegisters
[
7
]),
16
,
16
,
CONTEXT_EXTENDED_REGISTERS
},
{
FIELD_OFFSET
(
CONTEXT
,
ExtendedRegisters
)
+
FIELD_OFFSET
(
XMM_SAVE_AREA32
,
MxCsr
),
4
,
4
,
CONTEXT_EXTENDED_REGISTERS
},
};
};
#elif defined(__powerpc__)
#elif defined(__powerpc__)
static
const
char
target_xml
[]
=
""
;
static
const
char
target_xml
[]
=
""
;
...
@@ -353,6 +386,39 @@ static struct cpu_register cpu_register_map[] = {
...
@@ -353,6 +386,39 @@ static struct cpu_register cpu_register_map[] = {
REG
(
SegEs
,
4
,
CONTEXT_SEGMENTS
),
REG
(
SegEs
,
4
,
CONTEXT_SEGMENTS
),
REG
(
SegFs
,
4
,
CONTEXT_SEGMENTS
),
REG
(
SegFs
,
4
,
CONTEXT_SEGMENTS
),
REG
(
SegGs
,
4
,
CONTEXT_SEGMENTS
),
REG
(
SegGs
,
4
,
CONTEXT_SEGMENTS
),
{
FIELD_OFFSET
(
CONTEXT
,
u
.
FltSave
.
FloatRegisters
[
0
]),
10
,
10
,
CONTEXT_FLOATING_POINT
},
{
FIELD_OFFSET
(
CONTEXT
,
u
.
FltSave
.
FloatRegisters
[
1
]),
10
,
10
,
CONTEXT_FLOATING_POINT
},
{
FIELD_OFFSET
(
CONTEXT
,
u
.
FltSave
.
FloatRegisters
[
2
]),
10
,
10
,
CONTEXT_FLOATING_POINT
},
{
FIELD_OFFSET
(
CONTEXT
,
u
.
FltSave
.
FloatRegisters
[
3
]),
10
,
10
,
CONTEXT_FLOATING_POINT
},
{
FIELD_OFFSET
(
CONTEXT
,
u
.
FltSave
.
FloatRegisters
[
4
]),
10
,
10
,
CONTEXT_FLOATING_POINT
},
{
FIELD_OFFSET
(
CONTEXT
,
u
.
FltSave
.
FloatRegisters
[
5
]),
10
,
10
,
CONTEXT_FLOATING_POINT
},
{
FIELD_OFFSET
(
CONTEXT
,
u
.
FltSave
.
FloatRegisters
[
6
]),
10
,
10
,
CONTEXT_FLOATING_POINT
},
{
FIELD_OFFSET
(
CONTEXT
,
u
.
FltSave
.
FloatRegisters
[
7
]),
10
,
10
,
CONTEXT_FLOATING_POINT
},
REG
(
u
.
FltSave
.
ControlWord
,
4
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
FltSave
.
StatusWord
,
4
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
FltSave
.
TagWord
,
4
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
FltSave
.
ErrorSelector
,
4
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
FltSave
.
ErrorOffset
,
4
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
FltSave
.
DataSelector
,
4
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
FltSave
.
DataOffset
,
4
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
FltSave
.
ErrorOpcode
,
4
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm0
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm1
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm2
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm3
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm4
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm5
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm6
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm7
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm8
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm9
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm10
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm11
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm12
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm13
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm14
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
s
.
Xmm15
,
16
,
CONTEXT_FLOATING_POINT
),
REG
(
u
.
FltSave
.
MxCsr
,
4
,
CONTEXT_FLOATING_POINT
),
};
};
#elif defined(__arm__)
#elif defined(__arm__)
static
const
char
target_xml
[]
=
static
const
char
target_xml
[]
=
...
@@ -496,7 +562,7 @@ static BOOL fetch_context(struct gdb_context* gdbctx, HANDLE h, CONTEXT* ctx)
...
@@ -496,7 +562,7 @@ static BOOL fetch_context(struct gdb_context* gdbctx, HANDLE h, CONTEXT* ctx)
{
{
ctx
->
ContextFlags
=
CONTEXT_CONTROL
ctx
->
ContextFlags
=
CONTEXT_CONTROL
|
CONTEXT_INTEGER
|
CONTEXT_INTEGER
#if defined(__powerpc__) || defined(__i386__)
#if defined(__powerpc__) || defined(__i386__)
|| defined(__x86_64__)
|
CONTEXT_FLOATING_POINT
|
CONTEXT_FLOATING_POINT
#endif
#endif
#ifdef CONTEXT_SEGMENTS
#ifdef CONTEXT_SEGMENTS
...
@@ -505,6 +571,9 @@ static BOOL fetch_context(struct gdb_context* gdbctx, HANDLE h, CONTEXT* ctx)
...
@@ -505,6 +571,9 @@ static BOOL fetch_context(struct gdb_context* gdbctx, HANDLE h, CONTEXT* ctx)
#ifdef CONTEXT_DEBUG_REGISTERS
#ifdef CONTEXT_DEBUG_REGISTERS
|
CONTEXT_DEBUG_REGISTERS
|
CONTEXT_DEBUG_REGISTERS
#endif
#endif
#ifdef CONTEXT_EXTENDED_REGISTERS
|
CONTEXT_EXTENDED_REGISTERS
#endif
;
;
if
(
!
GetThreadContext
(
h
,
ctx
))
if
(
!
GetThreadContext
(
h
,
ctx
))
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment