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
13125b51
Commit
13125b51
authored
Oct 04, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Avoid using the 'long double' type.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b9046a49
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
50 deletions
+25
-50
be_arm.c
programs/winedbg/be_arm.c
+2
-4
be_arm64.c
programs/winedbg/be_arm64.c
+2
-4
be_cpu.h
programs/winedbg/be_cpu.h
+1
-1
be_i386.c
programs/winedbg/be_i386.c
+9
-17
be_x86_64.c
programs/winedbg/be_x86_64.c
+9
-22
memory.c
programs/winedbg/memory.c
+2
-2
No files found.
programs/winedbg/be_arm.c
View file @
13125b51
...
...
@@ -1851,10 +1851,9 @@ static BOOL be_arm_fetch_integer(const struct dbg_lvalue* lvalue, unsigned size,
return
TRUE
;
}
static
BOOL
be_arm_fetch_float
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
long
double
*
ret
)
static
BOOL
be_arm_fetch_float
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
double
*
ret
)
{
char
tmp
[
sizeof
(
long
double
)];
char
tmp
[
sizeof
(
double
)];
/* FIXME: this assumes that debuggee and debugger use the same
* representation for reals
...
...
@@ -1863,7 +1862,6 @@ static BOOL be_arm_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
if
(
size
==
sizeof
(
float
))
*
ret
=
*
(
float
*
)
tmp
;
else
if
(
size
==
sizeof
(
double
))
*
ret
=
*
(
double
*
)
tmp
;
else
if
(
size
==
sizeof
(
long
double
))
*
ret
=
*
(
long
double
*
)
tmp
;
else
return
FALSE
;
return
TRUE
;
...
...
programs/winedbg/be_arm64.c
View file @
13125b51
...
...
@@ -248,10 +248,9 @@ static BOOL be_arm64_fetch_integer(const struct dbg_lvalue* lvalue, unsigned siz
return
TRUE
;
}
static
BOOL
be_arm64_fetch_float
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
long
double
*
ret
)
static
BOOL
be_arm64_fetch_float
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
double
*
ret
)
{
char
tmp
[
sizeof
(
long
double
)];
char
tmp
[
sizeof
(
double
)];
/* FIXME: this assumes that debuggee and debugger use the same
* representation for reals
...
...
@@ -260,7 +259,6 @@ static BOOL be_arm64_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
if
(
size
==
sizeof
(
float
))
*
ret
=
*
(
float
*
)
tmp
;
else
if
(
size
==
sizeof
(
double
))
*
ret
=
*
(
double
*
)
tmp
;
else
if
(
size
==
sizeof
(
long
double
))
*
ret
=
*
(
long
double
*
)
tmp
;
else
return
FALSE
;
return
TRUE
;
...
...
programs/winedbg/be_cpu.h
View file @
13125b51
...
...
@@ -121,7 +121,7 @@ struct backend_cpu
/* Reads an integer from memory and stores it inside a long long int */
BOOL
(
*
fetch_integer
)(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
BOOL
is_signed
,
LONGLONG
*
);
/* Reads a real from memory and stores it inside a long double */
BOOL
(
*
fetch_float
)(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
long
double
*
);
BOOL
(
*
fetch_float
)(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
double
*
);
/* Writes an integer to memory */
BOOL
(
*
store_integer
)(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
BOOL
is_signed
,
LONGLONG
);
...
...
programs/winedbg/be_i386.c
View file @
13125b51
...
...
@@ -133,7 +133,6 @@ static void be_i386_all_print_context(HANDLE hThread, const dbg_ctx_t *pctx)
"DM"
,
"ZM"
,
"OM"
,
"UM"
,
"PM"
,
"R-"
,
"R+"
,
"FZ"
};
const
WOW64_CONTEXT
*
ctx
=
&
pctx
->
x86
;
XSAVE_FORMAT
*
xmm_area
;
long
double
ST
[
8
];
/* These are for floating regs */
int
cnt
;
/* Break out the FPU state and the floating point registers */
...
...
@@ -185,16 +184,12 @@ static void be_i386_all_print_context(HANDLE hThread, const dbg_ctx_t *pctx)
/* Now for the floating point registers */
dbg_printf
(
"Floating Point Registers:
\n
"
);
for
(
cnt
=
0
;
cnt
<
4
;
cnt
++
)
{
memcpy
(
&
ST
[
cnt
],
&
ctx
->
FloatSave
.
RegisterArea
[
cnt
*
10
],
10
);
dbg_printf
(
" ST%d:%Lf "
,
cnt
,
ST
[
cnt
]);
}
dbg_printf
(
"
\n
"
);
for
(
cnt
=
4
;
cnt
<
8
;
cnt
++
)
for
(
cnt
=
0
;
cnt
<
8
;
cnt
++
)
{
memcpy
(
&
ST
[
cnt
],
&
ctx
->
FloatSave
.
RegisterArea
[
cnt
*
10
],
10
);
dbg_printf
(
" ST%d:%Lf "
,
cnt
,
ST
[
cnt
]);
const
BYTE
*
p
=
&
ctx
->
FloatSave
.
RegisterArea
[
cnt
*
10
];
if
(
cnt
==
4
)
dbg_printf
(
"
\n
"
);
dbg_printf
(
" ST%d:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x "
,
cnt
,
p
[
0
],
p
[
1
],
p
[
2
],
p
[
3
],
p
[
4
],
p
[
5
],
p
[
6
],
p
[
7
],
p
[
8
],
p
[
9
]
);
}
xmm_area
=
(
XSAVE_FORMAT
*
)
&
ctx
->
ExtendedRegisters
;
...
...
@@ -802,20 +797,17 @@ static BOOL be_i386_fetch_integer(const struct dbg_lvalue* lvalue, unsigned size
return
TRUE
;
}
static
BOOL
be_i386_fetch_float
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
long
double
*
ret
)
static
BOOL
be_i386_fetch_float
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
double
*
ret
)
{
char
tmp
[
sizeof
(
long
double
)];
char
tmp
[
sizeof
(
double
)];
/* FIXME: this assumes that debuggee and debugger use the same
* representation for reals
*/
if
(
!
memory_read_value
(
lvalue
,
size
,
tmp
))
return
FALSE
;
/* float & double types have to be promoted to a long double */
if
(
size
==
4
)
*
ret
=
*
(
float
*
)
tmp
;
else
if
(
size
==
8
)
*
ret
=
*
(
double
*
)
tmp
;
else
if
(
size
==
10
)
*
ret
=
*
(
long
double
*
)
tmp
;
if
(
size
==
sizeof
(
float
))
*
ret
=
*
(
float
*
)
tmp
;
else
if
(
size
==
sizeof
(
double
))
*
ret
=
*
(
double
*
)
tmp
;
else
return
FALSE
;
return
TRUE
;
...
...
programs/winedbg/be_x86_64.c
View file @
13125b51
...
...
@@ -73,14 +73,6 @@ static void be_x86_64_single_step(dbg_ctx_t *ctx, BOOL enable)
else
ctx
->
ctx
.
EFlags
&=
~
STEP_FLAG
;
}
static
inline
long
double
m128a_to_longdouble
(
const
M128A
m
)
{
/* gcc uses the same IEEE-754 representation as M128A for long double
* but 16 byte aligned (hence only the first 10 bytes out of the 16 are used)
*/
return
*
(
long
double
*
)
&
m
;
}
static
void
be_x86_64_print_context
(
HANDLE
hThread
,
const
dbg_ctx_t
*
pctx
,
int
all_regs
)
{
...
...
@@ -154,14 +146,12 @@ static void be_x86_64_print_context(HANDLE hThread, const dbg_ctx_t *pctx,
ctx
->
u
.
FltSave
.
ErrorSelector
,
ctx
->
u
.
FltSave
.
ErrorOffset
,
ctx
->
u
.
FltSave
.
DataSelector
,
ctx
->
u
.
FltSave
.
DataOffset
);
for
(
i
=
0
;
i
<
4
;
i
++
)
{
dbg_printf
(
" st%u:%-16Lg "
,
i
,
m128a_to_longdouble
(
ctx
->
u
.
FltSave
.
FloatRegisters
[
i
]));
}
dbg_printf
(
"
\n
"
);
for
(
i
=
4
;
i
<
8
;
i
++
)
for
(
i
=
0
;
i
<
8
;
i
++
)
{
dbg_printf
(
" st%u:%-16Lg "
,
i
,
m128a_to_longdouble
(
ctx
->
u
.
FltSave
.
FloatRegisters
[
i
]));
M128A
reg
=
ctx
->
u
.
FltSave
.
FloatRegisters
[
i
];
if
(
i
==
4
)
dbg_printf
(
"
\n
"
);
dbg_printf
(
" ST%u:%08x%08x%08x%08x "
,
i
,
(
DWORD
)(
reg
.
High
>>
32
),
(
DWORD
)
reg
.
High
,
(
DWORD
)(
reg
.
Low
>>
32
),
(
DWORD
)
reg
.
Low
);
}
dbg_printf
(
"
\n
"
);
...
...
@@ -731,20 +721,17 @@ static BOOL be_x86_64_fetch_integer(const struct dbg_lvalue* lvalue, unsigned si
return
TRUE
;
}
static
BOOL
be_x86_64_fetch_float
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
long
double
*
ret
)
static
BOOL
be_x86_64_fetch_float
(
const
struct
dbg_lvalue
*
lvalue
,
unsigned
size
,
double
*
ret
)
{
char
tmp
[
sizeof
(
long
double
)];
char
tmp
[
sizeof
(
double
)];
/* FIXME: this assumes that debuggee and debugger use the same
* representation for reals
*/
if
(
!
memory_read_value
(
lvalue
,
size
,
tmp
))
return
FALSE
;
/* float & double types have to be promoted to a long double */
if
(
size
==
4
)
*
ret
=
*
(
float
*
)
tmp
;
else
if
(
size
==
8
)
*
ret
=
*
(
double
*
)
tmp
;
else
if
(
size
==
10
)
*
ret
=
*
(
long
double
*
)
tmp
;
if
(
size
==
sizeof
(
float
))
*
ret
=
*
(
float
*
)
tmp
;
else
if
(
size
==
sizeof
(
double
))
*
ret
=
*
(
double
*
)
tmp
;
else
return
FALSE
;
return
TRUE
;
...
...
programs/winedbg/memory.c
View file @
13125b51
...
...
@@ -350,7 +350,7 @@ static void print_typed_basic(const struct dbg_lvalue* lvalue)
{
LONGLONG
val_int
;
void
*
val_ptr
;
long
double
val_real
;
double
val_real
;
DWORD64
size64
;
DWORD
tag
,
size
,
count
,
bt
;
struct
dbg_type
type
=
lvalue
->
type
;
...
...
@@ -385,7 +385,7 @@ static void print_typed_basic(const struct dbg_lvalue* lvalue)
break
;
case
btFloat
:
if
(
!
dbg_curr_process
->
be_cpu
->
fetch_float
(
lvalue
,
size
,
&
val_real
))
return
;
dbg_printf
(
"%
L
f"
,
val_real
);
dbg_printf
(
"%f"
,
val_real
);
break
;
case
btChar
:
case
btWChar
:
...
...
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