ReactOS 0.4.16-dev-1946-g52006dd
debug.c File Reference
#include "wine/config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <excpt.h>
#include "wine/debug.h"
#include "wine/library.h"
#include "winternl.h"
Include dependency graph for debug.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define MAX_DEBUG_OPTIONS   256
 

Functions

 WINE_DECLARE_DEBUG_CHANNEL (pid)
 
 WINE_DECLARE_DEBUG_CHANNEL (tid)
 
static void debug_init (void)
 
static int winefmt_default_dbg_vlog (enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *file, const char *func, const int line, const char *format, va_list args)
 
static int rosfmt_default_dbg_vlog (enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *file, const char *func, const int line, const char *format, va_list args)
 
static int extfmt_default_dbg_vlog (enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *file, const char *func, const int line, const char *format, va_list args)
 
static int __cdecl cmp_name (const void *p1, const void *p2)
 
unsigned char __wine_dbg_get_channel_flags (struct __wine_debug_channel *channel)
 
int __wine_dbg_set_channel_flags (struct __wine_debug_channel *channel, unsigned char set, unsigned char clear)
 
static void add_option (const char *name, unsigned char set, unsigned char clear)
 
static void parse_options (const char *str)
 
int wine_dbg_printf (const char *format,...)
 
const charwine_dbg_sprintf (const char *format,...)
 
int wine_dbg_log (enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *func, const char *format,...)
 
int ros_dbg_log (enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *file, const char *func, const int line, const char *format,...)
 
static charget_temp_buffer (size_t size)
 
static void release_temp_buffer (char *buffer, size_t size)
 
static const chardefault_dbgstr_an (const char *str, int n)
 
static const chardefault_dbgstr_wn (const WCHAR *str, int n)
 
static int default_dbg_vprintf (const char *format, va_list args)
 
const charwine_dbgstr_an (const char *s, int n)
 
const charwine_dbgstr_wn (const WCHAR *s, int n)
 
void __wine_dbg_set_functions (const struct __wine_debug_functions *new_funcs, struct __wine_debug_functions *old_funcs, size_t size)
 

Variables

static const char *const debug_classes [] = { "fixme", "err", "warn", "trace" }
 
static unsigned char default_flags = (1 << __WINE_DBCL_ERR) | (1 << __WINE_DBCL_FIXME)
 
static int nb_debug_options = -1
 
static struct __wine_debug_channel debug_options [MAX_DEBUG_OPTIONS]
 
static struct __wine_debug_functions funcs
 

Macro Definition Documentation

◆ MAX_DEBUG_OPTIONS

#define MAX_DEBUG_OPTIONS   256

Definition at line 42 of file debug.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 31 of file debug.c.

Function Documentation

◆ __wine_dbg_get_channel_flags()

unsigned char __wine_dbg_get_channel_flags ( struct __wine_debug_channel channel)

Definition at line 72 of file debug.c.

73{
74 if (nb_debug_options == -1) debug_init();
75
77 {
79 sizeof(debug_options[0]), cmp_name );
80 if (opt) return opt->flags;
81 }
82 /* no option for this channel */
83 if (channel->flags & (1 << __WINE_DBCL_INIT)) channel->flags = default_flags;
84 return default_flags;
85}
@ __WINE_DBCL_INIT
Definition: debug.h:57
static unsigned char default_flags
Definition: debug.c:44
static int nb_debug_options
Definition: debug.c:45
static void debug_init(void)
Definition: debug.c:209
static struct __wine_debug_channel debug_options[MAX_DEBUG_OPTIONS]
Definition: debug.c:46
static int __cdecl cmp_name(const void *p1, const void *p2)
Definition: debug.c:64
unsigned char flags
Definition: debug.h:62
char name[15]
Definition: debug.h:63
#define bsearch

◆ __wine_dbg_set_channel_flags()

int __wine_dbg_set_channel_flags ( struct __wine_debug_channel channel,
unsigned char  set,
unsigned char  clear 
)

Definition at line 88 of file debug.c.

90{
91 if (nb_debug_options == -1) debug_init();
92
94 {
96 sizeof(debug_options[0]), cmp_name );
97 if (opt)
98 {
99 opt->flags = (opt->flags & ~clear) | set;
100 return 1;
101 }
102 }
103 return 0;
104}
Definition: _set.h:50

◆ __wine_dbg_set_functions()

void __wine_dbg_set_functions ( const struct __wine_debug_functions new_funcs,
struct __wine_debug_functions old_funcs,
size_t  size 
)

Definition at line 540 of file debug.c.

542{
543 if (old_funcs) memcpy( old_funcs, &funcs, min(sizeof(funcs),size) );
544 if (new_funcs) memcpy( &funcs, new_funcs, min(sizeof(funcs),size) );
545}
GLsizeiptr size
Definition: glext.h:5919
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define min(a, b)
Definition: monoChain.cc:55
static struct __wine_debug_functions funcs
Definition: debug.c:48

Referenced by CmdTrace().

◆ add_option()

static void add_option ( const char name,
unsigned char  set,
unsigned char  clear 
)
static

Definition at line 107 of file debug.c.

108{
109 int min = 0, max = nb_debug_options - 1, pos, res;
110
111 if (!name[0]) /* "all" option */
112 {
113 default_flags = (default_flags & ~clear) | set;
114 return;
115 }
116 if (strlen(name) >= sizeof(debug_options[0].name)) return;
117
118 while (min <= max)
119 {
120 pos = (min + max) / 2;
122 if (!res)
123 {
124 debug_options[pos].flags = (debug_options[pos].flags & ~clear) | set;
125 return;
126 }
127 if (res < 0) max = pos - 1;
128 else min = pos + 1;
129 }
130 if (nb_debug_options >= MAX_DEBUG_OPTIONS) return;
131
132 pos = min;
134 (nb_debug_options - pos) * sizeof(debug_options[0]) );
136 debug_options[pos].flags = (default_flags & ~clear) | set;
138}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLuint res
Definition: glext.h:9613
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
strcpy
Definition: string.h:131
#define MAX_DEBUG_OPTIONS
Definition: debug.c:42
Definition: name.c:39
#define max(a, b)
Definition: svc.c:63

Referenced by parse_options().

◆ cmp_name()

static int __cdecl cmp_name ( const void p1,
const void p2 
)
static

Definition at line 64 of file debug.c.

65{
66 const char *name = p1;
67 const struct __wine_debug_channel *chan = p2;
68 return strcmp( name, chan->name );
69}

Referenced by __wine_dbg_get_channel_flags(), and __wine_dbg_set_channel_flags().

◆ debug_init()

static void debug_init ( void  )
static

Definition at line 209 of file debug.c.

210{
211 char *wine_debug;
213 /* GetEnvironmentVariableA will change LastError! */
214 DWORD LastError = GetLastError();
215
216 if (nb_debug_options != -1) return; /* already initialized */
218
219 dwLength = GetEnvironmentVariableA("DEBUGCHANNEL", NULL, 0);
220 if (dwLength)
221 {
222 wine_debug = malloc(dwLength);
223 if (wine_debug)
224 {
225 if (GetEnvironmentVariableA("DEBUGCHANNEL", wine_debug, dwLength) < dwLength)
226 parse_options(wine_debug);
227 free(wine_debug);
228 }
229 }
230
231 dwLength = GetEnvironmentVariableA("DEBUGFORMAT", NULL, 0);
232 if (dwLength)
233 {
234 wine_debug = malloc(dwLength);
235 if (wine_debug)
236 {
237 if (GetEnvironmentVariableA("DEBUGFORMAT", wine_debug, dwLength) < dwLength)
238 {
239 if (strcmp(wine_debug, "wine") == 0)
240 {
242 }
243 else
244 if (strcmp(wine_debug, "extended") == 0 ||
245 strcmp(wine_debug, "ext") == 0)
246 {
248 }
249 else
250 {
252 }
253 }
254 free(wine_debug);
255 }
256 }
257
258 SetLastError(LastError);
259}
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
#define GetEnvironmentVariableA(x, y, z)
Definition: compat.h:754
static DWORD DWORD * dwLength
Definition: fusion.c:86
unsigned long DWORD
Definition: ntddk_ex.h:95
static void parse_options(const char *str)
Definition: debug.c:141
static int extfmt_default_dbg_vlog(enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *file, const char *func, const int line, const char *format, va_list args)
Definition: debug.c:503
static int winefmt_default_dbg_vlog(enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *file, const char *func, const int line, const char *format, va_list args)
Definition: debug.c:466
static int rosfmt_default_dbg_vlog(enum __wine_debug_class cls, struct __wine_debug_channel *channel, const char *file, const char *func, const int line, const char *format, va_list args)
Definition: debug.c:482
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by __wine_dbg_get_channel_flags(), and __wine_dbg_set_channel_flags().

