Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ced12a1a
Commit
ced12a1a
authored
Nov 16, 2021
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Move debug info loading out of image backends into SymLoadModuleEx().
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1b7bce4b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
52 deletions
+42
-52
elf_module.c
dlls/dbghelp/elf_module.c
+1
-6
macho_module.c
dlls/dbghelp/macho_module.c
+0
-4
module.c
dlls/dbghelp/module.c
+40
-34
pe_module.c
dlls/dbghelp/pe_module.c
+1
-8
No files found.
dlls/dbghelp/elf_module.c
View file @
ced12a1a
...
...
@@ -1261,15 +1261,10 @@ static BOOL elf_load_file_from_fmap(struct process* pcs, const WCHAR* filename,
elf_module_info
->
file_map
=
*
fmap
;
elf_reset_file_map
(
fmap
);
if
(
dbghelp_options
&
SYMOPT_DEFERRED_LOADS
)
{
elf_info
->
module
->
module
.
SymType
=
SymDeferred
;
ret
=
TRUE
;
}
else
ret
=
elf_load_debug_info
(
pcs
,
elf_info
->
module
);
elf_module_info
->
elf_mark
=
1
;
elf_module_info
->
elf_loader
=
0
;
ret
=
TRUE
;
}
else
ret
=
TRUE
;
if
(
elf_info
->
flags
&
ELF_INFO_NAME
)
...
...
dlls/dbghelp/macho_module.c
View file @
ced12a1a
...
...
@@ -1495,10 +1495,6 @@ static BOOL macho_load_file(struct process* pcs, const WCHAR* filename,
macho_module_info
->
file_map
=
fmap
;
reset_file_map
(
&
fmap
);
if
(
dbghelp_options
&
SYMOPT_DEFERRED_LOADS
)
macho_info
->
module
->
module
.
SymType
=
SymDeferred
;
else
if
(
!
macho_load_debug_info
(
pcs
,
macho_info
->
module
))
ret
=
FALSE
;
macho_info
->
module
->
format_info
[
DFI_MACHO
]
->
u
.
macho_info
->
in_use
=
1
;
macho_info
->
module
->
format_info
[
DFI_MACHO
]
->
u
.
macho_info
->
is_loader
=
0
;
...
...
dlls/dbghelp/module.c
View file @
ced12a1a
...
...
@@ -200,7 +200,7 @@ struct module* module_new(struct process* pcs, const WCHAR* name,
module_set_module
(
module
,
name
);
module
->
module
.
ImageName
[
0
]
=
'\0'
;
lstrcpynW
(
module
->
module
.
LoadedImageName
,
name
,
ARRAY_SIZE
(
module
->
module
.
LoadedImageName
));
module
->
module
.
SymType
=
Sym
None
;
module
->
module
.
SymType
=
Sym
Deferred
;
module
->
module
.
NumSyms
=
0
;
module
->
module
.
TimeDateStamp
=
stamp
;
module
->
module
.
CheckSum
=
checksum
;
...
...
@@ -350,54 +350,59 @@ struct module* module_get_containee(const struct process* pcs, const struct modu
return
NULL
;
}
/******************************************************************
* module_get_debug
*
* get the debug information from a module:
* - if the module's type is deferred, then force loading of debug info (and return
* the module itself)
* - if the module has no debug info and has an ELF container, then return the ELF
* container (and also force the ELF container's debug info loading if deferred)
* - otherwise return the module itself if it has some debug info
*/
BOOL
module_get_debug
(
struct
module_pair
*
pair
)
BOOL
module_load_debug
(
struct
module
*
module
)
{
IMAGEHLP_DEFERRED_SYMBOL_LOADW64
idslW64
;
if
(
!
pair
->
requested
)
return
FALSE
;
/* for a PE builtin, always get info from container */
if
(
!
(
pair
->
effective
=
module_get_container
(
pair
->
pcs
,
pair
->
requested
)))
pair
->
effective
=
pair
->
requested
;
/* if deferred, force loading */
if
(
pair
->
effectiv
e
->
module
.
SymType
==
SymDeferred
)
if
(
modul
e
->
module
.
SymType
==
SymDeferred
)
{
BOOL
ret
;
if
(
pair
->
effectiv
e
->
is_virtual
)
ret
=
FALSE
;
else
if
(
pair
->
effectiv
e
->
type
==
DMT_PE
)
if
(
modul
e
->
is_virtual
)
ret
=
FALSE
;
else
if
(
modul
e
->
type
==
DMT_PE
)
{
idslW64
.
SizeOfStruct
=
sizeof
(
idslW64
);
idslW64
.
BaseOfImage
=
pair
->
effectiv
e
->
module
.
BaseOfImage
;
idslW64
.
CheckSum
=
pair
->
effectiv
e
->
module
.
CheckSum
;
idslW64
.
TimeDateStamp
=
pair
->
effectiv
e
->
module
.
TimeDateStamp
;
memcpy
(
idslW64
.
FileName
,
pair
->
effectiv
e
->
module
.
ImageName
,
sizeof
(
pair
->
effectiv
e
->
module
.
ImageName
));
idslW64
.
BaseOfImage
=
modul
e
->
module
.
BaseOfImage
;
idslW64
.
CheckSum
=
modul
e
->
module
.
CheckSum
;
idslW64
.
TimeDateStamp
=
modul
e
->
module
.
TimeDateStamp
;
memcpy
(
idslW64
.
FileName
,
modul
e
->
module
.
ImageName
,
sizeof
(
modul
e
->
module
.
ImageName
));
idslW64
.
Reparse
=
FALSE
;
idslW64
.
hFile
=
INVALID_HANDLE_VALUE
;
pcs_callback
(
pair
->
pc
s
,
CBA_DEFERRED_SYMBOL_LOAD_START
,
&
idslW64
);
ret
=
pe_load_debug_info
(
pair
->
pcs
,
pair
->
effectiv
e
);
pcs_callback
(
pair
->
pc
s
,
pcs_callback
(
module
->
proces
s
,
CBA_DEFERRED_SYMBOL_LOAD_START
,
&
idslW64
);
ret
=
pe_load_debug_info
(
module
->
process
,
modul
e
);
pcs_callback
(
module
->
proces
s
,
ret
?
CBA_DEFERRED_SYMBOL_LOAD_COMPLETE
:
CBA_DEFERRED_SYMBOL_LOAD_FAILURE
,
&
idslW64
);
}
else
ret
=
pair
->
pcs
->
loader
->
load_debug_info
(
pair
->
pcs
,
pair
->
effectiv
e
);
else
ret
=
module
->
process
->
loader
->
load_debug_info
(
module
->
process
,
modul
e
);
if
(
!
ret
)
pair
->
effectiv
e
->
module
.
SymType
=
SymNone
;
assert
(
pair
->
effectiv
e
->
module
.
SymType
!=
SymDeferred
);
pair
->
effective
->
module
.
NumSyms
=
pair
->
effectiv
e
->
ht_symbols
.
num_elts
;
if
(
!
ret
)
modul
e
->
module
.
SymType
=
SymNone
;
assert
(
modul
e
->
module
.
SymType
!=
SymDeferred
);
module
->
module
.
NumSyms
=
modul
e
->
ht_symbols
.
num_elts
;
}
return
pair
->
effective
->
module
.
SymType
!=
SymNone
;
return
module
->
module
.
SymType
!=
SymNone
;
}
/******************************************************************
* module_get_debug
*
* get the debug information from a module:
* - if the module's type is deferred, then force loading of debug info (and return
* the module itself)
* - if the module has no debug info and has an ELF container, then return the ELF
* container (and also force the ELF container's debug info loading if deferred)
* - otherwise return the module itself if it has some debug info
*/
BOOL
module_get_debug
(
struct
module_pair
*
pair
)
{
if
(
!
pair
->
requested
)
return
FALSE
;
/* for a PE builtin, always get info from container */
if
(
!
(
pair
->
effective
=
module_get_container
(
pair
->
pcs
,
pair
->
requested
)))
pair
->
effective
=
pair
->
requested
;
return
module_load_debug
(
pair
->
effective
);
}
/***********************************************************************
...
...
@@ -966,7 +971,6 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
WARN
(
"Couldn't locate %s
\n
"
,
debugstr_w
(
wImageName
));
return
0
;
}
module
->
module
.
NumSyms
=
module
->
ht_symbols
.
num_elts
;
/* by default module_new fills module.ModuleName from a derivation
* of LoadedImageName. Overwrite it, if we have better information
*/
...
...
@@ -974,7 +978,8 @@ DWORD64 WINAPI SymLoadModuleExW(HANDLE hProcess, HANDLE hFile, PCWSTR wImageNam
module_set_module
(
module
,
wModuleName
);
if
(
wImageName
)
lstrcpynW
(
module
->
module
.
ImageName
,
wImageName
,
ARRAY_SIZE
(
module
->
module
.
ImageName
));
if
((
dbghelp_options
&
SYMOPT_DEFERRED_LOADS
)
==
0
)
module_load_debug
(
module
);
return
module
->
module
.
BaseOfImage
;
}
...
...
@@ -1494,6 +1499,7 @@ static struct module* native_load_module(struct process* pcs, const WCHAR* name,
static
BOOL
native_load_debug_info
(
struct
process
*
process
,
struct
module
*
module
)
{
module
->
module
.
SymType
=
SymNone
;
return
FALSE
;
}
...
...
dlls/dbghelp/pe_module.c
View file @
ced12a1a
...
...
@@ -751,7 +751,7 @@ BOOL pe_load_debug_info(const struct process* pcs, struct module* module)
/* FIXME shouldn't we check that? if (!module_get_debug(pcs, module)) */
if
(
pe_load_export_debug_info
(
pcs
,
module
)
&&
!
ret
)
ret
=
TRUE
;
if
(
!
ret
)
module
->
module
.
SymType
=
SymNone
;
return
ret
;
}
...
...
@@ -797,8 +797,6 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name,
opened
=
TRUE
;
}
else
if
(
name
)
lstrcpyW
(
loaded_name
,
name
);
else
if
(
dbghelp_options
&
SYMOPT_DEFERRED_LOADS
)
FIXME
(
"Trouble ahead (no module name passed in deferred mode)
\n
"
);
if
(
!
(
modfmt
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
module_format
)
+
sizeof
(
struct
pe_module_info
))))
return
NULL
;
modfmt
->
u
.
pe_info
=
(
struct
pe_module_info
*
)(
modfmt
+
1
);
...
...
@@ -824,12 +822,7 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name,
modfmt
->
module
=
module
;
modfmt
->
remove
=
pe_module_remove
;
modfmt
->
loc_compute
=
NULL
;
module
->
format_info
[
DFI_PE
]
=
modfmt
;
if
(
dbghelp_options
&
SYMOPT_DEFERRED_LOADS
)
module
->
module
.
SymType
=
SymDeferred
;
else
pe_load_debug_info
(
pcs
,
module
);
module
->
reloc_delta
=
base
-
PE_FROM_OPTHDR
(
&
modfmt
->
u
.
pe_info
->
fmap
,
ImageBase
);
}
else
...
...
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