~ubuntu-branches/ubuntu/karmic/moon/karmic

« back to all changes in this revision

Viewing changes to src/debug.h

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-14 12:01:08 UTC
  • Revision ID: james.westby@ubuntu.com-20090214120108-06539vb25vhbd8bn
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * debug.h: 
 
3
 *
 
4
 * Copyright 2007 Novell, Inc. (http://www.novell.com)
 
5
 *
 
6
 * See the LICENSE file included with the distribution for details.
 
7
 * 
 
8
 */
 
9
 
 
10
#ifndef __MOONLIGHT_DEBUG_H__
 
11
#define __MOONLIGHT_DEBUG_H__
 
12
 
 
13
#if DEBUG
 
14
 
 
15
#include <glib.h>
 
16
#include <unistd.h>
 
17
#include <execinfo.h>
 
18
#include <stdio.h>
 
19
#include <stdlib.h>
 
20
#include <string.h>
 
21
 
 
22
#include "runtime.h"
 
23
 
 
24
#define MAX_STACK_FRAMES 30
 
25
 
 
26
char* get_stack_trace_prefix (const char* prefix);
 
27
void print_stack_trace_prefix (const char* prefix); 
 
28
 
 
29
G_BEGIN_DECLS
 
30
 
 
31
char* get_stack_trace ();
 
32
void print_stack_trace ();
 
33
void enable_vm_stack_trace ();
 
34
void print_gdb_trace ();
 
35
G_END_DECLS
 
36
 
 
37
#define LOG_ALSA(...)                           if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_ALSA)) printf (__VA_ARGS__);
 
38
#define LOG_ALSA_EX(...)                        if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_ALSA_EX)) printf (__VA_ARGS__);
 
39
#define LOG_AUDIO(...)                          if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_AUDIO)) printf (__VA_ARGS__);
 
40
#define LOG_AUDIO_EX(...)                       if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_AUDIO_EX)) printf (__VA_ARGS__);
 
41
#define LOG_PULSE(...)                          if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_PULSE)) printf (__VA_ARGS__);
 
42
#define LOG_PULSE_EX(...)                       if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_PULSE_EX)) printf (__VA_ARGS__);
 
43
#define LOG_HTTPSTREAMING(...)                  if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_HTTPSTREAMING)) printf (__VA_ARGS__);
 
44
#define LOG_MARKERS(...)                        if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_MARKERS)) printf (__VA_ARGS__);
 
45
#define LOG_MARKERS_EX(...)                     if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_MARKERS_EX)) printf (__VA_ARGS__);
 
46
#define LOG_MMS(...)                            if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_MMS)) printf (__VA_ARGS__);
 
47
#define LOG_MEDIAPLAYER(...)                    if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_MEDIAPLAYER)) printf (__VA_ARGS__);
 
48
#define LOG_MEDIAPLAYER_EX(...)                 if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_MEDIAPLAYER_EX)) printf (__VA_ARGS__);
 
49
#define LOG_PIPELINE(...)                       if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_PIPELINE)) printf (__VA_ARGS__);
 
50
#define LOG_PIPELINE_ERROR(...)                 if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_PIPELINE_ERROR)) printf (__VA_ARGS__);
 
51
#define LOG_PIPELINE_ERROR_CONDITIONAL(x, ...) if (G_UNLIKELY (x && debug_flags & PIPELINE_ERROR)) printf (__VA_ARGS__);
 
52
#define LOG_FRAMEREADERLOOP(...)                if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_FRAMEREADERLOOP)) printf (__VA_ARGS__);
 
53
#define LOG_FFMPEG(...)                         if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_FFMPEG)) printf(__VA_ARGS__);
 
54
#define LOG_UI(...)                             if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_UI)) printf (__VA_ARGS__);
 
55
#define LOG_CODECS(...)                         if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_CODECS)) printf (__VA_ARGS__);
 
56
#define LOG_DP(...)                             if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_DP)) printf (__VA_ARGS__);
 
57
#define LOG_DOWNLOADER(...)                     if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_DOWNLOADER)) printf (__VA_ARGS__);
 
58
#define LOG_FONT(...)                           if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_FONT)) fprintf (__VA_ARGS__);
 
59
#define LOG_LAYOUT(...)                         if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_LAYOUT)) fprintf (__VA_ARGS__);
 
60
#define LOG_MEDIA(...)                          if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_MEDIA)) printf (__VA_ARGS__);
 
61
#define LOG_MEDIAELEMENT(...)                   if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_MEDIAELEMENT)) printf (__VA_ARGS__);
 
62
#define LOG_MEDIAELEMENT_EX(...)                if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_MEDIAELEMENT_EX)) printf (__VA_ARGS__);
 
63
#define LOG_BUFFERING(...)                      if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_BUFFERING)) printf (__VA_ARGS__);
 
64
#define LOG_PIPELINE_ASF(...)                   if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_ASF)) printf (__VA_ARGS__);
 
65
#define LOG_PLAYLIST(...)                       if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_PLAYLIST)) printf (__VA_ARGS__);
 
66
#define LOG_PLAYLIST_WARN(...)                  if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_PLAYLIST_WARN)) printf (__VA_ARGS__);
 
67
#define LOG_TEXT(...)                           if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_TEXT)) fprintf (__VA_ARGS__);
 
68
#define LOG_XAML(...)                           if (G_UNLIKELY (debug_flags & RUNTIME_DEBUG_XAML)) printf (__VA_ARGS__);
 
69
 
 
70
#else
 
71
 
 
72
#define LOG_ALSA(...)
 
73
#define LOG_ALSA_EX(...)
 
74
#define LOG_AUDIO(...)
 
75
#define LOG_AUDIO_EX(...)
 
76
#define LOG_PULSE(...)
 
77
#define LOG_PULSE_EX(...)
 
78
#define LOG_HTTPSTREAMING(...) 
 
79
#define LOG_MARKERS(...)
 
80
#define LOG_MARKERS_EX(...)
 
81
#define LOG_MMS(...)
 
82
#define LOG_MEDIAPLAYER(...)
 
83
#define LOG_MEDIAPLAYER_EX(...)
 
84
#define LOG_PIPELINE(...)
 
85
#define LOG_PIPELINE_ERROR(...)
 
86
#define LOG_PIPELINE_ERROR_CONDITIONAL(x, ...)
 
87
#define LOG_FRAMEREADERLOOP(...)
 
88
#define LOG_FFMPEG(...)
 
89
#define LOG_UI(...)
 
90
#define LOG_CODECS(...)
 
91
#define LOG_DP(...)
 
92
#define LOG_DOWNLOADER(...)
 
93
#define LOG_FONT(...)
 
94
#define LOG_LAYOUT(...)
 
95
#define LOG_MEDIA(...)
 
96
#define LOG_MEDIAELEMENT(...)
 
97
#define LOG_MEDIAELEMENT_EX(...)
 
98
#define LOG_BUFFERING(...)
 
99
#define LOG_PIPELINE_ASF(...)
 
100
#define LOG_PLAYLIST(...)
 
101
#define LOG_PLAYLIST_WARN(...)
 
102
#define LOG_TEXT(...)
 
103
#define LOG_XAML(...)
 
104
 
 
105
 
 
106
 
 
107
 
 
108
#define print_stack_trace()
 
109
#define print_gdb_trace()
 
110
#define enable_vm_stack_trace()
 
111
 
 
112
#endif /* DEBUG */
 
113
 
 
114
#endif /* __MOONLIGHT_DEBUG_H */
 
115