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
9500df82
Commit
9500df82
authored
Dec 14, 2009
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Move the core of some line related functions to 64bit interface.
parent
776e75e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
73 deletions
+67
-73
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+2
-2
stabs.c
dlls/dbghelp/stabs.c
+1
-1
symbol.c
dlls/dbghelp/symbol.c
+64
-70
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
9500df82
...
...
@@ -589,8 +589,8 @@ extern struct symt_hierarchy_point*
const
char
*
name
);
extern
BOOL
symt_fill_func_line_info
(
const
struct
module
*
module
,
const
struct
symt_function
*
func
,
DWORD
addr
,
IMAGEHLP_LINE
*
line
);
extern
BOOL
symt_get_func_line_next
(
const
struct
module
*
module
,
PIMAGEHLP_LINE
line
);
DWORD
64
addr
,
IMAGEHLP_LINE64
*
line
);
extern
BOOL
symt_get_func_line_next
(
const
struct
module
*
module
,
PIMAGEHLP_LINE
64
line
);
extern
struct
symt_thunk
*
symt_new_thunk
(
struct
module
*
module
,
struct
symt_compiland
*
parent
,
...
...
dlls/dbghelp/stabs.c
View file @
9500df82
...
...
@@ -1235,7 +1235,7 @@ static void pending_flush(struct pending_list* pending, struct module* module,
static
void
stabs_finalize_function
(
struct
module
*
module
,
struct
symt_function
*
func
,
unsigned
long
size
)
{
IMAGEHLP_LINE
il
;
IMAGEHLP_LINE
64
il
;
struct
location
loc
;
if
(
!
func
)
return
;
...
...
dlls/dbghelp/symbol.c
View file @
9500df82
...
...
@@ -1486,7 +1486,7 @@ BOOL WINAPI SymGetSymFromName(HANDLE hProcess, PCSTR Name, PIMAGEHLP_SYMBOL Symb
* fills information about a file
*/
BOOL
symt_fill_func_line_info
(
const
struct
module
*
module
,
const
struct
symt_function
*
func
,
DWORD
addr
,
IMAGEHLP_LINE
*
line
)
DWORD
64
addr
,
IMAGEHLP_LINE64
*
line
)
{
struct
line_info
*
dli
=
NULL
;
BOOL
found
=
FALSE
;
...
...
@@ -1562,33 +1562,6 @@ BOOL WINAPI SymGetSymPrev(HANDLE hProcess, PIMAGEHLP_SYMBOL Symbol)
}
/******************************************************************
* SymGetLineFromAddr (DBGHELP.@)
*
*/
BOOL
WINAPI
SymGetLineFromAddr
(
HANDLE
hProcess
,
DWORD
dwAddr
,
PDWORD
pdwDisplacement
,
PIMAGEHLP_LINE
Line
)
{
struct
module_pair
pair
;
struct
symt_ht
*
symt
;
TRACE
(
"%p %08x %p %p
\n
"
,
hProcess
,
dwAddr
,
pdwDisplacement
,
Line
);
if
(
Line
->
SizeOfStruct
<
sizeof
(
*
Line
))
return
FALSE
;
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
dwAddr
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
((
symt
=
symt_find_nearest
(
pair
.
effective
,
dwAddr
))
==
NULL
)
return
FALSE
;
if
(
symt
->
symt
.
tag
!=
SymTagFunction
)
return
FALSE
;
if
(
!
symt_fill_func_line_info
(
pair
.
effective
,
(
struct
symt_function
*
)
symt
,
dwAddr
,
Line
))
return
FALSE
;
*
pdwDisplacement
=
dwAddr
-
Line
->
Address
;
return
TRUE
;
}
/******************************************************************
* copy_line_64_from_32 (internal)
*
*/
...
...
@@ -1605,16 +1578,16 @@ static void copy_line_64_from_32(IMAGEHLP_LINE64* l64, const IMAGEHLP_LINE* l32)
* copy_line_W64_from_32 (internal)
*
*/
static
void
copy_line_W64_from_
32
(
struct
process
*
pcs
,
IMAGEHLP_LINEW64
*
l64
,
const
IMAGEHLP_LINE
*
l32
)
static
void
copy_line_W64_from_
64
(
struct
process
*
pcs
,
IMAGEHLP_LINEW64
*
l64w
,
const
IMAGEHLP_LINE64
*
l64
)
{
unsigned
len
;
l64
->
Key
=
l32
->
Key
;
l64
->
LineNumber
=
l32
->
LineNumber
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
l
32
->
FileName
,
-
1
,
NULL
,
0
);
if
((
l64
->
FileName
=
fetch_buffer
(
pcs
,
len
*
sizeof
(
WCHAR
))))
MultiByteToWideChar
(
CP_ACP
,
0
,
l
32
->
FileName
,
-
1
,
l64
->
FileName
,
len
);
l64
->
Address
=
l32
->
Address
;
l64
w
->
Key
=
l64
->
Key
;
l64
w
->
LineNumber
=
l64
->
LineNumber
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
l
64
->
FileName
,
-
1
,
NULL
,
0
);
if
((
l64
w
->
FileName
=
fetch_buffer
(
pcs
,
len
*
sizeof
(
WCHAR
))))
MultiByteToWideChar
(
CP_ACP
,
0
,
l
64
->
FileName
,
-
1
,
l64w
->
FileName
,
len
);
l64
w
->
Address
=
l64
->
Address
;
}
/******************************************************************
...
...
@@ -1631,20 +1604,45 @@ static void copy_line_32_from_64(IMAGEHLP_LINE* l32, const IMAGEHLP_LINE64* l64)
}
/******************************************************************
* SymGetLineFromAddr (DBGHELP.@)
*
*/
BOOL
WINAPI
SymGetLineFromAddr
(
HANDLE
hProcess
,
DWORD
dwAddr
,
PDWORD
pdwDisplacement
,
PIMAGEHLP_LINE
Line
)
{
IMAGEHLP_LINE64
il64
;
il64
.
SizeOfStruct
=
sizeof
(
il64
);
if
(
!
SymGetLineFromAddr64
(
hProcess
,
dwAddr
,
pdwDisplacement
,
&
il64
))
return
FALSE
;
copy_line_32_from_64
(
Line
,
&
il64
);
return
TRUE
;
}
/******************************************************************
* SymGetLineFromAddr64 (DBGHELP.@)
*
*/
BOOL
WINAPI
SymGetLineFromAddr64
(
HANDLE
hProcess
,
DWORD64
dwAddr
,
PDWORD
pdwDisplacement
,
PIMAGEHLP_LINE64
Line
)
{
IMAGEHLP_LINE
line32
;
struct
module_pair
pair
;
struct
symt_ht
*
symt
;
TRACE
(
"%p %s %p %p
\n
"
,
hProcess
,
wine_dbgstr_longlong
(
dwAddr
),
pdwDisplacement
,
Line
);
if
(
Line
->
SizeOfStruct
<
sizeof
(
*
Line
))
return
FALSE
;
if
(
!
validate_addr64
(
dwAddr
))
return
FALSE
;
line32
.
SizeOfStruct
=
sizeof
(
line32
);
if
(
!
SymGetLineFromAddr
(
hProcess
,
(
DWORD
)
dwAddr
,
pdwDisplacement
,
&
line32
))
return
FALSE
;
copy_line_64_from_32
(
Line
,
&
line32
);
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
dwAddr
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
((
symt
=
symt_find_nearest
(
pair
.
effective
,
dwAddr
))
==
NULL
)
return
FALSE
;
if
(
symt
->
symt
.
tag
!=
SymTagFunction
)
return
FALSE
;
if
(
!
symt_fill_func_line_info
(
pair
.
effective
,
(
struct
symt_function
*
)
symt
,
dwAddr
,
Line
))
return
FALSE
;
*
pdwDisplacement
=
dwAddr
-
Line
->
Address
;
return
TRUE
;
}
...
...
@@ -1655,24 +1653,20 @@ BOOL WINAPI SymGetLineFromAddr64(HANDLE hProcess, DWORD64 dwAddr,
BOOL
WINAPI
SymGetLineFromAddrW64
(
HANDLE
hProcess
,
DWORD64
dwAddr
,
PDWORD
pdwDisplacement
,
PIMAGEHLP_LINEW64
Line
)
{
struct
process
*
pcs
=
process_find_by_handle
(
hProcess
);
IMAGEHLP_LINE
line32
;
IMAGEHLP_LINE64
il64
;
if
(
!
pcs
)
return
FALSE
;
if
(
Line
->
SizeOfStruct
<
sizeof
(
*
Line
))
return
FALSE
;
if
(
!
validate_addr64
(
dwAddr
))
return
FALSE
;
line32
.
SizeOfStruct
=
sizeof
(
line32
);
if
(
!
SymGetLineFromAddr
(
hProcess
,
(
DWORD
)
dwAddr
,
pdwDisplacement
,
&
line32
))
il64
.
SizeOfStruct
=
sizeof
(
il64
);
if
(
!
SymGetLineFromAddr64
(
hProcess
,
dwAddr
,
pdwDisplacement
,
&
il64
))
return
FALSE
;
copy_line_W64_from_
32
(
pcs
,
Line
,
&
line32
);
copy_line_W64_from_
64
(
process_find_by_handle
(
hProcess
),
Line
,
&
il64
);
return
TRUE
;
}
/******************************************************************
* SymGetLinePrev (DBGHELP.@)
* SymGetLinePrev
64
(DBGHELP.@)
*
*/
BOOL
WINAPI
SymGetLinePrev
(
HANDLE
hProcess
,
PIMAGEHLP_LINE
Line
)
BOOL
WINAPI
SymGetLinePrev
64
(
HANDLE
hProcess
,
PIMAGEHLP_LINE64
Line
)
{
struct
module_pair
pair
;
struct
line_info
*
li
;
...
...
@@ -1719,21 +1713,21 @@ BOOL WINAPI SymGetLinePrev(HANDLE hProcess, PIMAGEHLP_LINE Line)
}
/******************************************************************
* SymGetLinePrev
64
(DBGHELP.@)
* SymGetLinePrev (DBGHELP.@)
*
*/
BOOL
WINAPI
SymGetLinePrev
64
(
HANDLE
hProcess
,
PIMAGEHLP_LINE64
Line
)
BOOL
WINAPI
SymGetLinePrev
(
HANDLE
hProcess
,
PIMAGEHLP_LINE
Line
)
{
IMAGEHLP_LINE
line32
;
IMAGEHLP_LINE
64
line64
;
line
32
.
SizeOfStruct
=
sizeof
(
line32
);
copy_line_
32_from_64
(
&
line32
,
Line
);
if
(
!
SymGetLinePrev
(
hProcess
,
&
line32
))
return
FALSE
;
copy_line_
64_from_32
(
Line
,
&
line32
);
line
64
.
SizeOfStruct
=
sizeof
(
line64
);
copy_line_
64_from_32
(
&
line64
,
Line
);
if
(
!
SymGetLinePrev
64
(
hProcess
,
&
line64
))
return
FALSE
;
copy_line_
32_from_64
(
Line
,
&
line64
);
return
TRUE
;
}
BOOL
symt_get_func_line_next
(
const
struct
module
*
module
,
PIMAGEHLP_LINE
line
)
BOOL
symt_get_func_line_next
(
const
struct
module
*
module
,
PIMAGEHLP_LINE
64
line
)
{
struct
line_info
*
li
;
...
...
@@ -1755,10 +1749,10 @@ BOOL symt_get_func_line_next(const struct module* module, PIMAGEHLP_LINE line)
}
/******************************************************************
* SymGetLineNext (DBGHELP.@)
* SymGetLineNext
64
(DBGHELP.@)
*
*/
BOOL
WINAPI
SymGetLineNext
(
HANDLE
hProcess
,
PIMAGEHLP_LINE
Line
)
BOOL
WINAPI
SymGetLineNext
64
(
HANDLE
hProcess
,
PIMAGEHLP_LINE64
Line
)
{
struct
module_pair
pair
;
...
...
@@ -1776,20 +1770,20 @@ BOOL WINAPI SymGetLineNext(HANDLE hProcess, PIMAGEHLP_LINE Line)
}
/******************************************************************
* SymGetLineNext
64
(DBGHELP.@)
* SymGetLineNext (DBGHELP.@)
*
*/
BOOL
WINAPI
SymGetLineNext
64
(
HANDLE
hProcess
,
PIMAGEHLP_LINE64
Line
)
BOOL
WINAPI
SymGetLineNext
(
HANDLE
hProcess
,
PIMAGEHLP_LINE
Line
)
{
IMAGEHLP_LINE
line32
;
IMAGEHLP_LINE
64
line64
;
line
32
.
SizeOfStruct
=
sizeof
(
line32
);
copy_line_
32_from_64
(
&
line32
,
Line
);
if
(
!
SymGetLineNext
(
hProcess
,
&
line32
))
return
FALSE
;
copy_line_
64_from_32
(
Line
,
&
line32
);
line
64
.
SizeOfStruct
=
sizeof
(
line64
);
copy_line_
64_from_32
(
&
line64
,
Line
);
if
(
!
SymGetLineNext
64
(
hProcess
,
&
line64
))
return
FALSE
;
copy_line_
32_from_64
(
Line
,
&
line64
);
return
TRUE
;
}
/***********************************************************************
* SymFunctionTableAccess (DBGHELP.@)
*/
...
...
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