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
bde06574
Commit
bde06574
authored
Jul 05, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Jul 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Cache wow64 status inside struct process.
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
79161ea0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
12 deletions
+8
-12
debugger.h
programs/winedbg/debugger.h
+1
-0
gdbproxy.c
programs/winedbg/gdbproxy.c
+3
-7
tgt_active.c
programs/winedbg/tgt_active.c
+1
-3
winedbg.c
programs/winedbg/winedbg.c
+3
-2
No files found.
programs/winedbg/debugger.h
View file @
bde06574
...
...
@@ -280,6 +280,7 @@ struct dbg_process
struct
backend_cpu
*
be_cpu
;
HANDLE
event_on_first_exception
;
BOOL
active_debuggee
;
BOOL
is_wow64
;
struct
dbg_breakpoint
bp
[
MAX_BREAKPOINTS
];
unsigned
next_bp
;
struct
dbg_delayed_bp
*
delayed_bp
;
...
...
programs/winedbg/gdbproxy.c
View file @
bde06574
...
...
@@ -1685,7 +1685,6 @@ static BOOL CALLBACK packet_query_libraries_cb(PCSTR mod_name, DWORD64 base, PVO
IMAGE_NT_HEADERS
*
nth
=
NULL
;
IMAGEHLP_MODULE64
mod
;
SIZE_T
size
,
i
;
BOOL
is_wow64
;
char
buffer
[
0x400
];
mod
.
SizeOfStruct
=
sizeof
(
mod
);
...
...
@@ -1709,8 +1708,7 @@ static BOOL CALLBACK packet_query_libraries_cb(PCSTR mod_name, DWORD64 base, PVO
if
((
unix_path
=
wine_get_unix_file_name
(
nt_name
.
Buffer
)))
{
if
(
IsWow64Process
(
gdbctx
->
process
->
handle
,
&
is_wow64
)
&&
is_wow64
&&
(
tmp
=
strstr
(
unix_path
,
"system32"
)))
if
(
gdbctx
->
process
->
is_wow64
&&
(
tmp
=
strstr
(
unix_path
,
"system32"
)))
memcpy
(
tmp
,
"syswow64"
,
8
);
reply_buffer_append_xmlstr
(
reply
,
unix_path
);
}
...
...
@@ -1743,7 +1741,7 @@ static BOOL CALLBACK packet_query_libraries_cb(PCSTR mod_name, DWORD64 base, PVO
* the following computation valid in all cases. */
dos
=
(
IMAGE_DOS_HEADER
*
)
buffer
;
nth
=
(
IMAGE_NT_HEADERS
*
)(
buffer
+
dos
->
e_lfanew
);
if
(
IsWow64Process
(
gdbctx
->
process
->
handle
,
&
is_wow64
)
&&
is_wow64
)
if
(
gdbctx
->
process
->
is_wow64
)
sec
=
IMAGE_FIRST_SECTION
((
IMAGE_NT_HEADERS32
*
)
nth
);
else
sec
=
IMAGE_FIRST_SECTION
((
IMAGE_NT_HEADERS64
*
)
nth
);
...
...
@@ -1967,7 +1965,6 @@ static enum packet_return packet_query_exec_file(struct gdb_context* gdbctx)
struct
reply_buffer
*
reply
=
&
gdbctx
->
qxfer_buffer
;
struct
dbg_process
*
process
=
gdbctx
->
process
;
char
*
unix_path
;
BOOL
is_wow64
;
char
*
tmp
;
if
(
!
process
)
return
packet_error
;
...
...
@@ -1978,8 +1975,7 @@ static enum packet_return packet_query_exec_file(struct gdb_context* gdbctx)
if
(
!
(
unix_path
=
wine_get_unix_file_name
(
process
->
imageName
)))
return
packet_reply_error
(
gdbctx
,
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
?
HOST_ENOMEM
:
HOST_ENOENT
);
if
(
IsWow64Process
(
process
->
handle
,
&
is_wow64
)
&&
is_wow64
&&
(
tmp
=
strstr
(
unix_path
,
"system32"
)))
if
(
process
->
is_wow64
&&
(
tmp
=
strstr
(
unix_path
,
"system32"
)))
memcpy
(
tmp
,
"syswow64"
,
8
);
reply_buffer_append_str
(
reply
,
unix_path
);
...
...
programs/winedbg/tgt_active.c
View file @
bde06574
...
...
@@ -869,15 +869,13 @@ static void output_system_info(void)
const
char
*
(
CDECL
*
wine_get_build_id
)(
void
);
void
(
CDECL
*
wine_get_host_version
)(
const
char
**
sysname
,
const
char
**
release
);
BOOL
is_wow64
;
wine_get_build_id
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"ntdll.dll"
),
"wine_get_build_id"
);
wine_get_host_version
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"ntdll.dll"
),
"wine_get_host_version"
);
if
(
!
IsWow64Process
(
dbg_curr_process
->
handle
,
&
is_wow64
))
is_wow64
=
FALSE
;
dbg_printf
(
"System information:
\n
"
);
if
(
wine_get_build_id
)
dbg_printf
(
" Wine build: %s
\n
"
,
wine_get_build_id
()
);
dbg_printf
(
" Platform: %s%s
\n
"
,
platform
,
is_wow64
?
" (WOW64)"
:
""
);
dbg_printf
(
" Platform: %s%s
\n
"
,
platform
,
dbg_curr_process
->
is_wow64
?
" (WOW64)"
:
""
);
dbg_printf
(
" Version: Windows %s
\n
"
,
get_windows_version
()
);
if
(
wine_get_host_version
)
{
...
...
programs/winedbg/winedbg.c
View file @
bde06574
...
...
@@ -266,6 +266,8 @@ struct dbg_process* dbg_add_process(const struct be_process_io* pio, DWORD pid,
if
(
!
h
)
h
=
OpenProcess
(
PROCESS_ALL_ACCESS
,
FALSE
,
pid
);
if
(
!
IsWow64Process
(
h
,
&
wow64
))
wow64
=
FALSE
;
if
(
!
(
p
=
malloc
(
sizeof
(
struct
dbg_process
))))
return
NULL
;
p
->
handle
=
h
;
p
->
pid
=
pid
;
...
...
@@ -276,6 +278,7 @@ struct dbg_process* dbg_add_process(const struct be_process_io* pio, DWORD pid,
list_init
(
&
p
->
modules
);
p
->
event_on_first_exception
=
NULL
;
p
->
active_debuggee
=
FALSE
;
p
->
is_wow64
=
wow64
;
p
->
next_bp
=
1
;
/* breakpoint 0 is reserved for step-over */
memset
(
p
->
bp
,
0
,
sizeof
(
p
->
bp
));
p
->
delayed_bp
=
NULL
;
...
...
@@ -291,8 +294,6 @@ struct dbg_process* dbg_add_process(const struct be_process_io* pio, DWORD pid,
list_add_head
(
&
dbg_process_list
,
&
p
->
entry
);
IsWow64Process
(
h
,
&
wow64
);
#ifdef __i386__
p
->
be_cpu
=
&
be_i386
;
#elif defined(__x86_64__)
...
...
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