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
f9e1943d
Commit
f9e1943d
authored
Jan 29, 2011
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Added support for variables with thread storage.
parent
935ac12d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
symbol.c
programs/winedbg/symbol.c
+46
-1
No files found.
programs/winedbg/symbol.c
View file @
f9e1943d
...
...
@@ -130,6 +130,50 @@ static BOOL fill_sym_lvalue(const SYMBOL_INFO* sym, ULONG_PTR base,
lvalue
->
cookie
=
DLV_TARGET
;
lvalue
->
addr
.
Offset
=
base
+
sym
->
Address
;
}
else
if
(
sym
->
Flags
&
SYMFLAG_TLSREL
)
{
PROCESS_BASIC_INFORMATION
pbi
;
THREAD_BASIC_INFORMATION
tbi
;
DWORD_PTR
addr
;
PEB
peb
;
PEB_LDR_DATA
ldr_data
;
PLIST_ENTRY
head
,
current
;
LDR_MODULE
ldr_module
;
unsigned
tlsindex
=
-
1
;
if
(
NtQueryInformationProcess
(
dbg_curr_process
->
handle
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
)
||
NtQueryInformationThread
(
dbg_curr_thread
->
handle
,
ThreadBasicInformation
,
&
tbi
,
sizeof
(
tbi
),
NULL
))
{
tls_error:
if
(
buffer
)
snprintf
(
buffer
,
sz
,
"Cannot read TLS address
\n
"
);
return
FALSE
;
}
addr
=
(
DWORD_PTR
)
&
(((
TEB
*
)
tbi
.
TebBaseAddress
)
->
ThreadLocalStoragePointer
);
if
(
!
dbg_read_memory
((
void
*
)
addr
,
&
addr
,
sizeof
(
addr
))
||
!
dbg_read_memory
(
pbi
.
PebBaseAddress
,
&
peb
,
sizeof
(
peb
))
||
!
dbg_read_memory
(
peb
.
LdrData
,
&
ldr_data
,
sizeof
(
ldr_data
)))
goto
tls_error
;
current
=
ldr_data
.
InLoadOrderModuleList
.
Flink
;
head
=
&
((
PEB_LDR_DATA
*
)
peb
.
LdrData
)
->
InLoadOrderModuleList
;
do
{
if
(
!
dbg_read_memory
(
CONTAINING_RECORD
(
current
,
LDR_MODULE
,
InLoadOrderModuleList
),
&
ldr_module
,
sizeof
(
ldr_module
)))
goto
tls_error
;
if
((
DWORD_PTR
)
ldr_module
.
BaseAddress
==
sym
->
ModBase
)
{
tlsindex
=
ldr_module
.
TlsIndex
;
break
;
}
current
=
ldr_module
.
InLoadOrderModuleList
.
Flink
;
}
while
(
current
!=
head
);
addr
+=
tlsindex
*
sizeof
(
DWORD_PTR
);
if
(
!
dbg_read_memory
((
void
*
)
addr
,
&
addr
,
sizeof
(
addr
)))
goto
tls_error
;
lvalue
->
cookie
=
DLV_TARGET
;
lvalue
->
addr
.
Offset
=
addr
+
sym
->
Address
;
}
else
{
lvalue
->
cookie
=
DLV_TARGET
;
...
...
@@ -177,10 +221,11 @@ static BOOL CALLBACK sgv_cb(PSYMBOL_INFO sym, ULONG size, PVOID ctx)
sgv
->
name
,
NUMDBGV
);
return
FALSE
;
}
WINE_TRACE
(
"==> %s %s%s%s%s%s%s%s
\n
"
,
WINE_TRACE
(
"==> %s %s%s%s%s%s%s%s
%s
\n
"
,
sym
->
Name
,
(
sym
->
Flags
&
SYMFLAG_FUNCTION
)
?
"func "
:
""
,
(
sym
->
Flags
&
SYMFLAG_FRAMEREL
)
?
"framerel "
:
""
,
(
sym
->
Flags
&
SYMFLAG_TLSREL
)
?
"tlsrel "
:
""
,
(
sym
->
Flags
&
SYMFLAG_REGISTER
)
?
"register "
:
""
,
(
sym
->
Flags
&
SYMFLAG_REGREL
)
?
"regrel "
:
""
,
(
sym
->
Flags
&
SYMFLAG_PARAMETER
)
?
"param "
:
""
,
...
...
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