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
6cff43fd
Commit
6cff43fd
authored
Jun 26, 2006
by
Eric Pouech
Committed by
Alexandre Julliard
Jun 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Module info.
when requesting info on a module by address, always print the module ELF/PE pair (if this applies) (and not only the embedded PE), which can be confusing.
parent
82ed6a45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
54 deletions
+46
-54
info.c
programs/winedbg/info.c
+46
-54
No files found.
programs/winedbg/info.c
View file @
6cff43fd
...
...
@@ -146,6 +146,7 @@ static const char* get_symtype_str(const IMAGEHLP_MODULE64* mi)
struct
info_module
{
IMAGEHLP_MODULE64
*
mi
;
DWORD
base
;
unsigned
num_alloc
;
unsigned
num_used
;
};
...
...
@@ -199,79 +200,70 @@ static BOOL CALLBACK info_mod_cb(PSTR mod_name, DWORD64 base, void* ctx)
*/
void
info_win32_module
(
DWORD
base
)
{
struct
info_module
im
;
int
i
,
j
,
num_printed
=
0
;
DWORD
opt
;
if
(
!
dbg_curr_process
||
!
dbg_curr_thread
)
{
dbg_printf
(
"Cannot get info on module while no process is loaded
\n
"
);
return
;
}
if
(
base
)
{
IMAGEHLP_MODULE64
mi
;
mi
.
SizeOfStruct
=
sizeof
(
mi
);
if
(
!
SymGetModuleInfo64
(
dbg_curr_process
->
handle
,
base
,
&
mi
))
{
dbg_printf
(
"'0x%08lx' is not a valid module address
\n
"
,
base
);
return
;
}
module_print_info
(
&
mi
,
FALSE
);
}
else
{
struct
info_module
im
;
int
i
,
j
;
DWORD
opt
;
im
.
mi
=
NULL
;
im
.
num_alloc
=
im
.
num_used
=
0
;
im
.
mi
=
NULL
;
im
.
num_alloc
=
im
.
num_used
=
0
;
/* this is a wine specific options to return also ELF modules in the
* enumeration
*/
SymSetOptions
((
opt
=
SymGetOptions
())
|
0x40000000
);
SymEnumerateModules64
(
dbg_curr_process
->
handle
,
info_mod_cb
,
(
void
*
)
&
im
);
SymSetOptions
(
opt
);
/* this is a wine specific options to return also ELF modules in the
* enumeration
*/
SymSetOptions
((
opt
=
SymGetOptions
())
|
0x40000000
);
SymEnumerateModules64
(
dbg_curr_process
->
handle
,
info_mod_cb
,
(
void
*
)
&
im
);
SymSetOptions
(
opt
);
qsort
(
im
.
mi
,
im
.
num_used
,
sizeof
(
im
.
mi
[
0
]),
module_compare
);
qsort
(
im
.
mi
,
im
.
num_used
,
sizeof
(
im
.
mi
[
0
]),
module_compare
);
dbg_printf
(
"Module
\t
Address
\t\t\t
Debug info
\t
Name (%d modules)
\n
"
,
im
.
num_used
);
dbg_printf
(
"Module
\t
Address
\t\t\t
Debug info
\t
Name (%d modules)
\n
"
,
im
.
num_used
);
for
(
i
=
0
;
i
<
im
.
num_used
;
i
++
)
for
(
i
=
0
;
i
<
im
.
num_used
;
i
++
)
{
if
(
base
&&
(
base
<
im
.
mi
[
i
].
BaseOfImage
||
base
>=
im
.
mi
[
i
].
BaseOfImage
+
im
.
mi
[
i
].
ImageSize
))
continue
;
if
(
strstr
(
im
.
mi
[
i
].
ModuleName
,
"<elf>"
))
{
if
(
strstr
(
im
.
mi
[
i
].
ModuleName
,
"<elf>"
))
dbg_printf
(
"ELF
\t
"
);
module_print_info
(
&
im
.
mi
[
i
],
FALSE
);
/* print all modules embedded in this one */
for
(
j
=
0
;
j
<
im
.
num_used
;
j
++
)
{
dbg_printf
(
"ELF
\t
"
);
module_print_info
(
&
im
.
mi
[
i
],
FALSE
);
/* print all modules embedded in this one */
for
(
j
=
0
;
j
<
im
.
num_used
;
j
++
)
if
(
!
strstr
(
im
.
mi
[
j
].
ModuleName
,
"<elf>"
)
&&
module_is_container
(
&
im
.
mi
[
i
],
&
im
.
mi
[
j
]))
{
if
(
!
strstr
(
im
.
mi
[
j
].
ModuleName
,
"<elf>"
)
&&
module_is_container
(
&
im
.
mi
[
i
],
&
im
.
mi
[
j
]))
{
dbg_printf
(
"
\\
-PE
\t
"
);
module_print_info
(
&
im
.
mi
[
j
],
TRUE
);
}
dbg_printf
(
"
\\
-PE
\t
"
);
module_print_info
(
&
im
.
mi
[
j
],
TRUE
);
}
}
else
}
else
{
/* check module is not embedded in another module */
for
(
j
=
0
;
j
<
im
.
num_used
;
j
++
)
{
/* check module is not embedded in another module */
for
(
j
=
0
;
j
<
im
.
num_used
;
j
++
)
{
if
(
strstr
(
im
.
mi
[
j
].
ModuleName
,
"<elf>"
)
&&
module_is_container
(
&
im
.
mi
[
j
],
&
im
.
mi
[
i
]))
break
;
}
if
(
j
<
im
.
num_used
)
continue
;
if
(
strstr
(
im
.
mi
[
i
].
ModuleName
,
".so"
)
||
strchr
(
im
.
mi
[
i
].
ModuleName
,
'<'
))
dbg_printf
(
"ELF
\t
"
);
else
dbg_printf
(
"PE
\t
"
);
module_print_info
(
&
im
.
mi
[
i
],
FALSE
);
if
(
strstr
(
im
.
mi
[
j
].
ModuleName
,
"<elf>"
)
&&
module_is_container
(
&
im
.
mi
[
j
],
&
im
.
mi
[
i
]))
break
;
}
if
(
j
<
im
.
num_used
)
continue
;
if
(
strstr
(
im
.
mi
[
i
].
ModuleName
,
".so"
)
||
strchr
(
im
.
mi
[
i
].
ModuleName
,
'<'
))
dbg_printf
(
"ELF
\t
"
);
else
dbg_printf
(
"PE
\t
"
);
module_print_info
(
&
im
.
mi
[
i
],
FALSE
);
}
HeapFree
(
GetProcessHeap
(),
0
,
im
.
mi
)
;
num_printed
++
;
}
HeapFree
(
GetProcessHeap
(),
0
,
im
.
mi
);
if
(
base
&&
!
num_printed
)
dbg_printf
(
"'0x%08lx' is not a valid module address
\n
"
,
base
);
}
struct
class_walker
...
...
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