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
418a001e
Commit
418a001e
authored
Sep 06, 2008
by
Eric Pouech
Committed by
Alexandre Julliard
Sep 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Correctly setup the Unix regular expression for matching file names in SymEnumLines.
Plug a potential memory leak as well.
parent
b5ffe31d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
6 deletions
+52
-6
source.c
dlls/dbghelp/source.c
+52
-6
No files found.
dlls/dbghelp/source.c
View file @
418a001e
...
...
@@ -154,6 +154,55 @@ BOOL WINAPI SymEnumSourceFiles(HANDLE hProcess, ULONG64 ModBase, PCSTR Mask,
return
TRUE
;
}
static
inline
void
re_append
(
char
**
mask
,
unsigned
*
len
,
char
ch
)
{
*
mask
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
*
mask
,
++
(
*
len
));
(
*
mask
)[
*
len
-
2
]
=
ch
;
}
static
BOOL
compile_regex
(
regex_t
*
re
,
const
char
*
srcfile
)
{
char
*
mask
;
unsigned
len
=
1
;
mask
=
HeapAlloc
(
GetProcessHeap
(),
0
,
1
);
re_append
(
&
mask
,
&
len
,
'^'
);
if
(
!
srcfile
||
!*
srcfile
)
re_append
(
&
mask
,
&
len
,
'*'
);
else
while
(
*
srcfile
)
{
switch
(
*
srcfile
)
{
case
'\\'
:
case
'/'
:
re_append
(
&
mask
,
&
len
,
'['
);
re_append
(
&
mask
,
&
len
,
'\\'
);
re_append
(
&
mask
,
&
len
,
'\\'
);
re_append
(
&
mask
,
&
len
,
'/'
);
re_append
(
&
mask
,
&
len
,
']'
);
break
;
case
'.'
:
re_append
(
&
mask
,
&
len
,
'\\'
);
re_append
(
&
mask
,
&
len
,
'.'
);
break
;
default:
re_append
(
&
mask
,
&
len
,
*
srcfile
);
break
;
}
srcfile
++
;
}
re_append
(
&
mask
,
&
len
,
'$'
);
mask
[
len
-
1
]
=
'\0'
;
len
=
regcomp
(
re
,
mask
,
REG_NOSUB
);
HeapFree
(
GetProcessHeap
(),
0
,
mask
);
if
(
len
)
{
FIXME
(
"Couldn't compile %s
\n
"
,
mask
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
return
TRUE
;
}
/******************************************************************
* SymEnumLines (DBGHELP.@)
*
...
...
@@ -172,17 +221,13 @@ BOOL WINAPI SymEnumLines(HANDLE hProcess, ULONG64 base, PCSTR compiland,
if
(
!
cb
)
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
;
}
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
if
(
compiland
)
FIXME
(
"Unsupported yet (filtering on compiland %s)
\n
"
,
compiland
);
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
base
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
(
!
compile_regex
(
&
re
,
srcfile
))
return
FALSE
;
sci
.
SizeOfStruct
=
sizeof
(
sci
);
sci
.
ModBase
=
base
;
...
...
@@ -215,6 +260,7 @@ BOOL WINAPI SymEnumLines(HANDLE hProcess, ULONG64 base, PCSTR compiland,
}
}
}
regfree
(
&
re
);
return
TRUE
;
}
...
...
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