From cee2fcc6f03c51095d0210156f770a31ee5a9aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Sat, 8 Sep 2012 15:27:00 -0400 Subject: [PATCH] libfreerdp: fix debug output --- channels/drdynvc/tsmf/tsmf_main.c | 2 +- cmake/ConfigOptions.cmake | 57 ++++++++++++++++++------------- libfreerdp/crypto/nla.c | 2 +- libfreerdp/locale/timezone.c | 4 +-- libfreerdp/utils/svc_plugin.c | 2 +- 5 files changed, 38 insertions(+), 29 deletions(-) diff --git a/channels/drdynvc/tsmf/tsmf_main.c b/channels/drdynvc/tsmf/tsmf_main.c index d76961c4e..53a1dbdba 100644 --- a/channels/drdynvc/tsmf/tsmf_main.c +++ b/channels/drdynvc/tsmf/tsmf_main.c @@ -87,7 +87,7 @@ void tsmf_playback_ack(IWTSVirtualChannelCallback* pChannelCallback, stream_write_uint64(s, duration); /* DataDuration */ stream_write_uint64(s, data_size); /* cbData */ - DEBUG_DVC("response size %d", stream_get_length(s)); + DEBUG_DVC("response size %d", (int) stream_get_length(s)); error = callback->channel->Write(callback->channel, stream_get_length(s), stream_get_head(s), NULL); if (error) { diff --git a/cmake/ConfigOptions.cmake b/cmake/ConfigOptions.cmake index a0c8ad15e..7f1bb6f97 100644 --- a/cmake/ConfigOptions.cmake +++ b/cmake/ConfigOptions.cmake @@ -24,28 +24,37 @@ option(WITH_SERVER "Build server binaries" OFF) option(WITH_CHANNELS "Build virtual channel plugins" ON) option(WITH_THIRD_PARTY "Build third-party components" OFF) -option(WITH_DEBUG_CERTIFICATE "Print certificate related debug messages." OFF) -option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." OFF) -option(WITH_DEBUG_CLIPRDR "Print clipboard redirection debug messages" OFF) -option(WITH_DEBUG_DVC "Print dynamic virtual channel debug messages." OFF) -option(WITH_DEBUG_GDI "Print graphics debug messages." OFF) -option(WITH_DEBUG_KBD "Print keyboard related debug messages." OFF) -option(WITH_DEBUG_LICENSE "Print license debug messages." OFF) -option(WITH_DEBUG_NEGO "Print negotiation related debug messages." OFF) -option(WITH_DEBUG_NLA "Print authentication related debug messages." OFF) -option(WITH_DEBUG_NTLM "Print NTLM debug messages" OFF) -option(WITH_DEBUG_TSG "Print Terminal Server Gateway debug messages" OFF) -option(WITH_DEBUG_ORDERS "Print drawing orders debug messages" OFF) -option(WITH_DEBUG_RAIL "Print RemoteApp debug messages" OFF) -option(WITH_DEBUG_RDP "Print RDP debug messages" OFF) -option(WITH_DEBUG_REDIR "Redirection debug messages" OFF) -option(WITH_DEBUG_RFX "Print RemoteFX debug messages." OFF) -option(WITH_DEBUG_SCARD "Print smartcard debug messages" OFF) -option(WITH_DEBUG_SVC "Print static virtual channel debug messages." OFF) -option(WITH_DEBUG_TRANSPORT "Print transport debug messages." OFF) -option(WITH_DEBUG_WND "Print window order debug messages" OFF) -option(WITH_DEBUG_X11_CLIPRDR "Print X11 clipboard redirection debug messages" OFF) -option(WITH_DEBUG_X11_LOCAL_MOVESIZE "Print X11 Client local movesize debug messages" OFF) -option(WITH_DEBUG_X11 "Print X11 Client debug messages" OFF) -option(WITH_DEBUG_XV "Print XVideo debug messages" OFF) +option(WITH_DEBUG_ALL "Print all debug messages." OFF) + +if(WITH_DEBUG_ALL) + set(DEFAULT_DEBUG_OPTION "ON") +else() + set(DEFAULT_DEBUG_OPTION "OFF") +endif() + +option(WITH_DEBUG_CERTIFICATE "Print certificate related debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_CLIPRDR "Print clipboard redirection debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_DVC "Print dynamic virtual channel debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_GDI "Print graphics debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_KBD "Print keyboard related debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_LICENSE "Print license debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_NEGO "Print negotiation related debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_NLA "Print authentication related debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_NTLM "Print NTLM debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_TSG "Print Terminal Server Gateway debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_ORDERS "Print drawing orders debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RAIL "Print RemoteApp debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RDP "Print RDP debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_REDIR "Redirection debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_RFX "Print RemoteFX debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_SCARD "Print smartcard debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_SVC "Print static virtual channel debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_TRANSPORT "Print transport debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_TIMEZONE "Print timezone debug messages." ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_WND "Print window order debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_X11_CLIPRDR "Print X11 clipboard redirection debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_X11_LOCAL_MOVESIZE "Print X11 Client local movesize debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_X11 "Print X11 Client debug messages" ${DEFAULT_DEBUG_OPTION}) +option(WITH_DEBUG_XV "Print XVideo debug messages" ${DEFAULT_DEBUG_OPTION}) diff --git a/libfreerdp/crypto/nla.c b/libfreerdp/crypto/nla.c index db53765ef..0d53991f5 100644 --- a/libfreerdp/crypto/nla.c +++ b/libfreerdp/crypto/nla.c @@ -130,7 +130,7 @@ int credssp_ntlm_client_init(rdpCredssp* credssp) #ifdef WITH_DEBUG_NLA _tprintf(_T("User: %s Domain: %s Password: %s\n"), - credssp->identity.User, credssp->identity.Domain, credssp->identity.Password); + (char*) credssp->identity.User, (char*) credssp->identity.Domain, (char*) credssp->identity.Password); #endif sspi_SecBufferAlloc(&credssp->PublicKey, credssp->tls->public_key.length); diff --git a/libfreerdp/locale/timezone.c b/libfreerdp/locale/timezone.c index 0508fb5c1..7abe3911a 100644 --- a/libfreerdp/locale/timezone.c +++ b/libfreerdp/locale/timezone.c @@ -1681,8 +1681,8 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone) clientTimeZone->standardBias = clientTimeZone->bias; clientTimeZone->daylightBias = clientTimeZone->bias + 60; } - DEBUG_TIMEZONE("sbias=%d, bias=%d, stdBias=%d, dlBias=%d", - sbias, clientTimeZone->bias, clientTimeZone->standardBias, + DEBUG_TIMEZONE("Bias: %d, StandardBias: %d, DaylightBias: %d", + clientTimeZone->bias, clientTimeZone->standardBias, clientTimeZone->daylightBias); tz = freerdp_detect_windows_time_zone(clientTimeZone->bias); diff --git a/libfreerdp/utils/svc_plugin.c b/libfreerdp/utils/svc_plugin.c index c7fdc7390..2beff6f37 100644 --- a/libfreerdp/utils/svc_plugin.c +++ b/libfreerdp/utils/svc_plugin.c @@ -395,7 +395,7 @@ int svc_plugin_send(rdpSvcPlugin* plugin, STREAM* data_out) { uint32 error = 0; - DEBUG_SVC("length %d", stream_get_length(data_out)); + DEBUG_SVC("length %d", (int) stream_get_length(data_out)); error = plugin->channel_entry_points.pVirtualChannelWrite(plugin->priv->open_handle, stream_get_data(data_out), stream_get_length(data_out), data_out);