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
9c1b57c3
Commit
9c1b57c3
authored
Nov 03, 2005
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented SymEnumLines.
parent
8ad685c5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
13 deletions
+93
-13
dbghelp.spec
dlls/dbghelp/dbghelp.spec
+1
-0
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+13
-0
source.c
dlls/dbghelp/source.c
+66
-0
symbol.c
dlls/dbghelp/symbol.c
+0
-13
dbghelp.h
include/dbghelp.h
+13
-0
No files found.
dlls/dbghelp/dbghelp.spec
View file @
9c1b57c3
...
...
@@ -26,6 +26,7 @@
@ stub StackWalk64
@ stdcall StackWalk(long long long ptr ptr ptr ptr ptr ptr)
@ stdcall SymCleanup(long)
@ stdcall SymEnumLines(ptr double str str ptr ptr)
@ stdcall SymEnumSourceFiles(ptr double str ptr ptr)
@ stub SymEnumSym
@ stdcall SymEnumSymbols(ptr double str ptr ptr)
...
...
dlls/dbghelp/dbghelp_private.h
View file @
9c1b57c3
...
...
@@ -289,6 +289,19 @@ struct process
IMAGEHLP_STACK_FRAME
ctx_frame
;
};
struct
line_info
{
unsigned
long
is_first
:
1
,
is_last
:
1
,
is_source_file
:
1
,
line_number
;
union
{
unsigned
long
pc_offset
;
/* if is_source_file isn't set */
unsigned
source_file
;
/* if is_source_file is set */
}
u
;
};
/* dbghelp.c */
extern
struct
process
*
process_find_by_handle
(
HANDLE
hProcess
);
extern
HANDLE
hMsvcrt
;
...
...
dlls/dbghelp/source.c
View file @
9c1b57c3
...
...
@@ -26,6 +26,9 @@
#include "dbghelp_private.h"
#include "wine/debug.h"
#ifdef HAVE_REGEX_H
# include <regex.h>
#endif
WINE_DEFAULT_DEBUG_CHANNEL
(
dbghelp
);
...
...
@@ -136,3 +139,66 @@ BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, LPSTR Mask,
return
TRUE
;
}
/******************************************************************
* SymEnumLines (DBGHELP.@)
*
*/
BOOL
WINAPI
SymEnumLines
(
HANDLE
hProcess
,
ULONG64
base
,
PCSTR
compiland
,
PCSTR
srcfile
,
PSYM_ENUMLINES_CALLBACK
cb
,
PVOID
user
)
{
struct
process
*
pcs
;
struct
module
*
module
;
struct
hash_table_iter
hti
;
struct
symt_ht
*
sym
;
regex_t
re
;
struct
line_info
*
dli
;
void
*
ptr
;
SRCCODEINFO
sci
;
char
*
file
;
if
(
!
cb
)
return
FALSE
;
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pcs
)
return
FALSE
;
if
(
!
(
dbghelp_options
&
SYMOPT_LOAD_LINES
))
return
TRUE
;
if
(
regcomp
(
&
re
,
srcfile
,
REG_NOSUB
))
{
FIXME
(
"Couldn't compile %s
\n
"
,
srcfile
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
compiland
)
FIXME
(
"Unsupported yet (filtering on compiland %s)
\n
"
,
compiland
);
module
=
module_find_by_addr
(
pcs
,
base
,
DMT_UNKNOWN
);
if
(
!
(
module
=
module_get_debug
(
pcs
,
module
)))
return
FALSE
;
sci
.
SizeOfStruct
=
sizeof
(
sci
);
sci
.
ModBase
=
base
;
hash_table_iter_init
(
&
module
->
ht_symbols
,
&
hti
,
NULL
);
while
((
ptr
=
hash_table_iter_up
(
&
hti
)))
{
sym
=
GET_ENTRY
(
ptr
,
struct
symt_ht
,
hash_elt
);
if
(
sym
->
symt
.
tag
!=
SymTagFunction
)
continue
;
dli
=
NULL
;
sci
.
FileName
[
0
]
=
'\0'
;
while
((
dli
=
vector_iter_up
(
&
((
struct
symt_function
*
)
sym
)
->
vlines
,
dli
)))
{
if
(
dli
->
is_source_file
)
{
file
=
(
char
*
)
source_get
(
module
,
dli
->
u
.
source_file
);
if
(
regexec
(
&
re
,
file
,
0
,
NULL
,
0
)
!=
0
)
file
=
""
;
strcpy
(
sci
.
FileName
,
file
);
}
else
if
(
sci
.
FileName
[
0
])
{
sci
.
Key
=
dli
;
sci
.
Obj
[
0
]
=
'\0'
;
/* FIXME */
sci
.
LineNumber
=
dli
->
line_number
;
sci
.
Address
=
dli
->
u
.
pc_offset
;
if
(
!
cb
(
&
sci
,
user
))
break
;
}
}
}
return
TRUE
;
}
dlls/dbghelp/symbol.c
View file @
9c1b57c3
...
...
@@ -40,19 +40,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dbghelp
);
WINE_DECLARE_DEBUG_CHANNEL
(
dbghelp_symt
);
struct
line_info
{
unsigned
long
is_first
:
1
,
is_last
:
1
,
is_source_file
:
1
,
line_number
;
union
{
unsigned
long
pc_offset
;
/* if is_source_file isn't set */
unsigned
source_file
;
/* if is_source_file is set */
}
u
;
};
inline
static
int
cmp_addr
(
ULONG64
a1
,
ULONG64
a2
)
{
if
(
a1
>
a2
)
return
1
;
...
...
include/dbghelp.h
View file @
9c1b57c3
...
...
@@ -749,6 +749,19 @@ BOOL WINAPI SymEnumSourceFiles(HANDLE, ULONG64, LPSTR, PSYM_ENUMSOURCFILES_CALLB
BOOL
WINAPI
SymGetLineFromAddr
(
HANDLE
,
DWORD
,
PDWORD
,
PIMAGEHLP_LINE
);
BOOL
WINAPI
SymGetLinePrev
(
HANDLE
,
PIMAGEHLP_LINE
);
BOOL
WINAPI
SymGetLineNext
(
HANDLE
,
PIMAGEHLP_LINE
);
typedef
struct
_SRCCODEINFO
{
DWORD
SizeOfStruct
;
PVOID
Key
;
DWORD64
ModBase
;
char
Obj
[
MAX_PATH
+
1
];
char
FileName
[
MAX_PATH
+
1
];
DWORD
LineNumber
;
DWORD64
Address
;
}
SRCCODEINFO
,
*
PSRCCODEINFO
;
typedef
BOOL
(
CALLBACK
*
PSYM_ENUMLINES_CALLBACK
)(
PSRCCODEINFO
,
PVOID
);
BOOL
WINAPI
SymEnumLines
(
HANDLE
,
ULONG64
,
PCSTR
,
PCSTR
,
PSYM_ENUMLINES_CALLBACK
,
PVOID
);
/*************************
* File & image handling *
...
...
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