Added patch for support of process specific debug channels.

This commit is contained in:
Sebastian Lackner
2015-04-17 06:23:19 +02:00
parent 572c6fe243
commit d9bdc6ae51
5 changed files with 87 additions and 1 deletions

View File

@@ -0,0 +1,67 @@
From 90d826bf3bfe4cb92334bdab29fd0b71d5cb947b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 16 Apr 2015 21:23:10 +0200
Subject: libwine: Add process specific debug channels.
---
libs/wine/debug.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/libs/wine/debug.c b/libs/wine/debug.c
index 548ef22..caaf383 100644
--- a/libs/wine/debug.c
+++ b/libs/wine/debug.c
@@ -125,10 +125,22 @@ static void add_option( const char *name, unsigned char set, unsigned char clear
nb_debug_options++;
}
+/* get name of the current process */
+static const char *get_process_name( void )
+{
+ const char *ret, *tmp;
+ if (__wine_main_argc < 2) return NULL;
+ ret = __wine_main_argv[1];
+ if ((tmp = strrchr(ret, '/'))) ret = ++tmp;
+ if ((tmp = strrchr(ret, '\\'))) ret = ++tmp;
+ return ret;
+}
+
/* parse a set of debugging option specifications and add them to the option list */
static void parse_options( const char *str )
{
- char *opt, *next, *options;
+ char *opt, *next, *popt, *options;
+ const char *process = get_process_name();
unsigned int i;
if (!(options = strdup(str))) return;
@@ -139,6 +151,17 @@ static void parse_options( const char *str )
if ((next = strchr( opt, ',' ))) *next++ = 0;
+ if ((popt = strchr( opt, ':' )))
+ {
+ unsigned int inv = 0;
+ *popt = 0;
+ if (!process) continue;
+ if (*opt == '-' || *opt == '+')
+ inv = (*opt++ == '-');
+ if (inv == !strcmp( opt, process )) continue;
+ opt = ++popt;
+ }
+
p = opt + strcspn( opt, "+-" );
if (!p[0]) p = opt; /* assume it's a debug channel name */
@@ -180,7 +203,7 @@ static void debug_usage(void)
{
static const char usage[] =
"Syntax of the WINEDEBUG variable:\n"
- " WINEDEBUG=[class]+xxx,[class]-yyy,...\n\n"
+ " WINEDEBUG=[+process:][class]+xxx,[-process:][class]-yyy,...\n\n"
"Example: WINEDEBUG=+all,warn-heap\n"
" turns on all messages except warning heap messages\n"
"Available message classes: err, warn, fixme, trace\n";
--
2.3.5

View File

@@ -0,0 +1 @@
Fixes: Add support for process specific debug channels

View File

@@ -123,6 +123,7 @@ patch_enable_all ()
enable_kernel32_Profile="$1"
enable_kernel32_SetFileInformationByHandle="$1"
enable_kernel32_VerifyVersionInfo="$1"
enable_libs_Debug_Channel="$1"
enable_libs_Unicode_Collation="$1"
enable_makedep_PARENTSPEC="$1"
enable_mmdevapi_AEV_Stubs="$1"
@@ -437,6 +438,9 @@ patch_enable ()
kernel32-VerifyVersionInfo)
enable_kernel32_VerifyVersionInfo="$2"
;;
libs-Debug_Channel)
enable_libs_Debug_Channel="$2"
;;
libs-Unicode_Collation)
enable_libs_Unicode_Collation="$2"
;;
@@ -2927,6 +2931,18 @@ if test "$enable_kernel32_VerifyVersionInfo" -eq 1; then
) >> "$patchlist"
fi
# Patchset libs-Debug_Channel
# |
# | Modified files:
# | * libs/wine/debug.c
# |
if test "$enable_libs_Debug_Channel" -eq 1; then
patch_apply libs-Debug_Channel/0001-libwine-Add-process-specific-debug-channels.patch
(
echo '+ { "Michael Müller", "libwine: Add process specific debug channels.", 1 },';
) >> "$patchlist"
fi
# Patchset libs-Unicode_Collation
# |
# | This patchset fixes the following Wine bugs: