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
93a9d854
Commit
93a9d854
authored
Apr 03, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecrt0: Add a fallback implementation of __wine_dbg_header().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b0ecbe0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
1 deletion
+44
-1
debug.c
dlls/winecrt0/debug.c
+44
-1
No files found.
dlls/winecrt0/debug.c
View file @
93a9d854
...
...
@@ -29,9 +29,15 @@
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DECLARE_DEBUG_CHANNEL
(
pid
);
WINE_DECLARE_DEBUG_CHANNEL
(
timestamp
);
static
const
char
*
(
__cdecl
*
p__wine_dbg_strdup
)(
const
char
*
str
);
static
int
(
__cdecl
*
p__wine_dbg_output
)(
const
char
*
str
);
static
unsigned
char
(
__cdecl
*
p__wine_dbg_get_channel_flags
)(
struct
__wine_debug_channel
*
channel
);
static
int
(
__cdecl
*
p__wine_dbg_header
)(
enum
__wine_debug_class
cls
,
struct
__wine_debug_channel
*
channel
,
const
char
*
function
);
static
const
char
*
const
debug_classes
[]
=
{
"fixme"
,
"err"
,
"warn"
,
"trace"
};
...
...
@@ -39,6 +45,7 @@ static unsigned char default_flags = (1 << __WINE_DBCL_ERR) | (1 << __WINE_DBCL_
static
int
nb_debug_options
=
-
1
;
static
int
options_size
;
static
struct
__wine_debug_channel
*
debug_options
;
static
DWORD
partial_line_tid
;
/* id of the last thread to output a partial line */
static
void
load_func
(
void
**
func
,
const
char
*
name
,
void
*
def
)
{
...
...
@@ -163,7 +170,36 @@ static const char * __cdecl fallback__wine_dbg_strdup( const char *str )
static
int
__cdecl
fallback__wine_dbg_output
(
const
char
*
str
)
{
return
fwrite
(
str
,
1
,
strlen
(
str
),
stderr
);
size_t
len
=
strlen
(
str
);
if
(
!
len
)
return
0
;
interlocked_xchg
(
(
LONG
*
)
&
partial_line_tid
,
str
[
len
-
1
]
!=
'\n'
?
GetCurrentThreadId
()
:
0
);
return
fwrite
(
str
,
1
,
len
,
stderr
);
}
static
int
__cdecl
fallback__wine_dbg_header
(
enum
__wine_debug_class
cls
,
struct
__wine_debug_channel
*
channel
,
const
char
*
function
)
{
char
buffer
[
200
],
*
pos
=
buffer
;
if
(
!
(
__wine_dbg_get_channel_flags
(
channel
)
&
(
1
<<
cls
)))
return
-
1
;
/* skip header if partial line and no other thread came in between */
if
(
partial_line_tid
==
GetCurrentThreadId
())
return
0
;
if
(
TRACE_ON
(
timestamp
))
{
ULONG
ticks
=
GetTickCount
();
pos
+=
sprintf
(
pos
,
"%3u.%03u:"
,
ticks
/
1000
,
ticks
%
1000
);
}
if
(
TRACE_ON
(
pid
))
pos
+=
sprintf
(
pos
,
"%04x:"
,
GetCurrentProcessId
()
);
pos
+=
sprintf
(
pos
,
"%04x:"
,
GetCurrentThreadId
()
);
if
(
function
&&
cls
<
ARRAY_SIZE
(
debug_classes
))
snprintf
(
pos
,
sizeof
(
buffer
)
-
(
pos
-
buffer
),
"%s:%s:%s "
,
debug_classes
[
cls
],
channel
->
name
,
function
);
return
fwrite
(
buffer
,
1
,
strlen
(
buffer
),
stderr
);
}
static
unsigned
char
__cdecl
fallback__wine_dbg_get_channel_flags
(
struct
__wine_debug_channel
*
channel
)
...
...
@@ -205,4 +241,11 @@ unsigned char __cdecl __wine_dbg_get_channel_flags( struct __wine_debug_channel
return
p__wine_dbg_get_channel_flags
(
channel
);
}
int
__cdecl
__wine_dbg_header
(
enum
__wine_debug_class
cls
,
struct
__wine_debug_channel
*
channel
,
const
char
*
function
)
{
LOAD_FUNC
(
__wine_dbg_header
);
return
p__wine_dbg_header
(
cls
,
channel
,
function
);
}
#endif
/* _WIN32 */
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