◆ default_dbg_vprintf()

static int default_dbg_vprintf ( const char format,
va_list  args 
)
static

Definition at line 458 of file debug.c.

459{
460 return vDbgPrintExWithPrefix("", -1, 0, format, args);
461}
ULONG NTAPI vDbgPrintExWithPrefix(IN PCCH Prefix, IN ULONG ComponentId, IN ULONG Level, IN PCCH Format, IN va_list ap)
Definition: debug.c:167
Definition: match.c:390
Definition: format.c:58

◆ default_dbgstr_an()

static const char * default_dbgstr_an ( const char str,
int  n 
)
static

Definition at line 346 of file debug.c.

347{
348 static const char hex[16] = "0123456789abcdef";
349 char *dst, *res;
350 size_t size;
351
352 if (!((ULONG_PTR)str >> 16))
353 {
354 if (!str) return "(null)";
355 res = funcs.get_temp_buffer( 6 );
356 sprintf( res, "#%04x", LOWORD(str) );
357 return res;
358 }
359 if (n == -1) n = strlen(str);
360 if (n < 0) n = 0;
361 size = 10 + min( 300, n * 4 );
362 dst = res = funcs.get_temp_buffer( size );
363 *dst++ = '"';
364 while (n-- > 0 && dst <= res + size - 9)
365 {
366 unsigned char c = *str++;
367 switch (c)
368 {
369 case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
370 case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
371 case '\t': *dst++ = '\\'; *dst++ = 't'; break;
372 case '"': *dst++ = '\\'; *dst++ = '"'; break;
373 case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
374 default:
375 if (c >= ' ' && c <= 126)
376 *dst++ = c;
377 else
378 {
379 *dst++ = '\\';
380 *dst++ = 'x';
381 *dst++ = hex[(c >> 4) & 0x0f];
382 *dst++ = hex[c & 0x0f];
383 }
384 }
385 }
386 *dst++ = '"';
387 if (n > 0)
388 {
389 *dst++ = '.';
390 *dst++ = '.';
391 *dst++ = '.';
392 }
393 *dst++ = 0;
394 funcs.release_temp_buffer( res, dst - res );
395 return res;
396}
GLdouble n
Definition: glext.h:7729
const GLubyte * c
Definition: glext.h:8905
GLenum GLenum dst
Definition: glext.h:6340
int hex(char ch)
#define c
Definition: ke_i.h:80
#define sprintf
Definition: sprintf.c:45
#define LOWORD(l)
Definition: pedump.c:82
const WCHAR * str
uint32_t ULONG_PTR
Definition: typedefs.h:65

◆ default_dbgstr_wn()

static const char * default_dbgstr_wn ( const WCHAR str,
int  n 
)
static

Definition at line 400 of file debug.c.

401{
402 char *dst, *res;
403 size_t size;
404
405 if (!((ULONG_PTR)str >> 16))
406 {
407 if (!str) return "(null)";
408 res = funcs.get_temp_buffer( 6 );
409 sprintf( res, "#%04x", LOWORD(str) );
410 return res;
411 }
412 if (n == -1)
413 {
414 const WCHAR *end = str;
415 while (*end) end++;
416 n = end - str;
417 }
418 if (n < 0) n = 0;
419 size = 12 + min( 300, n * 5 );
420 dst = res = funcs.get_temp_buffer( size );
421 *dst++ = 'L';
422 *dst++ = '"';
423 while (n-- > 0 && dst <= res + size - 10)
424 {
425 WCHAR c = *str++;
426 switch (c)
427 {
428 case '\n': *dst++ = '\\'; *dst++ = 'n'; break;
429 case '\r': *dst++ = '\\'; *dst++ = 'r'; break;
430 case '\t': *dst++ = '\\'; *dst++ = 't'; break;
431 case '"': *dst++ = '\\'; *dst++ = '"'; break;
432 case '\\': *dst++ = '\\'; *dst++ = '\\'; break;
433 default:
434 if (c >= ' ' && c <= 126)
435 *dst++ = c;
436 else
437 {
438 *dst++ = '\\';
439 sprintf(dst,"%04x",c);
440 dst+=4;
441 }
442 }
443 }
444 *dst++ = '"';
445 if (n > 0)
446 {
447 *dst++ = '.';
448 *dst++ = '.';
449 *dst++ = '.';
450 }
451 *dst++ = 0;
452 funcs.release_temp_buffer( res, dst - res );
453 return res;
454}
GLuint GLuint end
Definition: gl.h:1545
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ extfmt_default_dbg_vlog()

static int extfmt_default_dbg_vlog ( enum __wine_debug_class  cls,
struct __wine_debug_channel channel,
const char file,
const char func,
const int  line,
const char format,
va_list  args 
)
static

Definition at line 503 of file debug.c.

505{
506 int ret = 0;
507
508 if (TRACE_ON(pid) || TRACE_ON(tid))
509 {
510 ret += wine_dbg_printf( "[%04x:%04x]:",
513 }
514
515 if (cls < sizeof(debug_classes)/sizeof(debug_classes[0]))
516 ret += wine_dbg_printf( "%s:", debug_classes[cls] );
517
518 if (file && line)
519 ret += wine_dbg_printf( "(%s:%d):", file, line );
520
521 ret += wine_dbg_printf( "%s:%s ", channel->name, func );
522
523 if (format)
524 ret += funcs.dbg_vprintf( format, args );
525 return ret;
526}
#define HandleToULong(h)
Definition: basetsd.h:89
#define TRACE_ON(x)
Definition: compat.h:75
return ret
Definition: mutex.c:146
GLenum func
Definition: glext.h:6028
static TfClientId tid
#define NtCurrentTeb
static const char *const debug_classes[]
Definition: debug.c:40
int wine_dbg_printf(const char *format,...)
Definition: debug.c:262
HANDLE UniqueThread
Definition: compat.h:826
HANDLE UniqueProcess
Definition: compat.h:825
Definition: fci.c:127
Definition: parser.c:49
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1151

Referenced by debug_init().

◆ get_temp_buffer()

static char * get_temp_buffer ( size_t  size)
static

Definition at line 325 of file debug.c.

326{
327 static char *list[32];
328 static long pos = 0;
329 char *ret;
330 long idx;
331
332 idx = interlocked_xchg_add( &pos, 1 ) % (sizeof(list)/sizeof(list[0]));
333 if ((ret = realloc( list[idx], size ))) list[idx] = ret;
334 return ret;
335}
Definition: list.h:37
#define realloc
Definition: debug_ros.c:6
unsigned int idx
Definition: utils.c:41
#define list
Definition: rosglue.h:35
#define interlocked_xchg_add
Definition: port.h:348

◆ parse_options()

static void parse_options ( const char str)
static

Definition at line 141 of file debug.c.

142{
143 char *opt, *next, *options;
144 unsigned int i;
145
146 if (!(options = _strdup(str))) return;
147 for (opt = options; opt; opt = next)
148 {
149 const char *p;
150 unsigned char set = 0, clear = 0;
151
152 if ((next = strchr( opt, ',' ))) *next++ = 0;
153
154 p = opt + strcspn( opt, "+-" );
155 if (!p[0]) p = opt; /* assume it's a debug channel name */
156
157 if (p > opt)
158 {
159 for (i = 0; i < sizeof(debug_classes)/sizeof(debug_classes[0]); i++)
160 {
161 int len = strlen(debug_classes[i]);
162 if (len != (p - opt)) continue;
163 if (!memcmp( opt, debug_classes[i], len )) /* found it */
164 {
165 if (*p == '+') set |= 1 << i;
166 else clear |= 1 << i;
167 break;
168 }
169 }
170 if (i == sizeof(debug_classes)/sizeof(debug_classes[0])) /* bad class name, skip it */
171 continue;
172 }
173 else
174 {
175 if (*p == '-') clear = ~0;
176 else set = ~0;
177 }
178 if (*p == '+' || *p == '-') p++;
179 if (!p[0]) continue;
180
181 if (!strcmp( p, "all" ))
182 default_flags = (default_flags & ~clear) | set;
183 else
184 add_option( p, set, clear );
185 }
186 free( options );
187}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define _strdup
Definition: debug_ros.c:7
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static unsigned __int64 next
Definition: rand_nt.c:6
_Check_return_ _CRTIMP size_t __cdecl strcspn(_In_z_ const char *_Str, _In_z_ const char *_Control)
static void add_option(const char *name, unsigned char set, unsigned char clear)
Definition: debug.c:107

Referenced by debug_init().

◆ release_temp_buffer()

static void release_temp_buffer ( char buffer,
size_t  size 
)
static

Definition at line 339 of file debug.c.

340{
341 /* don't bother doing anything */
342}

◆ ros_dbg_log()

int ros_dbg_log ( enum __wine_debug_class  cls,
struct __wine_debug_channel channel,
const char file,
const char func,
const int  line,
const char format,
  ... 
)

Definition at line 308 of file debug.c.

310{
311 int ret;
313
314 if (!(__wine_dbg_get_channel_flags( channel ) & (1 << cls))) return -1;
315
317 ret = funcs.dbg_vlog( cls, channel, file, func, line, format, valist );
318 va_end(valist);
319 return ret;
320}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
static va_list valist
Definition: printf.c:46
#define __wine_dbg_get_channel_flags(channel)
Definition: wine_debug.c:172

◆ rosfmt_default_dbg_vlog()

static int rosfmt_default_dbg_vlog ( enum __wine_debug_class  cls,
struct __wine_debug_channel channel,
const char file,
const char func,
const int  line,
const char format,
va_list  args 
)
static

Definition at line 482 of file debug.c.

484{
485 int ret = 0;
486
487 if (TRACE_ON(tid))
489
490 if (cls < sizeof(debug_classes)/sizeof(debug_classes[0]))
491 ret += wine_dbg_printf( "%s:", debug_classes[cls] );
492
493 if (file && line)
494 ret += wine_dbg_printf( "(%s:%d) ", file, line );
495 else
496 ret += wine_dbg_printf( "%s:%s: ", channel->name, func );
497
498 if (format)
499 ret += funcs.dbg_vprintf( format, args );
500 return ret;
501}

Referenced by debug_init().

◆ wine_dbg_log()

int wine_dbg_log ( enum __wine_debug_class  cls,
struct __wine_debug_channel channel,
const char func,
const char format,
  ... 
)

Definition at line 292 of file debug.c.

294{
295 int ret;
297
298 if (!(__wine_dbg_get_channel_flags( channel ) & (1 << cls))) return -1;
299
301 ret = funcs.dbg_vlog( cls, channel, NULL, func, 0, format, valist );
302 va_end(valist);
303 return ret;
304}

◆ wine_dbg_printf()

int wine_dbg_printf ( const char format,
  ... 
)

Definition at line 262 of file debug.c.

263{
264 int ret;
266
268 ret = funcs.dbg_vprintf( format, valist );
269 va_end(valist);
270 return ret;
271}

Referenced by extfmt_default_dbg_vlog(), rosfmt_default_dbg_vlog(), and winefmt_default_dbg_vlog().

◆ wine_dbg_sprintf()

const char * wine_dbg_sprintf ( const char format,
  ... 
)

Definition at line 274 of file debug.c.

275{
276 static const int max_size = 200;
277 char *ret;
278 int len;
280
282 ret = funcs.get_temp_buffer( max_size );
284 if (len == -1 || len >= max_size) ret[max_size-1] = 0;
285 else funcs.release_temp_buffer( ret, len + 1 );
286 va_end(valist);
287 return ret;
288}
static INT max_size
Definition: history.c:51
#define vsnprintf
Definition: tif_win32.c:406

◆ wine_dbgstr_an()

const char * wine_dbgstr_an ( const char s,
int  n 
)

Definition at line 530 of file debug.c.

531{
532 return funcs.dbgstr_an(s, n);
533}
GLdouble s
Definition: gl.h:2039

Referenced by debugstr_a(), debugstr_an(), and wine_dbgstr_a().

◆ wine_dbgstr_wn()

const char * wine_dbgstr_wn ( const WCHAR s,
int  n 
)

Definition at line 535 of file debug.c.

536{
537 return funcs.dbgstr_wn(s, n);
538}

◆ WINE_DECLARE_DEBUG_CHANNEL() [1/2]

WINE_DECLARE_DEBUG_CHANNEL ( pid  )

◆ WINE_DECLARE_DEBUG_CHANNEL() [2/2]

WINE_DECLARE_DEBUG_CHANNEL ( tid  )

◆ winefmt_default_dbg_vlog()

static int winefmt_default_dbg_vlog ( enum __wine_debug_class  cls,
struct __wine_debug_channel channel,
const char file,
const char func,
const int  line,
const char format,
va_list  args 
)
static

Definition at line 466 of file debug.c.

468{
469 int ret = 0;
470
471 if (TRACE_ON(pid))
474
475 if (cls < sizeof(debug_classes)/sizeof(debug_classes[0]))
476 ret += wine_dbg_printf( "%s:%s:%s ", debug_classes[cls], channel->name, func );
477 if (format)
478 ret += funcs.dbg_vprintf( format, args );
479 return ret;
480}

Referenced by debug_init().

Variable Documentation

◆ debug_classes

const char* const debug_classes[] = { "fixme", "err", "warn", "trace" }
static

◆ debug_options

◆ default_flags

unsigned char default_flags = (1 << __WINE_DBCL_ERR) | (1 << __WINE_DBCL_FIXME)
static

Definition at line 44 of file debug.c.

Referenced by __wine_dbg_get_channel_flags(), add_option(), and parse_options().

◆ funcs

static struct __wine_debug_functions funcs
static
Initial value:
=
{
}
static LPSTR get_temp_buffer(void)
Definition: dplayx.c:88
static void release_temp_buffer(char *buffer, size_t size)
Definition: debug.c:339
static const char * default_dbgstr_an(const char *str, int n)
Definition: debug.c:346
static int default_dbg_vprintf(const char *format, va_list args)
Definition: debug.c:458
static const char * default_dbgstr_wn(const WCHAR *str, int n)
Definition: debug.c:400

Definition at line 48 of file debug.c.

Referenced by __wine_dbg_set_functions(), add_func_info(), add_function_decl(), build_format_strings(), cff_size_done(), cff_size_init(), cff_size_request(), cff_slot_init(), cid_size_done(), cid_size_init(), cid_size_request(), cid_slot_init(), CreateProxyFromTypeInfo(), CreateStubFromTypeInfo(), debug_init(), default_dbgstr_an(), default_dbgstr_wn(), DispatchEx_GetNextDispID(), extfmt_default_dbg_vlog(), get_iface_info(), ITypeInfoImpl_GetInternalDispatchFuncDesc(), NP_GetEntryPoints(), num_handlers(), psh_globals_funcs_init(), report(), ros_dbg_log(), rosfmt_default_dbg_vlog(), T1_GlyphSlot_Init(), t1_hints_funcs_init(), T1_Size_Done(), T1_Size_Init(), T1_Size_Request(), t2_hints_funcs_init(), tess_callback_begin(), tess_callback_end(), tess_callback_vertex(), test_FakeDLL(), test_LoadFunctionPointers(), test_provider_funcs(), test_utils(), testCertTrust(), testInitialize(), testObjTrust(), wglUseFontBitmaps_common(), wglUseFontOutlines_common(), wine_dbg_log(), wine_dbg_printf(), wine_dbg_sprintf(), wine_dbgstr_an(), wine_dbgstr_wn(), winefmt_default_dbg_vlog(), and write_iface_fs().

◆ nb_debug_options

int nb_debug_options = -1
static