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
cd92e3d1
Commit
cd92e3d1
authored
Mar 18, 2010
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Move the PE debug info to the newly define scheme.
parent
73f79e7f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
21 deletions
+26
-21
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+2
-1
pe_module.c
dlls/dbghelp/pe_module.c
+24
-20
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
cd92e3d1
...
...
@@ -320,6 +320,7 @@ struct module;
*/
enum
format_info
{
DFI_PE
,
DFI_DWARF
,
DFI_LAST
};
...
...
@@ -335,6 +336,7 @@ struct module_format
union
{
struct
dwarf2_module_info_s
*
dwarf2_info
;
struct
pe_module_info
*
pe_info
;
}
u
;
};
...
...
@@ -349,7 +351,6 @@ struct module
/* specific information for debug types */
struct
elf_module_info
*
elf_info
;
struct
pe_module_info
*
pe_info
;
void
(
*
module_remove
)(
struct
process
*
pcs
,
struct
module
*
module
);
struct
module_format
*
format_info
[
DFI_LAST
];
...
...
dlls/dbghelp/pe_module.c
View file @
cd92e3d1
...
...
@@ -257,10 +257,10 @@ static void pe_unmap_file(struct image_file_map* fmap)
}
}
static
void
pe_module_remove
(
struct
process
*
pcs
,
struct
module
*
module
)
static
void
pe_module_remove
(
struct
process
*
pcs
,
struct
module
_format
*
modfmt
)
{
pe_unmap_file
(
&
mod
ule
->
pe_info
->
fmap
);
HeapFree
(
GetProcessHeap
(),
0
,
mod
ule
->
pe_info
);
pe_unmap_file
(
&
mod
fmt
->
u
.
pe_info
->
fmap
);
HeapFree
(
GetProcessHeap
(),
0
,
mod
fmt
);
}
/******************************************************************
...
...
@@ -273,7 +273,7 @@ static void pe_module_remove(struct process* pcs, struct module* module)
*/
static
BOOL
pe_locate_with_coff_symbol_table
(
struct
module
*
module
)
{
struct
image_file_map
*
fmap
=
&
module
->
pe_info
->
fmap
;
struct
image_file_map
*
fmap
=
&
module
->
format_info
[
DFI_PE
]
->
u
.
pe_info
->
fmap
;
const
IMAGE_SYMBOL
*
isym
;
int
i
,
numsym
,
naux
;
char
tmp
[
9
];
...
...
@@ -333,7 +333,7 @@ static BOOL pe_locate_with_coff_symbol_table(struct module* module)
*/
static
BOOL
pe_load_coff_symbol_table
(
struct
module
*
module
)
{
struct
image_file_map
*
fmap
=
&
module
->
pe_info
->
fmap
;
struct
image_file_map
*
fmap
=
&
module
->
format_info
[
DFI_PE
]
->
u
.
pe_info
->
fmap
;
const
IMAGE_SYMBOL
*
isym
;
int
i
,
numsym
,
naux
;
const
char
*
strtable
;
...
...
@@ -413,7 +413,7 @@ static inline DWORD pe_get_sect_size(IMAGE_SECTION_HEADER* sect)
*/
static
BOOL
pe_load_stabs
(
const
struct
process
*
pcs
,
struct
module
*
module
)
{
struct
image_file_map
*
fmap
=
&
module
->
pe_info
->
fmap
;
struct
image_file_map
*
fmap
=
&
module
->
format_info
[
DFI_PE
]
->
u
.
pe_info
->
fmap
;
struct
image_section_map
sect_stabs
,
sect_stabstr
;
BOOL
ret
=
FALSE
;
...
...
@@ -449,7 +449,7 @@ static BOOL pe_load_stabs(const struct process* pcs, struct module* module)
*/
static
BOOL
pe_load_dwarf
(
struct
module
*
module
)
{
struct
image_file_map
*
fmap
=
&
module
->
pe_info
->
fmap
;
struct
image_file_map
*
fmap
=
&
module
->
format_info
[
DFI_PE
]
->
u
.
pe_info
->
fmap
;
BOOL
ret
=
FALSE
;
ret
=
dwarf2_parse
(
module
,
...
...
@@ -515,7 +515,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module,
*/
static
BOOL
pe_load_msc_debug_info
(
const
struct
process
*
pcs
,
struct
module
*
module
)
{
struct
image_file_map
*
fmap
=
&
module
->
pe_info
->
fmap
;
struct
image_file_map
*
fmap
=
&
module
->
format_info
[
DFI_PE
]
->
u
.
pe_info
->
fmap
;
BOOL
ret
=
FALSE
;
const
IMAGE_DATA_DIRECTORY
*
dir
;
const
IMAGE_DEBUG_DIRECTORY
*
dbg
=
NULL
;
...
...
@@ -566,7 +566,7 @@ done:
*/
static
BOOL
pe_load_export_debug_info
(
const
struct
process
*
pcs
,
struct
module
*
module
)
{
struct
image_file_map
*
fmap
=
&
module
->
pe_info
->
fmap
;
struct
image_file_map
*
fmap
=
&
module
->
format_info
[
DFI_PE
]
->
u
.
pe_info
->
fmap
;
unsigned
int
i
;
const
IMAGE_EXPORT_DIRECTORY
*
exports
;
DWORD
base
=
module
->
module
.
BaseOfImage
;
...
...
@@ -679,7 +679,7 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name,
{
struct
module
*
module
=
NULL
;
BOOL
opened
=
FALSE
;
struct
pe_module_info
*
module_info
;
struct
module_format
*
modfmt
;
WCHAR
loaded_name
[
MAX_PATH
];
loaded_name
[
0
]
=
'\0'
;
...
...
@@ -694,20 +694,24 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name,
else
if
(
name
)
strcpyW
(
loaded_name
,
name
);
else
if
(
dbghelp_options
&
SYMOPT_DEFERRED_LOADS
)
FIXME
(
"Trouble ahead (no module name passed in deferred mode)
\n
"
);
if
(
!
(
mod
ule_info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
module_info
))))
if
(
!
(
mod
fmt
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
module_format
)
+
sizeof
(
struct
pe_
module_info
))))
return
NULL
;
if
(
pe_map_file
(
hFile
,
&
module_info
->
fmap
,
DMT_PE
))
modfmt
->
u
.
pe_info
=
(
struct
pe_module_info
*
)(
modfmt
+
1
);
if
(
pe_map_file
(
hFile
,
&
modfmt
->
u
.
pe_info
->
fmap
,
DMT_PE
))
{
if
(
!
base
)
base
=
mod
ul
e_info
->
fmap
.
u
.
pe
.
ntheader
.
OptionalHeader
.
ImageBase
;
if
(
!
size
)
size
=
mod
ul
e_info
->
fmap
.
u
.
pe
.
ntheader
.
OptionalHeader
.
SizeOfImage
;
if
(
!
base
)
base
=
mod
fmt
->
u
.
p
e_info
->
fmap
.
u
.
pe
.
ntheader
.
OptionalHeader
.
ImageBase
;
if
(
!
size
)
size
=
mod
fmt
->
u
.
p
e_info
->
fmap
.
u
.
pe
.
ntheader
.
OptionalHeader
.
SizeOfImage
;
module
=
module_new
(
pcs
,
loaded_name
,
DMT_PE
,
FALSE
,
base
,
size
,
mod
ul
e_info
->
fmap
.
u
.
pe
.
ntheader
.
FileHeader
.
TimeDateStamp
,
mod
ul
e_info
->
fmap
.
u
.
pe
.
ntheader
.
OptionalHeader
.
CheckSum
);
mod
fmt
->
u
.
p
e_info
->
fmap
.
u
.
pe
.
ntheader
.
FileHeader
.
TimeDateStamp
,
mod
fmt
->
u
.
p
e_info
->
fmap
.
u
.
pe
.
ntheader
.
OptionalHeader
.
CheckSum
);
if
(
module
)
{
module
->
pe_info
=
module_info
;
module
->
module_remove
=
pe_module_remove
;
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
...
...
@@ -716,10 +720,10 @@ struct module* pe_load_native_module(struct process* pcs, const WCHAR* name,
else
{
ERR
(
"could not load the module '%s'
\n
"
,
debugstr_w
(
loaded_name
));
pe_unmap_file
(
&
mod
ul
e_info
->
fmap
);
pe_unmap_file
(
&
mod
fmt
->
u
.
p
e_info
->
fmap
);
}
}
if
(
!
module
)
HeapFree
(
GetProcessHeap
(),
0
,
mod
ule_info
);
if
(
!
module
)
HeapFree
(
GetProcessHeap
(),
0
,
mod
fmt
);
if
(
opened
)
CloseHandle
(
hFile
);
...
...
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