[Xquartz-changes] xserver: Branch 'master' - 5 commits
Jeremy Huddleston
jeremyhu at freedesktop.org
Wed Jun 1 21:23:12 PDT 2011
hw/xquartz/GL/indirect.c | 8 ++------
hw/xquartz/X11Application.m | 2 +-
hw/xquartz/darwin.c | 6 ++++--
hw/xquartz/darwin.h | 6 ++++--
hw/xquartz/pbproxy/app-main.m | 11 +++++++++++
hw/xquartz/pbproxy/pbproxy.h | 13 ++++++-------
hw/xquartz/xpr/xpr.h | 5 +++++
hw/xquartz/xpr/xprCursor.c | 1 -
hw/xquartz/xpr/xprEvent.c | 1 -
hw/xquartz/xpr/xprScreen.c | 1 -
10 files changed, 33 insertions(+), 21 deletions(-)
New commits:
commit 0364fc2a58b4dca5230fd4a2a4929c58f2f91678
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Jun 1 21:18:03 2011 -0700
XQuartz: ASL: Use xpbproxy subsystem for logging xpbproxy messages
Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index a8c3a60..772c458 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -63,6 +63,17 @@ ErrorF(const char * f, ...)
va_end(args);
}
+/* TODO: Have this actually log to ASL */
+void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...) {
+#ifdef DEBUG
+ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+#endif
+}
+
int main (int argc, const char *argv[]) {
const char *s;
int i;
diff --git a/hw/xquartz/pbproxy/pbproxy.h b/hw/xquartz/pbproxy/pbproxy.h
index fcbf4c4..35b15ae 100644
--- a/hw/xquartz/pbproxy/pbproxy.h
+++ b/hw/xquartz/pbproxy/pbproxy.h
@@ -80,13 +80,12 @@ extern BOOL xpbproxy_input_register (void);
/* os/log.c or app-main.m */
extern void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
-#ifdef DEBUG
-/* BEWARE: this can cause a string memory leak, according to the leaks program. */
-# define DebugF(msg, args...) ErrorF("%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args)
-#else
-# define DebugF(...) /* */
-#endif
+/* from darwin.h */
+_X_ATTRIBUTE_PRINTF(6,7)
+extern void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...);
-#define TRACE() DebugF("TRACE\n")
+#define ASL_LOG(level, subsystem, msg, args...) xq_asl_log(level, subsystem, __FILE__, __FUNCTION__, __LINE__, msg, ##args)
+#define DebugF(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "xpbproxy", msg, ##args)
+#define TRACE() DebugF("TRACE")
#endif /* PBPROXY_H */
commit 7dfd65705ccd3c6e2458d6892282520fe5ed8a6b
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Jun 1 21:06:53 2011 -0700
XQuartz: ASL: Use GLXAqua subsystem for logging GLXAqua messages
Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index d15b9a3..c41840b 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -155,12 +155,8 @@ typedef long long GLint64EXT;
__GLXprovider * GlxGetDRISWrastProvider (void);
-// Write debugging output, or not
-#ifdef GLAQUA_DEBUG
-#define GLAQUA_DEBUG_MSG ErrorF
-#else
-#define GLAQUA_DEBUG_MSG(a, ...)
-#endif
+#include "darwin.h"
+#define GLAQUA_DEBUG_MSG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "GLXAqua", msg, ##args)
static void setup_dispatch_table(void);
GLuint __glFloorLog2(GLuint val);
commit 19020b23efa15d72349bd833aebddcc64780a615
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Jun 1 21:06:08 2011 -0700
XQuartz: ASL: Use xpr subsystem for logging xpr messages
Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
diff --git a/hw/xquartz/xpr/xpr.h b/hw/xquartz/xpr/xpr.h
index ebd89de..0b138dd 100644
--- a/hw/xquartz/xpr/xpr.h
+++ b/hw/xquartz/xpr/xpr.h
@@ -33,6 +33,11 @@
#include "screenint.h"
#include <Xplugin.h>
+#include "darwin.h"
+
+#undef DEBUG_LOG
+#define DEBUG_LOG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "xpr", msg, ##args)
+
Bool QuartzModeBundleInit(void);
void AppleDRIExtensionInit(void);
diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c
index 216678e..2b31865 100644
--- a/hw/xquartz/xpr/xprCursor.c
+++ b/hw/xquartz/xpr/xprCursor.c
@@ -37,7 +37,6 @@
#include "quartz.h"
#include "xpr.h"
-#include "darwin.h"
#include "darwinEvents.h"
#include <Xplugin.h>
diff --git a/hw/xquartz/xpr/xprEvent.c b/hw/xquartz/xpr/xprEvent.c
index cc86c47..4e7ece6 100644
--- a/hw/xquartz/xpr/xprEvent.c
+++ b/hw/xquartz/xpr/xprEvent.c
@@ -44,7 +44,6 @@
#include "scrnintstr.h"
#include "mipointer.h"
-#include "darwin.h"
#include "quartz.h"
#include "quartzKeyboard.h"
#include "darwinEvents.h"
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 98250e6..002355e 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -40,7 +40,6 @@
#include "xpr.h"
#include "xprEvent.h"
#include "pseudoramiX.h"
-#include "darwin.h"
#include "darwinEvents.h"
#include "rootless.h"
#include "dri.h"
commit a66400f8dba9b7c5b65f9d26996fff677c42d866
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Jun 1 20:45:58 2011 -0700
XQuartz: ASL: Update logging to support differnet levels and subsystems
Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index fa8d4ce..29ab836 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -79,7 +79,7 @@
aslclient aslc;
-void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) {
+void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...) {
va_list args;
aslmsg msg = asl_new(ASL_TYPE_MSG);
@@ -93,10 +93,12 @@ void debug_asl (const char *file, const char *function, int line, const char *fm
asl_set(msg, "Line", _line);
free(_line);
}
+ if(subsystem)
+ asl_set(msg, "Subsystem", subsystem);
}
va_start(args, fmt);
- asl_vlog(aslc, msg, ASL_LEVEL_DEBUG, fmt, args);
+ asl_vlog(aslc, msg, level, fmt, args);
va_end(args);
if(msg)
diff --git a/hw/xquartz/darwin.h b/hw/xquartz/darwin.h
index 659de43..aafc12f 100644
--- a/hw/xquartz/darwin.h
+++ b/hw/xquartz/darwin.h
@@ -76,9 +76,11 @@ extern int darwinMainScreenY;
// bundle-main.c
extern char *bundle_id_prefix;
-extern void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) _X_ATTRIBUTE_PRINTF(4,5);
+_X_ATTRIBUTE_PRINTF(6,7)
+extern void xq_asl_log (int level, const char *subsystem, const char *file, const char *function, int line, const char *fmt, ...);
-#define DEBUG_LOG(msg, args...) debug_asl(__FILE__, __FUNCTION__, __LINE__, msg, ##args);
+#define ASL_LOG(level, subsystem, msg, args...) xq_asl_log(level, subsystem, __FILE__, __FUNCTION__, __LINE__, msg, ##args)
+#define DEBUG_LOG(msg, args...) ASL_LOG(ASL_LEVEL_DEBUG, "XQuartz", msg, ##args)
#define TRACE() DEBUG_LOG("TRACE")
#endif /* _DARWIN_H */
commit c0077b41b4c8bb08129db97a2a01d0af55d13fa4
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date: Wed Jun 1 20:54:27 2011 -0700
XQuartz: Add a semicolon after DEBUG_LOG
Don't rely on the macro to provide it
Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 7c41cbc..a51ee82 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -188,7 +188,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
- (void) activateX:(OSX_BOOL)state {
size_t i;
- DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
+ DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active);
if (state) {
if(bgMouseLocationUpdated) {
DarwinSendPointerEvents(darwinPointer, MotionNotify, 0, bgMouseLocation.x, bgMouseLocation.y, 0.0, 0.0, 0.0);
More information about the Xquartz-changes
mailing list