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
05c5a12f
Commit
05c5a12f
authored
Dec 08, 2021
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Implement proper assignements of floating point numbers.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5f9d09f4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
1 deletion
+35
-1
debugger.h
programs/winedbg/debugger.h
+2
-0
memory.c
programs/winedbg/memory.c
+17
-0
types.c
programs/winedbg/types.c
+16
-1
No files found.
programs/winedbg/debugger.h
View file @
05c5a12f
...
...
@@ -397,6 +397,7 @@ extern BOOL memory_fetch_integer(const struct dbg_lvalue* lvalue, un
BOOL
is_signed
,
dbg_lgint_t
*
ret
);
extern
BOOL
memory_store_integer
(
const
struct
dbg_lvalue
*
lvalue
,
dbg_lgint_t
val
);
extern
BOOL
memory_fetch_float
(
const
struct
dbg_lvalue
*
lvalue
,
double
*
ret
);
extern
BOOL
memory_store_float
(
const
struct
dbg_lvalue
*
lvalue
,
double
*
ret
);
extern
void
memory_examine
(
const
struct
dbg_lvalue
*
lvalue
,
int
count
,
char
format
);
extern
void
*
memory_to_linear_addr
(
const
ADDRESS64
*
address
);
extern
BOOL
memory_get_current_pc
(
ADDRESS64
*
address
);
...
...
@@ -497,6 +498,7 @@ extern struct dbg_type types_find_pointer(const struct dbg_type* type);
extern
struct
dbg_type
types_find_type
(
DWORD64
linear
,
const
char
*
name
,
enum
SymTagEnum
tag
);
extern
BOOL
types_compare
(
const
struct
dbg_type
,
const
struct
dbg_type
,
BOOL
*
equal
);
extern
BOOL
types_is_integral_type
(
const
struct
dbg_lvalue
*
);
extern
BOOL
types_is_float_type
(
const
struct
dbg_lvalue
*
);
/* winedbg.c */
extern
void
dbg_outputW
(
const
WCHAR
*
buffer
,
int
len
);
...
...
programs/winedbg/memory.c
View file @
05c5a12f
...
...
@@ -354,6 +354,23 @@ BOOL memory_fetch_float(const struct dbg_lvalue* lvalue, double *ret)
return
TRUE
;
}
BOOL
memory_store_float
(
const
struct
dbg_lvalue
*
lvalue
,
double
*
ret
)
{
DWORD64
size
;
if
(
!
types_get_info
(
&
lvalue
->
type
,
TI_GET_LENGTH
,
&
size
))
return
FALSE
;
/* FIXME: this assumes that debuggee and debugger use the same
* representation for reals
*/
if
(
size
>
sizeof
(
*
ret
))
return
FALSE
;
if
(
size
==
sizeof
(
float
))
{
float
f
=
*
ret
;
return
memory_write_value
(
lvalue
,
size
,
&
f
);
}
if
(
size
!=
sizeof
(
double
))
return
FALSE
;
return
memory_write_value
(
lvalue
,
size
,
ret
);
}
BOOL
memory_get_string
(
struct
dbg_process
*
pcs
,
void
*
addr
,
BOOL
in_debuggee
,
BOOL
unicode
,
char
*
buffer
,
int
size
)
{
...
...
programs/winedbg/types.c
View file @
05c5a12f
...
...
@@ -168,6 +168,12 @@ BOOL types_store_value(struct dbg_lvalue* lvalue_to, const struct dbg_lvalue* lv
if
(
!
types_compare
(
lvalue_to
->
type
,
lvalue_from
->
type
,
&
equal
))
return
FALSE
;
if
(
equal
)
return
memory_transfer_value
(
lvalue_to
,
lvalue_from
);
if
(
types_is_float_type
(
lvalue_from
)
&&
types_is_float_type
(
lvalue_to
))
{
double
d
;
return
memory_fetch_float
(
lvalue_from
,
&
d
)
&&
memory_store_float
(
lvalue_to
,
&
d
);
}
}
if
(
types_is_integral_type
(
lvalue_from
)
&&
types_is_integral_type
(
lvalue_to
))
{
...
...
@@ -175,7 +181,6 @@ BOOL types_store_value(struct dbg_lvalue* lvalue_to, const struct dbg_lvalue* lv
dbg_lgint_t
val
=
types_extract_as_integer
(
lvalue_from
);
return
memory_store_integer
(
lvalue_to
,
val
);
}
/* FIXME: should support floats as well */
dbg_printf
(
"Cannot assign (different types)
\n
"
);
return
FALSE
;
return
FALSE
;
}
...
...
@@ -1075,3 +1080,13 @@ BOOL types_is_integral_type(const struct dbg_lvalue* lv)
!
types_get_info
(
&
type
,
TI_GET_BASETYPE
,
&
bt
))
return
FALSE
;
return
is_basetype_integer
(
bt
);
}
BOOL
types_is_float_type
(
const
struct
dbg_lvalue
*
lv
)
{
struct
dbg_type
type
=
lv
->
type
;
DWORD
tag
,
bt
;
if
(
lv
->
bitlen
)
return
FALSE
;
if
(
!
types_get_real_type
(
&
type
,
&
tag
)
||
!
types_get_info
(
&
type
,
TI_GET_BASETYPE
,
&
bt
))
return
FALSE
;
return
bt
==
btFloat
;
}
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