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
0ed8cac2
Commit
0ed8cac2
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: Correctly store integers into a bitfield.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
860de956
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
memory.c
programs/winedbg/memory.c
+17
-0
No files found.
programs/winedbg/memory.c
View file @
0ed8cac2
...
...
@@ -317,6 +317,23 @@ BOOL memory_store_integer(const struct dbg_lvalue* lvalue, dbg_lgint_t val)
{
DWORD64
size
;
if
(
!
types_get_info
(
&
lvalue
->
type
,
TI_GET_LENGTH
,
&
size
))
return
FALSE
;
if
(
lvalue
->
bitlen
)
{
struct
dbg_lvalue
alt_lvalue
=
*
lvalue
;
dbg_lguint_t
mask
,
dst
;
/* FIXME: this test isn't sufficient, depending on start of bitfield
* (ie a 64 bit field can spread across 9 bytes)
*/
if
(
lvalue
->
bitlen
>
8
*
sizeof
(
dbg_lgint_t
))
return
FALSE
;
/* mask is 1 where bitfield is present, 0 outside */
mask
=
(
~
(
dbg_lguint_t
)
0
>>
(
sizeof
(
val
)
*
8
-
lvalue
->
bitlen
))
<<
(
lvalue
->
bitstart
&
7
);
alt_lvalue
.
addr
.
Offset
+=
lvalue
->
bitstart
>>
3
;
val
<<=
lvalue
->
bitstart
&
7
;
if
(
!
memory_read_value
(
&
alt_lvalue
,
(
unsigned
)
size
,
&
dst
))
return
FALSE
;
val
=
(
dst
&
~
mask
)
|
(
val
&
mask
);
return
memory_write_value
(
&
alt_lvalue
,
(
unsigned
)
size
,
&
val
);
}
/* this is simple if we're on a little endian CPU */
return
memory_write_value
(
lvalue
,
(
unsigned
)
size
,
&
val
);
}
...
...
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