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
2084fbd9
Commit
2084fbd9
authored
Jun 15, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Store the debug info in the TEB block after the 32-bit TEB.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
588d91ae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
+17
-16
debug.c
dlls/ntdll/unix/debug.c
+15
-2
thread.c
dlls/ntdll/unix/thread.c
+0
-3
unix_private.h
dlls/ntdll/unix/unix_private.h
+2
-11
No files found.
dlls/ntdll/unix/debug.c
View file @
2084fbd9
...
...
@@ -43,6 +43,16 @@
WINE_DECLARE_DEBUG_CHANNEL
(
pid
);
WINE_DECLARE_DEBUG_CHANNEL
(
timestamp
);
struct
debug_info
{
unsigned
int
str_pos
;
/* current position in strings buffer */
unsigned
int
out_pos
;
/* current position in output buffer */
char
strings
[
1020
];
/* buffer for temporary strings */
char
output
[
1020
];
/* current output line */
};
C_ASSERT
(
sizeof
(
struct
debug_info
)
==
0x800
);
static
BOOL
init_done
;
static
struct
debug_info
initial_info
;
/* debug info for initial thread */
static
unsigned
char
default_flags
=
(
1
<<
__WINE_DBCL_ERR
)
|
(
1
<<
__WINE_DBCL_FIXME
);
...
...
@@ -56,7 +66,11 @@ static const char * const debug_classes[] = { "fixme", "err", "warn", "trace" };
static
inline
struct
debug_info
*
get_info
(
void
)
{
if
(
!
init_done
)
return
&
initial_info
;
return
ntdll_get_thread_data
()
->
debug_info
;
#ifdef _WIN64
return
(
struct
debug_info
*
)((
TEB32
*
)((
char
*
)
NtCurrentTeb
()
+
teb_offset
)
+
1
);
#else
return
(
struct
debug_info
*
)(
NtCurrentTeb
()
+
1
);
#endif
}
/* add a string to the output buffer */
...
...
@@ -304,6 +318,5 @@ void dbg_init(void)
free
(
debug_options
);
debug_options
=
options
;
options
[
nb_debug_options
]
=
default_option
;
ntdll_get_thread_data
()
->
debug_info
=
(
struct
debug_info
*
)(
options
+
nb_debug_options
+
1
);
init_done
=
TRUE
;
}
dlls/ntdll/unix/thread.c
View file @
2084fbd9
...
...
@@ -731,11 +731,8 @@ static void pthread_exit_wrapper( int status )
static
void
start_thread
(
TEB
*
teb
)
{
struct
ntdll_thread_data
*
thread_data
=
(
struct
ntdll_thread_data
*
)
&
teb
->
GdiTebBatch
;
struct
debug_info
debug_info
;
BOOL
suspend
;
debug_info
.
str_pos
=
debug_info
.
out_pos
=
0
;
thread_data
->
debug_info
=
&
debug_info
;
thread_data
->
pthread_id
=
pthread_self
();
signal_init_thread
(
teb
);
server_init_thread
(
thread_data
->
start
,
&
suspend
);
...
...
dlls/ntdll/unix/unix_private.h
View file @
2084fbd9
...
...
@@ -47,19 +47,10 @@ static inline BOOL is_machine_64bit( WORD machine )
return
(
machine
==
IMAGE_FILE_MACHINE_AMD64
||
machine
==
IMAGE_FILE_MACHINE_ARM64
);
}
struct
debug_info
{
unsigned
int
str_pos
;
/* current position in strings buffer */
unsigned
int
out_pos
;
/* current position in output buffer */
char
strings
[
1024
];
/* buffer for temporary strings */
char
output
[
1024
];
/* current output line */
};
/* thread private data, stored in NtCurrentTeb()->GdiTebBatch */
struct
ntdll_thread_data
{
void
*
cpu_data
[
16
];
/* reserved for CPU-specific data */
struct
debug_info
*
debug_info
;
/* info for debugstr functions */
void
*
kernel_stack
;
/* stack for thread startup and kernel syscalls */
int
request_fd
;
/* fd for sending server requests */
int
reply_fd
;
/* fd for receiving server replies */
...
...
@@ -88,9 +79,9 @@ struct async_fileio
};
static
const
SIZE_T
page_size
=
0x1000
;
static
const
SIZE_T
teb_size
=
0x3
000
;
/* TEB64 + TEB32
*/
static
const
SIZE_T
teb_size
=
0x3
800
;
/* TEB64 + TEB32 + debug info
*/
static
const
SIZE_T
signal_stack_mask
=
0xffff
;
static
const
SIZE_T
signal_stack_size
=
0x10000
-
0x3
0
00
;
static
const
SIZE_T
signal_stack_size
=
0x10000
-
0x3
8
00
;
static
const
SIZE_T
kernel_stack_size
=
0x20000
;
static
const
LONG
teb_offset
=
0x2000
;
...
...
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