Commit b3c8d5d3 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use static debug info before initialization is done.

parent 890d1b81
......@@ -43,11 +43,18 @@ WINE_DECLARE_DEBUG_CHANNEL(timestamp);
static struct __wine_debug_functions default_funcs;
/* ---------------------------------------------------------------------- */
static BOOL init_done;
static struct debug_info initial_info; /* debug info for initial thread */
/* get the debug info pointer for the current thread */
static inline struct debug_info *get_info(void)
{
if (!init_done)
{
if (!initial_info.str_pos) initial_info.str_pos = initial_info.strings;
if (!initial_info.out_pos) initial_info.out_pos = initial_info.output;
return &initial_info;
}
return ntdll_get_thread_data()->debug_info;
}
......@@ -199,5 +206,9 @@ static const struct __wine_debug_functions funcs =
*/
void debug_init(void)
{
if (!initial_info.str_pos) initial_info.str_pos = initial_info.strings;
if (!initial_info.out_pos) initial_info.out_pos = initial_info.output;
ntdll_get_thread_data()->debug_info = &initial_info;
init_done = TRUE;
__wine_dbg_set_functions( &funcs, &default_funcs, sizeof(funcs) );
}
......@@ -163,7 +163,6 @@ void thread_init(void)
LARGE_INTEGER now;
NTSTATUS status;
struct ntdll_thread_data *thread_data;
static struct debug_info debug_info; /* debug info for initial thread */
virtual_init();
......@@ -231,13 +230,9 @@ void thread_init(void)
thread_data->reply_fd = -1;
thread_data->wait_fd[0] = -1;
thread_data->wait_fd[1] = -1;
thread_data->debug_info = &debug_info;
signal_init_thread( teb );
virtual_init_threading();
debug_info.str_pos = debug_info.strings;
debug_info.out_pos = debug_info.output;
debug_init();
/* setup the server connection */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment