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
cbff4f06
Commit
cbff4f06
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: Create the notion of image (PE, ELF modules) to uniformize some handlings.
parent
fb169502
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
43 deletions
+93
-43
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+2
-2
elf_module.c
dlls/dbghelp/elf_module.c
+0
-0
image_private.h
dlls/dbghelp/image_private.h
+91
-41
pe_module.c
dlls/dbghelp/pe_module.c
+0
-0
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
cbff4f06
...
@@ -474,8 +474,8 @@ typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user);
...
@@ -474,8 +474,8 @@ typedef BOOL (*enum_modules_cb)(const WCHAR*, unsigned long addr, void* user);
/* elf_module.c */
/* elf_module.c */
extern
BOOL
elf_enum_modules
(
HANDLE
hProc
,
enum_modules_cb
,
void
*
);
extern
BOOL
elf_enum_modules
(
HANDLE
hProc
,
enum_modules_cb
,
void
*
);
extern
BOOL
elf_fetch_file_info
(
const
WCHAR
*
name
,
DWORD
*
base
,
DWORD
*
size
,
DWORD
*
checksum
);
extern
BOOL
elf_fetch_file_info
(
const
WCHAR
*
name
,
DWORD
*
base
,
DWORD
*
size
,
DWORD
*
checksum
);
struct
elf
_file_map
;
struct
image
_file_map
;
extern
BOOL
elf_load_debug_info
(
struct
module
*
module
,
struct
elf
_file_map
*
fmap
);
extern
BOOL
elf_load_debug_info
(
struct
module
*
module
,
struct
image
_file_map
*
fmap
);
extern
struct
module
*
extern
struct
module
*
elf_load_module
(
struct
process
*
pcs
,
const
WCHAR
*
name
,
unsigned
long
);
elf_load_module
(
struct
process
*
pcs
,
const
WCHAR
*
name
,
unsigned
long
);
extern
BOOL
elf_read_wine_loader_dbg_info
(
struct
process
*
pcs
);
extern
BOOL
elf_read_wine_loader_dbg_info
(
struct
process
*
pcs
);
...
...
dlls/dbghelp/elf_module.c
View file @
cbff4f06
This diff is collapsed.
Click to expand it.
dlls/dbghelp/image_private.h
View file @
cbff4f06
...
@@ -60,60 +60,110 @@
...
@@ -60,60 +60,110 @@
#define Elf_Dyn Elf32_Dyn
#define Elf_Dyn Elf32_Dyn
#define Elf_Sym Elf32_Sym
#define Elf_Sym Elf32_Sym
#endif
#endif
#else
#ifndef SHT_NULL
#define SHT_NULL 0
#endif
#endif
/* structure holding information while handling an ELF image
/* structure holding information while handling an ELF image
* allows one by one section mapping for memory savings
* allows one by one section mapping for memory savings
*/
*/
struct
elf
_file_map
struct
image
_file_map
{
{
size_t
elf_size
;
enum
module_type
modtype
;
size_t
elf_start
;
union
int
fd
;
const
char
*
shstrtab
;
struct
elf_file_map
*
alternate
;
/* another ELF file (linked to this one) */
Elf_Ehdr
elfhdr
;
struct
{
{
Elf_Shdr
shdr
;
struct
elf_file_map
const
char
*
mapped
;
{
}
*
sect
;
size_t
elf_size
;
};
size_t
elf_start
;
int
fd
;
const
char
*
shstrtab
;
struct
image_file_map
*
alternate
;
/* another ELF file (linked to this one) */
#ifdef __ELF__
Elf_Ehdr
elfhdr
;
struct
{
Elf_Shdr
shdr
;
const
char
*
mapped
;
}
*
sect
;
#endif
#endif
}
elf
;
struct
pe_file_map
struct
pe_file_map
{
{
HANDLE
hMap
;
HANDLE
hMap
;
IMAGE_NT_HEADERS
ntheader
;
IMAGE_NT_HEADERS
ntheader
;
unsigned
full_count
;
unsigned
full_count
;
void
*
full_map
;
void
*
full_map
;
struct
struct
{
{
IMAGE_SECTION_HEADER
shdr
;
IMAGE_SECTION_HEADER
shdr
;
const
char
*
mapped
;
const
char
*
mapped
;
}
*
sect
;
}
*
sect
;
const
char
*
strtable
;
const
char
*
strtable
;
}
pe
;
}
u
;
};
};
struct
elf
_section_map
struct
image
_section_map
{
{
struct
elf_file_map
*
fmap
;
struct
image_file_map
*
fmap
;
long
sidx
;
long
sidx
;
};
};
struct
pe_section_map
extern
BOOL
elf_find_section
(
struct
image_file_map
*
fmap
,
const
char
*
name
,
unsigned
sht
,
struct
image_section_map
*
ism
);
extern
const
char
*
elf_map_section
(
struct
image_section_map
*
ism
);
extern
void
elf_unmap_section
(
struct
image_section_map
*
ism
);
extern
unsigned
elf_get_map_size
(
const
struct
image_section_map
*
ism
);
extern
BOOL
pe_find_section
(
struct
image_file_map
*
fmap
,
const
char
*
name
,
struct
image_section_map
*
ism
);
extern
const
char
*
pe_map_section
(
struct
image_section_map
*
psm
);
extern
void
pe_unmap_section
(
struct
image_section_map
*
psm
);
extern
unsigned
pe_get_map_size
(
const
struct
image_section_map
*
psm
);
static
inline
BOOL
image_find_section
(
struct
image_file_map
*
fmap
,
const
char
*
name
,
struct
image_section_map
*
ism
)
{
{
struct
pe_file_map
*
fmap
;
switch
(
fmap
->
modtype
)
long
sidx
;
{
};
case
DMT_ELF
:
return
elf_find_section
(
fmap
,
name
,
SHT_NULL
,
ism
);
case
DMT_PE
:
return
pe_find_section
(
fmap
,
name
,
ism
);
default:
assert
(
0
);
return
FALSE
;
}
}
static
inline
const
char
*
image_map_section
(
struct
image_section_map
*
ism
)
{
if
(
!
ism
->
fmap
)
return
NULL
;
switch
(
ism
->
fmap
->
modtype
)
{
case
DMT_ELF
:
return
elf_map_section
(
ism
);
case
DMT_PE
:
return
pe_map_section
(
ism
);
default:
assert
(
0
);
return
NULL
;
}
}
extern
BOOL
elf_find_section
(
struct
elf_file_map
*
fmap
,
const
char
*
name
,
static
inline
void
image_unmap_section
(
struct
image_section_map
*
ism
)
unsigned
sht
,
struct
elf_section_map
*
esm
);
{
extern
const
char
*
elf_map_section
(
struct
elf_section_map
*
esm
);
if
(
!
ism
->
fmap
)
return
;
extern
void
elf_unmap_section
(
struct
elf_section_map
*
esm
);
switch
(
ism
->
fmap
->
modtype
)
extern
unsigned
elf_get_map_size
(
const
struct
elf_section_map
*
esm
);
{
case
DMT_ELF
:
elf_unmap_section
(
ism
);
break
;
case
DMT_PE
:
pe_unmap_section
(
ism
);
break
;
default:
assert
(
0
);
return
;
}
}
extern
BOOL
pe_find_section
(
struct
pe_file_map
*
fmap
,
const
char
*
name
,
static
inline
unsigned
image_get_map_size
(
struct
image_section_map
*
ism
)
struct
pe_section_map
*
psm
);
{
extern
const
char
*
pe_map_section
(
struct
pe_section_map
*
psm
);
if
(
!
ism
->
fmap
)
return
0
;
extern
void
pe_unmap_section
(
struct
pe_section_map
*
psm
);
switch
(
ism
->
fmap
->
modtype
)
extern
unsigned
pe_get_map_size
(
const
struct
pe_section_map
*
psm
);
{
case
DMT_ELF
:
return
elf_get_map_size
(
ism
);
case
DMT_PE
:
return
pe_get_map_size
(
ism
);
default:
assert
(
0
);
return
0
;
}
}
dlls/dbghelp/pe_module.c
View file @
cbff4f06
This diff is collapsed.
Click to expand it.
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