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
099a8bbf
Commit
099a8bbf
authored
Oct 13, 2021
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Add helper to initialize a module_pair.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eded75f8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
49 deletions
+20
-49
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+2
-0
dwarf.c
dlls/dbghelp/dwarf.c
+1
-4
module.c
dlls/dbghelp/module.c
+7
-0
msc.c
dlls/dbghelp/msc.c
+1
-4
symbol.c
dlls/dbghelp/symbol.c
+6
-24
type.c
dlls/dbghelp/type.c
+3
-17
No files found.
dlls/dbghelp/dbghelp_private.h
View file @
099a8bbf
...
...
@@ -629,6 +629,8 @@ extern const WCHAR S_WineLoaderW[] DECLSPEC_HIDDEN;
extern
const
WCHAR
S_SlashW
[]
DECLSPEC_HIDDEN
;
extern
const
struct
loader_ops
no_loader_ops
DECLSPEC_HIDDEN
;
extern
BOOL
module_init_pair
(
struct
module_pair
*
pair
,
HANDLE
hProcess
,
DWORD64
addr
)
DECLSPEC_HIDDEN
;
extern
struct
module
*
module_find_by_addr
(
const
struct
process
*
pcs
,
DWORD64
addr
,
enum
module_type
type
)
DECLSPEC_HIDDEN
;
...
...
dlls/dbghelp/dwarf.c
View file @
099a8bbf
...
...
@@ -3652,10 +3652,7 @@ BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, ULONG_PTR ip,
struct
module_pair
pair
;
struct
frame_info
info
;
if
(
!
(
pair
.
pcs
=
process_find_by_handle
(
csw
->
hProcess
))
||
!
(
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
ip
,
DMT_UNKNOWN
))
||
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
(
!
module_init_pair
(
&
pair
,
csw
->
hProcess
,
ip
))
return
FALSE
;
if
(
!
dwarf2_fetch_frame_info
(
pair
.
effective
,
csw
->
cpu
,
ip
,
&
info
))
return
FALSE
;
/* if at very beginning of function, return and use default unwinder */
...
...
dlls/dbghelp/module.c
View file @
099a8bbf
...
...
@@ -262,6 +262,13 @@ struct module* module_new(struct process* pcs, const WCHAR* name,
return
module
;
}
BOOL
module_init_pair
(
struct
module_pair
*
pair
,
HANDLE
hProcess
,
DWORD64
addr
)
{
if
(
!
(
pair
->
pcs
=
process_find_by_handle
(
hProcess
)))
return
FALSE
;
pair
->
requested
=
module_find_by_addr
(
pair
->
pcs
,
addr
,
DMT_UNKNOWN
);
return
module_get_debug
(
pair
);
}
/***********************************************************************
* module_find_by_nameW
*
...
...
dlls/dbghelp/msc.c
View file @
099a8bbf
...
...
@@ -3199,10 +3199,7 @@ BOOL pdb_virtual_unwind(struct cpu_stack_walk *csw, DWORD_PTR ip,
char
*
strbase
;
BOOL
ret
=
TRUE
;
if
(
!
(
pair
.
pcs
=
process_find_by_handle
(
csw
->
hProcess
))
||
!
(
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
ip
,
DMT_UNKNOWN
))
||
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
(
!
module_init_pair
(
&
pair
,
csw
->
hProcess
,
ip
))
return
FALSE
;
if
(
!
pair
.
effective
->
format_info
[
DFI_PDB
])
return
FALSE
;
pdb_info
=
pair
.
effective
->
format_info
[
DFI_PDB
]
->
u
.
pdb_info
;
TRACE
(
"searching %lx => %lx
\n
"
,
ip
,
ip
-
(
DWORD_PTR
)
pair
.
effective
->
module
.
BaseOfImage
);
...
...
dlls/dbghelp/symbol.c
View file @
099a8bbf
...
...
@@ -1363,10 +1363,7 @@ BOOL WINAPI SymFromAddr(HANDLE hProcess, DWORD64 Address,
struct
module_pair
pair
;
struct
symt_ht
*
sym
;
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
Address
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
(
!
module_init_pair
(
&
pair
,
hProcess
,
Address
))
return
FALSE
;
if
((
sym
=
symt_find_nearest
(
pair
.
effective
,
Address
))
==
NULL
)
return
FALSE
;
symt_fill_sym_info
(
&
pair
,
NULL
,
&
sym
->
symt
,
Symbol
);
...
...
@@ -1717,10 +1714,7 @@ static BOOL get_line_from_addr(HANDLE hProcess, DWORD64 addr,
struct
symt_ht
*
symt
;
struct
symt_function
*
func
;
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
addr
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
(
!
module_init_pair
(
&
pair
,
hProcess
,
addr
))
return
FALSE
;
if
((
symt
=
symt_find_nearest
(
pair
.
effective
,
addr
))
==
NULL
)
return
FALSE
;
if
(
symt
->
symt
.
tag
!=
SymTagFunction
)
return
FALSE
;
...
...
@@ -1862,10 +1856,7 @@ static BOOL symt_get_func_line_prev(HANDLE hProcess, struct internal_line_t* int
struct
line_info
*
li
;
struct
line_info
*
srcli
;
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
addr
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
(
!
module_init_pair
(
&
pair
,
hProcess
,
addr
))
return
FALSE
;
if
(
key
==
NULL
)
return
FALSE
;
...
...
@@ -1944,10 +1935,7 @@ static BOOL symt_get_func_line_next(HANDLE hProcess, struct internal_line_t* int
struct
line_info
*
srcli
;
if
(
key
==
NULL
)
return
FALSE
;
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
addr
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
(
!
module_init_pair
(
&
pair
,
hProcess
,
addr
))
return
FALSE
;
/* search current source file */
for
(
srcli
=
key
;
!
srcli
->
is_source_file
;
srcli
--
);
...
...
@@ -2344,10 +2332,7 @@ BOOL WINAPI SymAddSymbol(HANDLE hProcess, ULONG64 BaseOfDll, PCSTR name,
TRACE
(
"(%p %s %s %u)
\n
"
,
hProcess
,
wine_dbgstr_a
(
name
),
wine_dbgstr_longlong
(
addr
),
size
);
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
BaseOfDll
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
(
!
module_init_pair
(
&
pair
,
hProcess
,
BaseOfDll
))
return
FALSE
;
return
symt_new_custom
(
pair
.
effective
,
name
,
addr
,
size
)
!=
NULL
;
}
...
...
@@ -2400,11 +2385,8 @@ BOOL WINAPI SymEnumLines(HANDLE hProcess, ULONG64 base, PCSTR compiland,
if
(
!
cb
)
return
FALSE
;
if
(
!
(
dbghelp_options
&
SYMOPT_LOAD_LINES
))
return
TRUE
;
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
if
(
!
module_init_pair
(
&
pair
,
hProcess
,
base
))
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
(
!
(
srcmask
=
file_regex
(
srcfile
)))
return
FALSE
;
sci
.
SizeOfStruct
=
sizeof
(
sci
);
...
...
dlls/dbghelp/type.c
View file @
099a8bbf
...
...
@@ -483,9 +483,7 @@ BOOL WINAPI SymEnumTypes(HANDLE hProcess, ULONG64 BaseOfDll,
hProcess
,
wine_dbgstr_longlong
(
BaseOfDll
),
EnumSymbolsCallback
,
UserContext
);
if
(
!
(
pair
.
pcs
=
process_find_by_handle
(
hProcess
)))
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
BaseOfDll
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
(
!
module_init_pair
(
&
pair
,
hProcess
,
BaseOfDll
))
return
FALSE
;
sym_info
->
SizeOfStruct
=
sizeof
(
SYMBOL_INFO
);
sym_info
->
MaxNameLen
=
sizeof
(
buffer
)
-
sizeof
(
SYMBOL_INFO
);
...
...
@@ -1007,16 +1005,7 @@ BOOL WINAPI SymGetTypeInfo(HANDLE hProcess, DWORD64 ModBase,
{
struct
module_pair
pair
;
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
ModBase
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
{
FIXME
(
"Someone didn't properly set ModBase (%s)
\n
"
,
wine_dbgstr_longlong
(
ModBase
));
return
FALSE
;
}
if
(
!
module_init_pair
(
&
pair
,
hProcess
,
ModBase
))
return
FALSE
;
return
symt_get_info
(
pair
.
effective
,
symt_index2ptr
(
pair
.
effective
,
TypeId
),
GetType
,
pInfo
);
}
...
...
@@ -1031,10 +1020,7 @@ BOOL WINAPI SymGetTypeFromName(HANDLE hProcess, ULONG64 BaseOfDll,
struct
symt
*
type
;
DWORD64
size
;
pair
.
pcs
=
process_find_by_handle
(
hProcess
);
if
(
!
pair
.
pcs
)
return
FALSE
;
pair
.
requested
=
module_find_by_addr
(
pair
.
pcs
,
BaseOfDll
,
DMT_UNKNOWN
);
if
(
!
module_get_debug
(
&
pair
))
return
FALSE
;
if
(
!
module_init_pair
(
&
pair
,
hProcess
,
BaseOfDll
))
return
FALSE
;
type
=
symt_find_type_by_name
(
pair
.
effective
,
SymTagNull
,
Name
);
if
(
!
type
)
return
FALSE
;
Symbol
->
Index
=
Symbol
->
TypeIndex
=
symt_ptr2index
(
pair
.
effective
,
type
);
...
...
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