Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
954a612c
Commit
954a612c
authored
20 years ago
by
Eric Pouech
Committed by
Alexandre Julliard
20 years ago
Browse files
Options
Downloads
Patches
Plain Diff
- implement SymUnDName and UndecorateSymbolName on top of
msvcrt.__unDName - implement SYMOPT_UNDNAME support
parent
e21f7c2a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/dbghelp/dbghelp.c
+9
-5
9 additions, 5 deletions
dlls/dbghelp/dbghelp.c
dlls/dbghelp/dbghelp_private.h
+3
-4
3 additions, 4 deletions
dlls/dbghelp/dbghelp_private.h
dlls/dbghelp/symbol.c
+30
-9
30 additions, 9 deletions
dlls/dbghelp/symbol.c
with
42 additions
and
18 deletions
dlls/dbghelp/dbghelp.c
+
9
−
5
View file @
954a612c
...
...
@@ -33,14 +33,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
* + funcargtype:s are (partly) wrong: they should be a specific struct (like
* typedef) pointing to the actual type (and not a direct access)
* + we should store the underlying type for an enum in the symt_enum struct
* - most options (dbghelp_options) are not used (loading lines, decoration...)
* + for enums, we store the names & values (associated to the enum type),
* but those values are not directly usable from a debugger (that's why, I
* assume, that we have also to define constants for enum values, as
* Codeview does BTW.
* - most options (dbghelp_options) are not used (loading lines...)
* - in symbol lookup by name, we don't use RE everywhere we should. Moreover, when
* we're supposed to use RE, it doesn't make use of our hash tables. Therefore,
* we could use hash if name isn't a RE, and fall back to a full search when we
* get a full RE
* - (un)decoration is not handled (should make winedump's code a (.a) library
* and link it to winedump, and potentially to msvcrt and dbghelp (check best
* way not to duplicate code in msvcrt & dbghelp)
* - msc:
* + we should add parameters' types to the function's signature
* while processing a function's parameters
...
...
@@ -59,6 +60,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
*/
unsigned
dbghelp_options
=
SYMOPT_UNDNAME
;
HANDLE
hMsvcrt
=
NULL
;
/***********************************************************************
* DllMain (DEBUGHLP.@)
...
...
@@ -68,7 +70,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
break
;
case
DLL_PROCESS_DETACH
:
break
;
case
DLL_PROCESS_DETACH
:
if
(
hMsvcrt
)
FreeLibrary
(
hMsvcrt
);
break
;
case
DLL_THREAD_ATTACH
:
break
;
case
DLL_THREAD_DETACH
:
break
;
default:
break
;
...
...
This diff is collapsed.
Click to expand it.
dlls/dbghelp/dbghelp_private.h
+
3
−
4
View file @
954a612c
...
...
@@ -99,6 +99,8 @@ void* hash_table_iter_up(struct hash_table_iter* hti);
extern
unsigned
dbghelp_options
;
/* some more Wine extensions */
#define SYMOPT_WINE_WITH_ELF_MODULES 0x40000000
struct
symt
{
...
...
@@ -288,6 +290,7 @@ struct process
/* dbghelp.c */
extern
struct
process
*
process_find_by_handle
(
HANDLE
hProcess
);
extern
HANDLE
hMsvcrt
;
/* elf_module.c */
extern
BOOL
elf_load_debug_info
(
struct
module
*
module
);
...
...
@@ -443,7 +446,3 @@ extern struct symt_pointer*
extern
struct
symt_typedef
*
symt_new_typedef
(
struct
module
*
module
,
struct
symt
*
ref
,
const
char
*
name
);
/* some more Wine extensions */
#define SYMOPT_WINE_WITH_ELF_MODULES 0x40000000
This diff is collapsed.
Click to expand it.
dlls/dbghelp/symbol.c
+
30
−
9
View file @
954a612c
...
...
@@ -529,11 +529,16 @@ static void symt_fill_sym_info(const struct module* module,
sym_info
->
Scope
=
0
;
/* FIXME */
sym_info
->
Tag
=
sym
->
tag
;
name
=
symt_get_name
(
sym
);
sym_info
->
NameLen
=
strlen
(
name
)
+
1
;
if
(
sym_info
->
MaxNameLen
)
{
strncpy
(
sym_info
->
Name
,
name
,
min
(
sym_info
->
NameLen
,
sym_info
->
MaxNameLen
));
sym_info
->
Name
[
sym_info
->
MaxNameLen
-
1
]
=
'\0'
;
if
(
sym
->
tag
!=
SymTagPublicSymbol
||
!
(
dbghelp_options
&
SYMOPT_UNDNAME
)
||
(
sym_info
->
NameLen
=
UnDecorateSymbolName
(
sym_info
->
Name
,
sym_info
->
Name
,
sym_info
->
MaxNameLen
,
UNDNAME_COMPLETE
)
==
0
))
{
sym_info
->
NameLen
=
min
(
strlen
(
name
),
sym_info
->
MaxNameLen
-
1
);
strncpy
(
sym_info
->
Name
,
name
,
sym_info
->
NameLen
);
sym_info
->
Name
[
sym_info
->
NameLen
]
=
'\0'
;
}
}
TRACE_
(
dbghelp_symt
)(
"%p => %s %lu %s
\n
"
,
sym
,
sym_info
->
Name
,
sym_info
->
Size
,
...
...
@@ -1186,21 +1191,37 @@ PVOID WINAPI SymFunctionTableAccess(HANDLE hProcess, DWORD AddrBase)
*/
BOOL
WINAPI
SymUnDName
(
PIMAGEHLP_SYMBOL
sym
,
LPSTR
UnDecName
,
DWORD
UnDecNameLength
)
{
FIXM
E
(
"(%p %s %lu): stub
\n
"
,
sym
,
UnDecName
,
UnDecNameLength
);
TRAC
E
(
"(%p %s %lu): stub
\n
"
,
sym
,
UnDecName
,
UnDecNameLength
);
return
UnDecorateSymbolName
(
sym
->
Name
,
UnDecName
,
UnDecNameLength
,
UNDNAME_COMPLETE
);
UNDNAME_COMPLETE
)
!=
0
;
}
static
void
*
und_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
void
und_free
(
void
*
ptr
)
{
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
/***********************************************************************
* UnDecorateSymbolName (DBGHELP.@)
*/
DWORD
WINAPI
UnDecorateSymbolName
(
LPCSTR
DecoratedName
,
LPSTR
UnDecoratedName
,
DWORD
UndecoratedLength
,
DWORD
Flags
)
{
FIXME
(
"(%s, %p, %ld, 0x%08lx): stub
\n
"
,
/* undocumented from msvcrt */
static
char
*
(
*
p_undname
)(
char
*
,
const
char
*
,
int
,
void
*
(
*
)(
size_t
),
void
(
*
)(
void
*
),
unsigned
short
);
static
WCHAR
szMsvcrt
[]
=
{
'm'
,
's'
,
'v'
,
'c'
,
'r'
,
't'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
TRACE
(
"(%s, %p, %ld, 0x%08lx): stub
\n
"
,
debugstr_a
(
DecoratedName
),
UnDecoratedName
,
UndecoratedLength
,
Flags
);
strncpy
(
UnDecoratedName
,
DecoratedName
,
UndecoratedLength
);
UnDecoratedName
[
UndecoratedLength
-
1
]
=
'\0'
;
return
TRUE
;
if
(
!
p_undname
)
{
if
(
!
hMsvcrt
)
hMsvcrt
=
LoadLibraryW
(
szMsvcrt
);
if
(
hMsvcrt
)
p_undname
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"__unDName"
);
if
(
!
p_undname
)
return
0
;
}
if
(
!
UnDecoratedName
)
return
0
;
if
(
!
p_undname
(
UnDecoratedName
,
DecoratedName
,
UndecoratedLength
,
und_alloc
,
und_free
,
Flags
))
return
0
;
return
strlen
(
UnDecoratedName
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment