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
101820d0
Commit
101820d0
authored
Jun 06, 2019
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Jun 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Use internal flag for loading native files.
Signed-off-by:
Alistair Leslie-Hughes
<
leslie_alistair@hotmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fa5e5df7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
24 deletions
+24
-24
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+0
-3
module.c
dlls/dbghelp/module.c
+1
-1
symbol.c
dlls/dbghelp/symbol.c
+2
-2
info.c
programs/winedbg/info.c
+3
-3
symbol.c
programs/winedbg/symbol.c
+10
-10
tgt_module.c
programs/winedbg/tgt_module.c
+5
-2
winedbg.c
programs/winedbg/winedbg.c
+3
-3
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
101820d0
...
...
@@ -116,9 +116,6 @@ void* hash_table_iter_up(struct hash_table_iter* hti) DECLSPEC_HIDDEN;
extern
unsigned
dbghelp_options
DECLSPEC_HIDDEN
;
extern
BOOL
dbghelp_opt_native
DECLSPEC_HIDDEN
;
/* some more Wine extensions */
#define SYMOPT_WINE_WITH_NATIVE_MODULES 0x40000000
enum
location_kind
{
loc_error
,
/* reg is the error code */
loc_unavailable
,
/* location is not available */
loc_absolute
,
/* offset is the location */
...
...
dlls/dbghelp/module.c
View file @
101820d0
...
...
@@ -832,7 +832,7 @@ BOOL WINAPI SymEnumerateModulesW64(HANDLE hProcess,
for
(
module
=
pcs
->
lmodules
;
module
;
module
=
module
->
next
)
{
if
(
!
(
dbghelp_options
&
SYMOPT_WINE_WITH_NATIVE_MODULES
)
&&
if
(
!
dbghelp_opt_native
&&
(
module
->
type
==
DMT_ELF
||
module
->
type
==
DMT_MACHO
))
continue
;
if
(
!
EnumModulesCallback
(
module
->
modulename
,
...
...
dlls/dbghelp/symbol.c
View file @
101820d0
...
...
@@ -1062,7 +1062,7 @@ static BOOL sym_enum(HANDLE hProcess, ULONG64 BaseOfDll, PCWSTR Mask,
}
/* not found in PE modules, retry on the ELF ones
*/
if
(
!
pair
.
requested
&&
(
dbghelp_options
&
SYMOPT_WINE_WITH_NATIVE_MODULES
)
)
if
(
!
pair
.
requested
&&
dbghelp_opt_native
)
{
for
(
pair
.
requested
=
pair
.
pcs
->
lmodules
;
pair
.
requested
;
pair
.
requested
=
pair
.
requested
->
next
)
{
...
...
@@ -1393,7 +1393,7 @@ BOOL WINAPI SymFromName(HANDLE hProcess, PCSTR Name, PSYMBOL_INFO Symbol)
}
/* not found in PE modules, retry on the ELF ones
*/
if
(
dbghelp_opt
ions
&
SYMOPT_WINE_WITH_NATIVE_MODULES
)
if
(
dbghelp_opt
_native
)
{
for
(
module
=
pcs
->
lmodules
;
module
;
module
=
module
->
next
)
{
...
...
programs/winedbg/info.c
View file @
101820d0
...
...
@@ -214,7 +214,7 @@ void info_win32_module(DWORD64 base)
{
struct
info_modules
im
;
UINT
i
,
j
,
num_printed
=
0
;
DWORD
opt
;
BOOL
opt
;
if
(
!
dbg_curr_process
)
{
...
...
@@ -228,9 +228,9 @@ void info_win32_module(DWORD64 base)
/* this is a wine specific options to return also ELF modules in the
* enumeration
*/
SymSetOptions
((
opt
=
SymGetOptions
())
|
0x40000000
);
opt
=
SymSetExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
TRUE
);
SymEnumerateModules64
(
dbg_curr_process
->
handle
,
info_mod_cb
,
&
im
);
SymSet
Options
(
opt
);
SymSet
ExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
opt
);
qsort
(
im
.
modules
,
im
.
num_used
,
sizeof
(
im
.
modules
[
0
]),
module_compare
);
...
...
programs/winedbg/symbol.c
View file @
101820d0
...
...
@@ -366,7 +366,7 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
struct
sgv_data
sgv
;
int
i
;
char
buffer
[
512
];
DWORD
opt
;
BOOL
opt
;
IMAGEHLP_STACK_FRAME
ihsf
;
if
(
strlen
(
name
)
+
4
>
sizeof
(
buffer
))
...
...
@@ -394,7 +394,7 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
/* this is a wine specific options to return also ELF modules in the
* enumeration
*/
SymSetOptions
((
opt
=
SymGetOptions
())
|
0x40000000
);
opt
=
SymSetExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
TRUE
);
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
buffer
,
sgv_cb
,
(
void
*
)
&
sgv
);
if
(
!
sgv
.
num
)
...
...
@@ -419,7 +419,7 @@ enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno,
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
buffer
,
sgv_cb
,
(
void
*
)
&
sgv
);
}
}
SymSet
Options
(
opt
);
SymSet
ExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
opt
);
/* now grab local symbols */
if
(
stack_get_current_frame
(
&
ihsf
)
&&
sgv
.
num
<
NUMDBGV
)
...
...
@@ -655,10 +655,10 @@ BOOL symbol_get_line(const char* filename, const char* name,
/* this is a wine specific options to return also ELF modules in the
* enumeration
*/
SymSetOptions
((
opt
=
SymGetOptions
())
|
0x40000000
);
opt
=
SymSetExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
TRUE
);
if
(
!
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
buffer
,
sgv_cb
,
(
void
*
)
&
sgv
))
{
SymSet
Options
(
opt
);
SymSet
ExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
opt
);
return
FALSE
;
}
...
...
@@ -668,11 +668,11 @@ BOOL symbol_get_line(const char* filename, const char* name,
strcpy
(
&
buffer
[
3
],
name
);
if
(
!
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
buffer
,
sgv_cb
,
(
void
*
)
&
sgv
))
{
SymSet
Options
(
opt
);
SymSet
ExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
opt
);
return
FALSE
;
}
}
SymSet
Options
(
opt
);
SymSet
ExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
opt
);
for
(
i
=
0
;
i
<
sgv
.
num
;
i
++
)
{
...
...
@@ -795,7 +795,7 @@ static BOOL CALLBACK symbols_info_cb(PSYMBOL_INFO sym, ULONG size, PVOID ctx)
void
symbol_info
(
const
char
*
str
)
{
char
buffer
[
512
];
DWORD
opt
;
BOOL
opt
;
if
(
strlen
(
str
)
+
3
>=
sizeof
(
buffer
))
{
...
...
@@ -808,7 +808,7 @@ void symbol_info(const char* str)
/* this is a wine specific options to return also ELF modules in the
* enumeration
*/
SymSetOptions
((
opt
=
SymGetOptions
())
|
0x40000000
);
opt
=
SymSetExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
TRUE
);
SymEnumSymbols
(
dbg_curr_process
->
handle
,
0
,
buffer
,
symbols_info_cb
,
NULL
);
SymSet
Options
(
opt
);
SymSet
ExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
opt
);
}
programs/winedbg/tgt_module.c
View file @
101820d0
...
...
@@ -45,13 +45,15 @@ static BOOL tgt_process_module_write(HANDLE hProcess, void* addr,
enum
dbg_start
tgt_module_load
(
const
char
*
name
,
BOOL
keep
)
{
DWORD
opts
=
SymGetOptions
();
BOOL
native
;
HANDLE
hDummy
=
(
HANDLE
)
0x87654321
;
enum
dbg_start
ret
=
start_ok
;
WCHAR
*
nameW
;
unsigned
len
;
SymSetOptions
((
opts
&
~
(
SYMOPT_UNDNAME
|
SYMOPT_DEFERRED_LOADS
))
|
SYMOPT_LOAD_LINES
|
SYMOPT_AUTO_PUBLICS
|
0x40000000
);
SYMOPT_LOAD_LINES
|
SYMOPT_AUTO_PUBLICS
);
native
=
SymSetExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
TRUE
);
if
(
!
dbg_init
(
hDummy
,
NULL
,
FALSE
))
return
start_error_init
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
NULL
,
0
);
...
...
@@ -76,7 +78,7 @@ enum dbg_start tgt_module_load(const char* name, BOOL keep)
{
dbg_printf
(
"Non supported mode... errors may occur
\n
"
"Use at your own risks
\n
"
);
SymSet
Options
(
SymGetOptions
()
|
0x40000000
);
SymSet
ExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
TRUE
);
dbg_curr_process
=
dbg_add_process
(
&
be_process_module_io
,
1
,
hDummy
);
dbg_curr_pid
=
1
;
dbg_curr_thread
=
dbg_add_thread
(
dbg_curr_process
,
2
,
NULL
,
NULL
);
...
...
@@ -87,6 +89,7 @@ enum dbg_start tgt_module_load(const char* name, BOOL keep)
{
SymCleanup
(
hDummy
);
SymSetOptions
(
opts
);
SymSetExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
native
);
}
return
ret
;
...
...
programs/winedbg/winedbg.c
View file @
101820d0
...
...
@@ -436,7 +436,7 @@ static BOOL CALLBACK mod_loader_cb(PCSTR mod_name, DWORD64 base, PVOID ctx)
BOOL
dbg_get_debuggee_info
(
HANDLE
hProcess
,
IMAGEHLP_MODULE64
*
imh_mod
)
{
struct
mod_loader_info
mli
;
DWORD
opt
;
BOOL
opt
;
/* this will resynchronize builtin dbghelp's internal ELF module list */
SymLoadModule
(
hProcess
,
0
,
0
,
0
,
0
,
0
);
...
...
@@ -447,9 +447,9 @@ BOOL dbg_get_debuggee_info(HANDLE hProcess, IMAGEHLP_MODULE64* imh_mod)
/* this is a wine specific options to return also ELF modules in the
* enumeration
*/
SymSetOptions
((
opt
=
SymGetOptions
())
|
0x40000000
);
opt
=
SymSetExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
TRUE
);
SymEnumerateModules64
(
hProcess
,
mod_loader_cb
,
&
mli
);
SymSet
Options
(
opt
);
SymSet
ExtendedOption
(
SYMOPT_EX_WINE_NATIVE_MODULES
,
opt
);
return
imh_mod
->
BaseOfImage
!=
0
;
}
...
...
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