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
7aa67c1d
Commit
7aa67c1d
authored
Jan 21, 2002
by
Francois Gouget
Committed by
Alexandre Julliard
Jan 21, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the Wine trace facilities accessible from Winelib applications.
parent
5f30ee06
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
107 additions
and
60 deletions
+107
-60
debugtools.c
dlls/ntdll/debugtools.c
+3
-3
pidl.c
dlls/shell32/pidl.c
+6
-6
shellord.c
dlls/shell32/shellord.c
+4
-4
debugtools.h
include/debugtools.h
+90
-43
options.c
misc/options.c
+4
-4
No files found.
dlls/ntdll/debugtools.c
View file @
7aa67c1d
...
...
@@ -296,17 +296,17 @@ int wine_dbg_printf(const char *format, ...)
/***********************************************************************
* wine_dbg_log (NTDLL.@)
*/
int
wine_dbg_log
(
enum
__DEBUG_CLASS
cls
,
const
char
*
channel
,
int
wine_dbg_log
(
enum
__
WINE_
DEBUG_CLASS
cls
,
const
char
*
channel
,
const
char
*
function
,
const
char
*
format
,
...
)
{
static
const
char
*
classes
[
__DBCL_COUNT
]
=
{
"fixme"
,
"err"
,
"warn"
,
"trace"
};
static
const
char
*
classes
[
__
WINE_
DBCL_COUNT
]
=
{
"fixme"
,
"err"
,
"warn"
,
"trace"
};
va_list
valist
;
int
ret
=
0
;
va_start
(
valist
,
format
);
if
(
TRACE_ON
(
tid
))
ret
=
wine_dbg_printf
(
"%08lx:"
,
(
DWORD
)
NtCurrentTeb
()
->
tid
);
if
(
cls
<
__DBCL_COUNT
)
if
(
cls
<
__
WINE_
DBCL_COUNT
)
ret
+=
wine_dbg_printf
(
"%s:%s:%s "
,
classes
[
cls
],
channel
+
1
,
function
);
if
(
format
)
ret
+=
wine_dbg_vprintf
(
format
,
valist
);
...
...
dlls/shell32/pidl.c
View file @
7aa67c1d
...
...
@@ -37,8 +37,8 @@ void pdump (LPCITEMIDLIST pidl)
/* silence the sub-functions */
bIsShellDebug
=
TRACE_ON
(
shell
);
__
SET_DEBUGGING
(
_
_DBCL_TRACE
,
__wine_dbch_shell
,
FALSE
);
__
SET_DEBUGGING
(
_
_DBCL_TRACE
,
__wine_dbch_pidl
,
FALSE
);
__
WINE_SET_DEBUGGING
(
__WINE
_DBCL_TRACE
,
__wine_dbch_shell
,
FALSE
);
__
WINE_SET_DEBUGGING
(
__WINE
_DBCL_TRACE
,
__wine_dbch_pidl
,
FALSE
);
if
(
!
pidltemp
)
{
...
...
@@ -78,8 +78,8 @@ void pdump (LPCITEMIDLIST pidl)
pcheck
(
pidl
);
}
__
SET_DEBUGGING
(
_
_DBCL_TRACE
,
__wine_dbch_shell
,
bIsShellDebug
);
__
SET_DEBUGGING
(
_
_DBCL_TRACE
,
__wine_dbch_pidl
,
TRUE
);
__
WINE_SET_DEBUGGING
(
__WINE
_DBCL_TRACE
,
__wine_dbch_shell
,
bIsShellDebug
);
__
WINE_SET_DEBUGGING
(
__WINE
_DBCL_TRACE
,
__wine_dbch_pidl
,
TRUE
);
}
#define BYTES_PRINTED 32
...
...
@@ -90,7 +90,7 @@ BOOL pcheck (LPCITEMIDLIST pidl)
LPITEMIDLIST
pidltemp
=
pidl
;
bIsPidlDebug
=
TRACE_ON
(
shell
);
__
SET_DEBUGGING
(
_
_DBCL_TRACE
,
__wine_dbch_pidl
,
FALSE
);
__
WINE_SET_DEBUGGING
(
__WINE
_DBCL_TRACE
,
__wine_dbch_pidl
,
FALSE
);
if
(
pidltemp
&&
pidltemp
->
mkid
.
cb
)
{
do
...
...
@@ -137,7 +137,7 @@ BOOL pcheck (LPCITEMIDLIST pidl)
pidltemp
=
ILGetNext
(
pidltemp
);
}
while
(
pidltemp
->
mkid
.
cb
);
}
__
SET_DEBUGGING
(
_
_DBCL_TRACE
,
__wine_dbch_pidl
,
bIsPidlDebug
);
__
WINE_SET_DEBUGGING
(
__WINE
_DBCL_TRACE
,
__wine_dbch_pidl
,
bIsPidlDebug
);
return
ret
;
}
...
...
dlls/shell32/shellord.c
View file @
7aa67c1d
...
...
@@ -1476,14 +1476,14 @@ HRESULT WINAPI CIDLData_CreateFromIDArray(
TRACE
(
"(%p, %ld, %p, %p)
\n
"
,
pidlFolder
,
cpidlFiles
,
lppidlFiles
,
ppdataObject
);
boldpidl
=
TRACE_ON
(
pidl
);
__
SET_DEBUGGING
(
_
_DBCL_TRACE
,
__wine_dbch_shell
,
FALSE
);
__
SET_DEBUGGING
(
_
_DBCL_TRACE
,
__wine_dbch_pidl
,
TRUE
);
__
WINE_SET_DEBUGGING
(
__WINE
_DBCL_TRACE
,
__wine_dbch_shell
,
FALSE
);
__
WINE_SET_DEBUGGING
(
__WINE
_DBCL_TRACE
,
__wine_dbch_pidl
,
TRUE
);
pdump
(
pidlFolder
);
for
(
i
=
0
;
i
<
cpidlFiles
;
i
++
){
pdump
(
lppidlFiles
[
i
]);
}
__
SET_DEBUGGING
(
_
_DBCL_TRACE
,
__wine_dbch_shell
,
TRUE
);
__
SET_DEBUGGING
(
_
_DBCL_TRACE
,
__wine_dbch_pidl
,
boldpidl
);
__
WINE_SET_DEBUGGING
(
__WINE
_DBCL_TRACE
,
__wine_dbch_shell
,
TRUE
);
__
WINE_SET_DEBUGGING
(
__WINE
_DBCL_TRACE
,
__wine_dbch_pidl
,
boldpidl
);
}
*
ppdataObject
=
IDataObject_Constructor
(
hwnd
,
pidlFolder
,
lppidlFiles
,
cpidlFiles
);
...
...
include/debugtools.h
View file @
7aa67c1d
...
...
@@ -2,63 +2,77 @@
#ifndef __WINE_DEBUGTOOLS_H
#define __WINE_DEBUGTOOLS_H
#ifdef __WINE__
/* Debugging interface is internal to Wine */
#include <stdarg.h>
#include "windef.h"
#ifdef __cplusplus
extern
"C"
{
#endif
struct
_GUID
;
/* Internal definitions (do not use these directly) */
/*
* Internal definitions (do not use these directly)
*/
enum
__DEBUG_CLASS
{
__DBCL_FIXME
,
__DBCL_ERR
,
__DBCL_WARN
,
__DBCL_TRACE
,
__DBCL_COUNT
};
enum
__WINE_DEBUG_CLASS
{
__WINE_DBCL_FIXME
,
__WINE_DBCL_ERR
,
__WINE_DBCL_WARN
,
__WINE_DBCL_TRACE
,
__WINE_DBCL_COUNT
};
#ifndef NO_TRACE_MSGS
# define __
GET_DEBUGGING_TRACE(dbch) ((dbch)[0] & (1 << _
_DBCL_TRACE))
# define __
WINE_GET_DEBUGGING_TRACE(dbch) ((dbch)[0] & (1 << __WINE
_DBCL_TRACE))
#else
# define __GET_DEBUGGING_TRACE(dbch) 0
# define __
WINE_
GET_DEBUGGING_TRACE(dbch) 0
#endif
#ifndef NO_DEBUG_MSGS
# define __
GET_DEBUGGING_WARN(dbch) ((dbch)[0] & (1 << _
_DBCL_WARN))
# define __
GET_DEBUGGING_FIXME(dbch) ((dbch)[0] & (1 << _
_DBCL_FIXME))
# define __
WINE_GET_DEBUGGING_WARN(dbch) ((dbch)[0] & (1 << __WINE
_DBCL_WARN))
# define __
WINE_GET_DEBUGGING_FIXME(dbch) ((dbch)[0] & (1 << __WINE
_DBCL_FIXME))
#else
# define __GET_DEBUGGING_WARN(dbch) 0
# define __GET_DEBUGGING_FIXME(dbch) 0
# define __
WINE_
GET_DEBUGGING_WARN(dbch) 0
# define __
WINE_
GET_DEBUGGING_FIXME(dbch) 0
#endif
/* define error macro regardless of what is configured */
#define __
GET_DEBUGGING_ERR(dbch) ((dbch)[0] & (1 << _
_DBCL_ERR))
#define __
WINE_GET_DEBUGGING_ERR(dbch) ((dbch)[0] & (1 << __WINE
_DBCL_ERR))
#define __
GET_DEBUGGING(dbcl,dbch) _
_GET_DEBUGGING##dbcl(dbch)
#define __SET_DEBUGGING(dbcl,dbch,on) \
#define __
WINE_GET_DEBUGGING(dbcl,dbch) __WINE
_GET_DEBUGGING##dbcl(dbch)
#define __
WINE_
SET_DEBUGGING(dbcl,dbch,on) \
((on) ? ((dbch)[0] |= 1 << (dbcl)) : ((dbch)[0] &= ~(1 << (dbcl))))
#ifdef __GNUC__
#define __DPRINTF(dbcl,dbch) \
do { if(__GET_DEBUGGING(dbcl,(dbch))) { \
#define __
WINE_
DPRINTF(dbcl,dbch) \
do { if(__
WINE_
GET_DEBUGGING(dbcl,(dbch))) { \
const char * const __dbch = (dbch); \
const enum __
DEBUG_CLASS __dbcl = _
_DBCL##dbcl; \
const enum __
WINE_DEBUG_CLASS __dbcl = __WINE
_DBCL##dbcl; \
__WINE_DBG_LOG
#define __WINE_DBG_LOG(args...) \
wine_dbg_log( __dbcl, __dbch, __FUNCTION__, args); } } while(0)
#define __PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
#define __
WINE_
PRINTF_ATTR(fmt,args) __attribute__((format (printf,fmt,args)))
#else
/* __GNUC__ */
#define __DPRINTF(dbcl,dbch) \
(!__GET_DEBUGGING(dbcl,(dbch)) || \
(wine_dbg_log(__DBCL##dbcl,(dbch),__FILE__,"%d: ",__LINE__),0)) ? \
#define __
WINE_
DPRINTF(dbcl,dbch) \
(!__
WINE_
GET_DEBUGGING(dbcl,(dbch)) || \
(wine_dbg_log(__
WINE_
DBCL##dbcl,(dbch),__FILE__,"%d: ",__LINE__),0)) ? \
(void)0 : (void)wine_dbg_printf
#define __PRINTF_ATTR(fmt, args)
#define __
WINE_
PRINTF_ATTR(fmt, args)
#endif
/* __GNUC__ */
/* Exported definitions and macros */
/*
* Exported definitions and macros
*/
/* These function return a printable version of a string, including
quotes. The string will be valid for some time, but not indefinitely
...
...
@@ -67,10 +81,41 @@ extern const char *wine_dbgstr_an( const char * s, int n );
extern
const
char
*
wine_dbgstr_wn
(
const
WCHAR
*
s
,
int
n
);
extern
const
char
*
wine_dbgstr_guid
(
const
struct
_GUID
*
id
);
extern
int
wine_dbg_vprintf
(
const
char
*
format
,
va_list
args
)
__PRINTF_ATTR
(
1
,
0
);
extern
int
wine_dbg_printf
(
const
char
*
format
,
...
)
__PRINTF_ATTR
(
1
,
2
);
extern
int
wine_dbg_log
(
enum
__DEBUG_CLASS
cls
,
const
char
*
ch
,
const
char
*
func
,
const
char
*
format
,
...
)
__PRINTF_ATTR
(
4
,
5
);
extern
int
wine_dbg_vprintf
(
const
char
*
format
,
va_list
args
)
__WINE_PRINTF_ATTR
(
1
,
0
);
extern
int
wine_dbg_printf
(
const
char
*
format
,
...
)
__WINE_PRINTF_ATTR
(
1
,
2
);
extern
int
wine_dbg_log
(
enum
__WINE_DEBUG_CLASS
cls
,
const
char
*
ch
,
const
char
*
func
,
const
char
*
format
,
...
)
__WINE_PRINTF_ATTR
(
4
,
5
);
inline
static
const
char
*
wine_dbgstr_a
(
const
char
*
s
)
{
return
wine_dbgstr_an
(
s
,
80
);
}
inline
static
const
char
*
wine_dbgstr_w
(
const
WCHAR
*
s
)
{
return
wine_dbgstr_wn
(
s
,
80
);
}
#define WINE_TRACE __WINE_DPRINTF(_TRACE,__wine_dbch___default)
#define WINE_TRACE_(ch) __WINE_DPRINTF(_TRACE,__wine_dbch_##ch)
#define WINE_TRACE_ON(ch) __WINE_GET_DEBUGGING(_TRACE,__wine_dbch_##ch)
#define WINE_WARN __WINE_DPRINTF(_WARN,__wine_dbch___default)
#define WINE_WARN_(ch) __WINE_DPRINTF(_WARN,__wine_dbch_##ch)
#define WINE_WARN_ON(ch) __WINE_GET_DEBUGGING(_WARN,__wine_dbch_##ch)
#define WINE_FIXME __WINE_DPRINTF(_FIXME,__wine_dbch___default)
#define WINE_FIXME_(ch) __WINE_DPRINTF(_FIXME,__wine_dbch_##ch)
#define WINE_FIXME_ON(ch) __WINE_GET_DEBUGGING(_FIXME,__wine_dbch_##ch)
#define WINE_ERR __WINE_DPRINTF(_ERR,__wine_dbch___default)
#define WINE_ERR_(ch) __WINE_DPRINTF(_ERR,__wine_dbch_##ch)
#define WINE_ERR_ON(ch) __WINE_GET_DEBUGGING(_ERR,__wine_dbch_##ch)
#define WINE_DECLARE_DEBUG_CHANNEL(ch) \
extern char __wine_dbch_##ch[]
#define WINE_DEFAULT_DEBUG_CHANNEL(ch) \
extern char __wine_dbch_##ch[]; \
static char * const __wine_dbch___default = __wine_dbch_##ch
#define WINE_DPRINTF wine_dbg_printf
#define WINE_MESSAGE wine_dbg_printf
#ifdef __WINE__
/* Wine uses shorter names that are very likely to conflict with other software */
inline
static
const
char
*
debugstr_an
(
const
char
*
s
,
int
n
)
{
return
wine_dbgstr_an
(
s
,
n
);
}
inline
static
const
char
*
debugstr_wn
(
const
WCHAR
*
s
,
int
n
)
{
return
wine_dbgstr_wn
(
s
,
n
);
}
...
...
@@ -80,31 +125,33 @@ inline static const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn(
inline
static
const
char
*
debugres_a
(
const
char
*
s
)
{
return
wine_dbgstr_an
(
s
,
80
);
}
inline
static
const
char
*
debugres_w
(
const
WCHAR
*
s
)
{
return
wine_dbgstr_wn
(
s
,
80
);
}
#define TRACE
__DPRINTF(_TRACE,__wine_dbch___default)
#define TRACE_(ch)
__DPRINTF(_TRACE,__wine_dbch_##
ch)
#define TRACE_ON(ch)
__GET_DEBUGGING(_TRACE,__wine_dbch_##
ch)
#define TRACE
WINE_TRACE
#define TRACE_(ch)
WINE_TRACE_(
ch)
#define TRACE_ON(ch)
WINE_TRACE_ON(
ch)
#define WARN
__DPRINTF(_WARN,__wine_dbch___default)
#define WARN_(ch)
__DPRINTF(_WARN,__wine_dbch_##
ch)
#define WARN_ON(ch)
__GET_DEBUGGING(_WARN,__wine_dbch_##
ch)
#define WARN
WINE_WARN
#define WARN_(ch)
WINE_WARN_(
ch)
#define WARN_ON(ch)
WINE_WARN_ON(
ch)
#define FIXME
__DPRINTF(_FIXME,__wine_dbch___default)
#define FIXME_(ch)
__DPRINTF(_FIXME,__wine_dbch_##
ch)
#define FIXME_ON(ch)
__GET_DEBUGGING(_FIXME,__wine_dbch_##
ch)
#define FIXME
WINE_FIXME
#define FIXME_(ch)
WINE_FIXME_(
ch)
#define FIXME_ON(ch)
WINE_FIXME_ON(
ch)
#undef ERR
/* Solaris got an 'ERR' define in <sys/reg.h> */
#define ERR
__DPRINTF(_ERR,__wine_dbch___default)
#define ERR_(ch)
__DPRINTF(_ERR,__wine_dbch_##
ch)
#define ERR_ON(ch)
__GET_DEBUGGING(_ERR,__wine_dbch_##
ch)
#define ERR
WINE_ERR
#define ERR_(ch)
WINE_ERR_(
ch)
#define ERR_ON(ch)
WINE_ERR_ON(
ch)
#define DECLARE_DEBUG_CHANNEL(ch) \
extern char __wine_dbch_##ch[]
#define DEFAULT_DEBUG_CHANNEL(ch) \
extern char __wine_dbch_##ch[]; static char * const __wine_dbch___default = __wine_dbch_##ch
#define DECLARE_DEBUG_CHANNEL(ch) WINE_DECLARE_DEBUG_CHANNEL(ch)
#define DEFAULT_DEBUG_CHANNEL(ch) WINE_DEFAULT_DEBUG_CHANNEL(ch)
#define DPRINTF
wine_dbg_printf
#define MESSAGE
wine_dbg_printf
#define DPRINTF
WINE_DPRINTF
#define MESSAGE
WINE_MESSAGE
#endif
/* __WINE__ */
#ifdef __cplusplus
}
#endif
#endif
/* __WINE_DEBUGTOOLS_H */
misc/options.c
View file @
7aa67c1d
...
...
@@ -89,7 +89,7 @@ static void do_managed( const char *arg )
static
void
do_debugmsg
(
const
char
*
arg
)
{
static
const
char
*
const
debug_class_names
[
__DBCL_COUNT
]
=
{
"fixme"
,
"err"
,
"warn"
,
"trace"
};
static
const
char
*
const
debug_class_names
[
__
WINE_
DBCL_COUNT
]
=
{
"fixme"
,
"err"
,
"warn"
,
"trace"
};
char
*
opt
,
*
options
=
strdup
(
arg
);
int
i
;
...
...
@@ -109,7 +109,7 @@ static void do_debugmsg( const char *arg )
if
(
!
p
||
!
p
[
1
])
goto
error
;
if
(
p
>
opt
)
{
for
(
i
=
0
;
i
<
__DBCL_COUNT
;
i
++
)
for
(
i
=
0
;
i
<
__
WINE_
DBCL_COUNT
;
i
++
)
{
int
len
=
strlen
(
debug_class_names
[
i
]);
if
(
len
!=
(
p
-
opt
))
continue
;
...
...
@@ -120,7 +120,7 @@ static void do_debugmsg( const char *arg )
break
;
}
}
if
(
i
==
__DBCL_COUNT
)
goto
error
;
/* class name not found */
if
(
i
==
__
WINE_
DBCL_COUNT
)
goto
error
;
/* class name not found */
}
else
{
...
...
@@ -184,7 +184,7 @@ static void do_debugmsg( const char *arg )
MESSAGE
(
"Example: --debugmsg +all,warn-heap
\n
"
" turn on all messages except warning heap messages
\n
"
);
MESSAGE
(
"Available message classes:
\n
"
);
for
(
i
=
0
;
i
<
__DBCL_COUNT
;
i
++
)
MESSAGE
(
"%-9s"
,
debug_class_names
[
i
]
);
for
(
i
=
0
;
i
<
__
WINE_
DBCL_COUNT
;
i
++
)
MESSAGE
(
"%-9s"
,
debug_class_names
[
i
]
);
MESSAGE
(
"
\n\n
"
);
ExitProcess
(
1
);
}
...
...
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