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
b1782079
Commit
b1782079
authored
Feb 14, 1999
by
Marcus Meissner
Committed by
Alexandre Julliard
Feb 14, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added possibility to load .stabs/.stabstr sections from PE dlls.
Unfortunately my samples use currently typedefs which wine-dbg does not understand, so no actual parsing.
parent
fb019223
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
20 deletions
+44
-20
hash.c
debugger/hash.c
+1
-4
msc.c
debugger/msc.c
+41
-13
stabs.c
debugger/stabs.c
+0
-1
debugger.h
include/debugger.h
+2
-2
No files found.
debugger/hash.c
View file @
b1782079
...
...
@@ -865,10 +865,7 @@ static void DEBUG_LoadEntryPoints32( HMODULE32 hModule, const char *name )
DEBUG_AddSymbol
(
buffer
,
&
addr
,
NULL
,
SYM_WIN32
|
SYM_FUNC
);
}
}
dir
=
&
PE_HEADER
(
hModule
)
->
OptionalHeader
.
DataDirectory
[
IMAGE_DIRECTORY_ENTRY_DEBUG
];
if
(
dir
->
Size
)
DEBUG_RegisterDebugInfo
(
hModule
,
name
,
dir
->
VirtualAddress
,
dir
->
Size
);
DEBUG_RegisterDebugInfo
(
hModule
,
name
);
#undef RVA
}
...
...
debugger/msc.c
View file @
b1782079
...
...
@@ -915,17 +915,21 @@ DEBUG_InitCVDataTypes()
* We don't fully process it here for performance reasons.
*/
int
DEBUG_RegisterDebugInfo
(
HMODULE32
hModule
,
const
char
*
module_name
,
u_long
v_addr
,
u_long
size
)
DEBUG_RegisterDebugInfo
(
HMODULE32
hModule
,
const
char
*
module_name
)
{
int
has_codeview
=
FALSE
;
int
rtn
=
FALSE
;
int
orig_size
;
PIMAGE_DEBUG_DIRECTORY
dbgptr
;
orig_size
=
size
;
dbgptr
=
(
PIMAGE_DEBUG_DIRECTORY
)
(
hModule
+
v_addr
);
for
(;
size
>=
sizeof
(
*
dbgptr
);
size
-=
sizeof
(
*
dbgptr
),
dbgptr
++
)
u_long
v_addr
,
size
;
PIMAGE_NT_HEADERS
nth
=
PE_HEADER
(
hModule
);
size
=
nth
->
OptionalHeader
.
DataDirectory
[
IMAGE_DIRECTORY_ENTRY_DEBUG
].
Size
;
if
(
size
)
{
v_addr
=
nth
->
OptionalHeader
.
DataDirectory
[
IMAGE_DIRECTORY_ENTRY_DEBUG
].
VirtualAddress
;
dbgptr
=
(
PIMAGE_DEBUG_DIRECTORY
)
(
hModule
+
v_addr
);
orig_size
=
size
;
for
(;
size
>=
sizeof
(
*
dbgptr
);
size
-=
sizeof
(
*
dbgptr
),
dbgptr
++
)
{
switch
(
dbgptr
->
Type
)
{
...
...
@@ -936,9 +940,9 @@ DEBUG_RegisterDebugInfo( HMODULE32 hModule, const char *module_name,
}
}
size
=
orig_size
;
dbgptr
=
(
PIMAGE_DEBUG_DIRECTORY
)
(
hModule
+
v_addr
);
for
(;
size
>=
sizeof
(
*
dbgptr
);
size
-=
sizeof
(
*
dbgptr
),
dbgptr
++
)
size
=
orig_size
;
dbgptr
=
(
PIMAGE_DEBUG_DIRECTORY
)
(
hModule
+
v_addr
);
for
(;
size
>=
sizeof
(
*
dbgptr
);
size
-=
sizeof
(
*
dbgptr
),
dbgptr
++
)
{
switch
(
dbgptr
->
Type
)
{
...
...
@@ -1029,11 +1033,35 @@ DEBUG_RegisterDebugInfo( HMODULE32 hModule, const char *module_name,
default:
}
}
DEBUG_next_index
++
;
DEBUG_next_index
++
;
}
/* look for .stabs/.stabstr sections */
{
PIMAGE_SECTION_HEADER
pe_seg
=
PE_SECTIONS
(
hModule
);
int
i
,
stabsize
=
0
,
stabstrsize
=
0
;
unsigned
int
stabs
=
0
,
stabstr
=
0
;
for
(
i
=
0
;
i
<
nth
->
FileHeader
.
NumberOfSections
;
i
++
)
{
if
(
!
strcasecmp
(
pe_seg
[
i
].
Name
,
".stab"
))
{
stabs
=
pe_seg
[
i
].
VirtualAddress
;
stabsize
=
pe_seg
[
i
].
SizeOfRawData
;
}
if
(
!
strncasecmp
(
pe_seg
[
i
].
Name
,
".stabstr"
,
8
))
{
stabstr
=
pe_seg
[
i
].
VirtualAddress
;
stabstrsize
=
pe_seg
[
i
].
SizeOfRawData
;
}
}
if
(
stabstrsize
&&
stabsize
)
{
#ifdef _WE_SUPPORT_THE_STAB_TYPES_USED_BY_MINGW_TOO
/* Won't work currently, since MINGW32 uses some special typedefs
* which we do not handle yet. Support for them is a bit difficult.
*/
DEBUG_ParseStabs
(
hModule
,
0
,
stabs
,
stabsize
,
stabstr
,
stabstrsize
);
#endif
fprintf
(
stderr
,
"(stabs not loaded)"
);
}
}
return
(
rtn
);
}
/*
...
...
debugger/stabs.c
View file @
b1782079
...
...
@@ -620,7 +620,6 @@ DEBUG_ParseStabType(const char * stab)
return
stab_types
[
DEBUG_ReadTypeEnum
(
&
c
)];
}
static
int
DEBUG_ParseStabs
(
char
*
addr
,
unsigned
int
load_offset
,
unsigned
int
staboff
,
int
stablen
,
...
...
include/debugger.h
View file @
b1782079
...
...
@@ -271,10 +271,10 @@ extern int DEBUG_GetCurrentFrame(struct name_hash ** name,
/* debugger/stabs.c */
extern
int
DEBUG_ReadExecutableDbgInfo
(
void
);
extern
int
DEBUG_ParseStabs
(
char
*
addr
,
unsigned
int
load_offset
,
unsigned
int
staboff
,
int
stablen
,
unsigned
int
strtaboff
,
int
strtablen
);
/* debugger/msc.c */
extern
int
DEBUG_RegisterDebugInfo
(
HMODULE32
,
const
char
*
,
unsigned
long
,
unsigned
long
);
extern
int
DEBUG_RegisterDebugInfo
(
HMODULE32
,
const
char
*
);
extern
int
DEBUG_ProcessDeferredDebug
(
void
);
extern
int
DEBUG_RegisterELFDebugInfo
(
int
load_addr
,
u_long
size
,
char
*
name
);
extern
void
DEBUG_InfoShare
(
void
);
...
...
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