2004-10-04 19:28:43 +00:00
|
|
|
#!/usr/bin/perl -w
|
1999-01-26 17:22:15 +00:00
|
|
|
##Wine Quick Debug Report Maker Thingy (WQDRMK)
|
2003-11-26 05:05:17 +00:00
|
|
|
## Copyright (c) 1998-1999 Adam Sacarny jazz@cscweb.net ICQ: 19617831
|
1999-01-26 17:22:15 +00:00
|
|
|
##Do not say this is yours without my express permisson, or I will
|
|
|
|
##hunt you down and kill you like the savage animal I am.
|
2000-03-15 19:04:25 +00:00
|
|
|
##
|
|
|
|
## Improvements by Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
|
|
|
|
## (c) 2000
|
|
|
|
##
|
2004-03-27 20:42:34 +00:00
|
|
|
## A few improovements and updates here and there
|
2004-05-27 02:25:13 +00:00
|
|
|
## Copyright 2003-2004 Ivan Leo Puoti
|
2003-11-25 01:47:22 +00:00
|
|
|
##
|
2002-03-09 23:29:33 +00:00
|
|
|
## This library is free software; you can redistribute it and/or
|
|
|
|
## modify it under the terms of the GNU Lesser General Public
|
|
|
|
## License as published by the Free Software Foundation; either
|
|
|
|
## version 2.1 of the License, or (at your option) any later version.
|
|
|
|
##
|
|
|
|
## This library is distributed in the hope that it will be useful,
|
|
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
## Lesser General Public License for more details.
|
|
|
|
##
|
|
|
|
## You should have received a copy of the GNU Lesser General Public
|
|
|
|
## License along with this library; if not, write to the Free Software
|
|
|
|
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2000-03-15 19:04:25 +00:00
|
|
|
##
|
2002-06-01 02:55:48 +00:00
|
|
|
##Changelog:
|
1999-09-10 13:53:20 +00:00
|
|
|
##August 29, 1999 - Work around for debugger exit (or lack thereof)
|
|
|
|
## - Should now put debugging output in correct place
|
2003-01-05 01:08:56 +00:00
|
|
|
##April 19, 1999 - Much nicer way to select Wine's location
|
1999-04-25 09:20:40 +00:00
|
|
|
## - Option to disable creation of a debugging output
|
|
|
|
## - Now places debugging output where it was started
|
1999-04-06 06:59:49 +00:00
|
|
|
##April 4, 1999 - Sanity check for file locations/wine strippedness
|
|
|
|
## - Various code cleanups/fixes
|
1999-03-22 12:39:49 +00:00
|
|
|
##March 21, 1999 - Bash 2.0 STDERR workaround (Thanks Ryan Cumming!)
|
|
|
|
##March 1, 1999 - Check for stripped build
|
1999-02-09 14:07:49 +00:00
|
|
|
##February 3, 1999 - Fix to chdir to the program's directory
|
|
|
|
##February 1, 1999 - Cleaned up code
|
1999-01-28 09:55:51 +00:00
|
|
|
##January 26, 1999 - Fixed various bugs...
|
|
|
|
## - Made newbie mode easier
|
|
|
|
##January 25, 1999 - Initial Release
|
2004-10-04 19:28:43 +00:00
|
|
|
use strict;
|
|
|
|
sub do_var($) {
|
|
|
|
my $var=$_[0];
|
1999-02-09 14:07:49 +00:00
|
|
|
$var =~ s/\t//g;
|
|
|
|
return $var;
|
|
|
|
}
|
2002-06-01 02:55:48 +00:00
|
|
|
open STDERR, ">&SAVEERR"; open STDERR, ">&STDOUT";
|
1999-01-28 09:55:51 +00:00
|
|
|
$ENV{'SHELL'}="/bin/bash";
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var0 = qq{
|
2003-01-05 01:08:56 +00:00
|
|
|
What is your level of Wine expertise? 1-newbie 2-intermediate 3-advanced
|
2002-06-01 02:55:48 +00:00
|
|
|
|
2003-01-05 01:08:56 +00:00
|
|
|
1 - Makes a debug report as defined in the Wine documentation. Best
|
2004-03-27 20:42:34 +00:00
|
|
|
for new Wine users. If you're not sure what WINEDEBUG is, then
|
2000-03-15 19:04:25 +00:00
|
|
|
use this mode.
|
1999-02-09 14:07:49 +00:00
|
|
|
2 - Makes a debug report that is more customizable (Example: you can
|
2004-03-27 20:42:34 +00:00
|
|
|
choose what WINEDEBUG to use). You are asked more questions in
|
2000-03-15 19:04:25 +00:00
|
|
|
this mode. May intimidate newbies.
|
1999-02-09 14:07:49 +00:00
|
|
|
3 - Just like 2, but not corner cutting. Assumes you know what you're
|
2000-03-15 19:04:25 +00:00
|
|
|
doing so it leaves out the long descriptions.
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
2000-03-15 19:04:25 +00:00
|
|
|
print do_var($var0)."\n";
|
2004-10-04 19:28:43 +00:00
|
|
|
my $debuglevel=0;
|
2000-03-17 15:07:52 +00:00
|
|
|
until ($debuglevel >= 1 and $debuglevel <= 3) {
|
2003-01-05 01:08:56 +00:00
|
|
|
print "Enter your level of Wine expertise (1-3): ";
|
1999-02-09 14:07:49 +00:00
|
|
|
$debuglevel=<STDIN>;
|
|
|
|
chomp $debuglevel;
|
2002-06-01 02:55:48 +00:00
|
|
|
}
|
2000-03-15 19:04:25 +00:00
|
|
|
|
1999-01-26 17:22:15 +00:00
|
|
|
if ($debuglevel < 3) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var1 = qq{
|
2003-01-05 01:08:56 +00:00
|
|
|
This program will make a debug report for Wine developers. It generates
|
2000-03-24 19:48:05 +00:00
|
|
|
two files. The first one has everything asked for by the bugreports guide;
|
|
|
|
the second has *all* of the debug output, which can go to thousands of
|
|
|
|
lines.
|
2002-05-08 23:14:19 +00:00
|
|
|
To (hopefully) get the bug fixed, report it to the project
|
2003-11-26 03:55:01 +00:00
|
|
|
bug tracking system at http://bugs.winehq.org.
|
2002-05-08 23:14:19 +00:00
|
|
|
Attach the first file to the bug description.
|
|
|
|
Also include detailed description of the problem. The developers
|
2000-03-24 19:48:05 +00:00
|
|
|
might ask you for "the last X lines from the report". If so, just
|
|
|
|
provide the output of the following command:
|
|
|
|
gzip -d (output file) | tail -n (X) > outfile
|
|
|
|
If you do not want to create one of the files, just specify "no file".
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var1);
|
|
|
|
} elsif ($debuglevel =~ 3) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var2 = qq{
|
1999-02-09 14:07:49 +00:00
|
|
|
This program will output to two files:
|
|
|
|
1. Formatted debug report you might want to post to the newsgroup
|
|
|
|
2. File with ALL the debug output (It will later be compressed with
|
|
|
|
gzip, so leave off the trailing .gz)
|
1999-04-25 09:20:40 +00:00
|
|
|
If you do not want to create one of the files, just type in "no file"
|
|
|
|
and I'll skip it.
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var2);
|
1999-01-26 17:22:15 +00:00
|
|
|
}
|
2000-03-24 19:48:05 +00:00
|
|
|
|
|
|
|
print "\nFilename for the formatted debug report: ";
|
2004-10-04 19:28:43 +00:00
|
|
|
my $outfile=<STDIN>;
|
1999-01-26 17:22:15 +00:00
|
|
|
chomp $outfile;
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var23 = qq{
|
1999-04-06 06:59:49 +00:00
|
|
|
I don't think you typed in the right filename. Let's try again.
|
|
|
|
};
|
|
|
|
while ($outfile =~ /^(\s)*$/) {
|
|
|
|
print do_var($var23);
|
|
|
|
$outfile=<STDIN>;
|
|
|
|
chomp $outfile;
|
|
|
|
}
|
2000-03-24 19:48:05 +00:00
|
|
|
|
|
|
|
print "Filename for full debug output: ";
|
2004-10-04 19:28:43 +00:00
|
|
|
my $dbgoutfile=<STDIN>;
|
1999-01-26 17:22:15 +00:00
|
|
|
chomp $dbgoutfile;
|
1999-04-06 06:59:49 +00:00
|
|
|
while ($dbgoutfile =~ /^(\s)*$/) {
|
|
|
|
print do_var($var23);
|
|
|
|
$dbgoutfile=<STDIN>;
|
|
|
|
chomp $dbgoutfile;
|
|
|
|
}
|
2000-03-24 19:48:05 +00:00
|
|
|
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var31 = qq{
|
1999-09-10 13:53:20 +00:00
|
|
|
Since you will only be creating the formatted report, I will need a
|
|
|
|
temporary place to put the full output.
|
|
|
|
You may not enter "no file" for this.
|
|
|
|
Enter the filename for the temporary file:
|
|
|
|
};
|
2004-10-04 19:28:43 +00:00
|
|
|
my $tmpoutfile;
|
1999-09-10 13:53:20 +00:00
|
|
|
if ($outfile ne "no file" and $dbgoutfile eq "no file") {
|
|
|
|
print do_var($var31);
|
|
|
|
$tmpoutfile=<STDIN>;
|
|
|
|
chomp $tmpoutfile;
|
|
|
|
while (($tmpoutfile =~ /^(\s)*$/) or ($tmpoutfile eq "no file")) {
|
|
|
|
print do_var($var23);
|
|
|
|
$tmpoutfile=<STDIN>;
|
|
|
|
chomp $tmpoutfile;
|
|
|
|
}
|
|
|
|
}
|
2000-03-15 19:04:25 +00:00
|
|
|
|
2004-10-04 19:28:43 +00:00
|
|
|
my $whereis=`whereis wine`;
|
1999-04-25 09:20:40 +00:00
|
|
|
chomp $whereis;
|
2000-03-17 15:07:52 +00:00
|
|
|
print "\nWhere is your copy of Wine located?\n\n";
|
1999-04-25 09:20:40 +00:00
|
|
|
$whereis =~ s/^wine\: //;
|
2004-10-04 19:28:43 +00:00
|
|
|
my @locations = split(/\s/,$whereis);
|
2000-03-17 15:07:52 +00:00
|
|
|
print "1 - Unlisted (I'll prompt you for a new location\n";
|
|
|
|
print "2 - Unsure (I'll use #3, that's probably it)\n";
|
2004-10-04 19:28:43 +00:00
|
|
|
my $i=2;
|
|
|
|
foreach my $location (@locations) {
|
1999-04-25 09:20:40 +00:00
|
|
|
$i++;
|
2000-03-17 15:07:52 +00:00
|
|
|
print "$i - $location\n";
|
1999-04-25 09:20:40 +00:00
|
|
|
}
|
2000-03-17 15:07:52 +00:00
|
|
|
print "\n";
|
2004-10-04 19:28:43 +00:00
|
|
|
sub select_wineloc() {
|
|
|
|
my $wineloc;
|
2000-03-17 15:07:52 +00:00
|
|
|
do
|
|
|
|
{
|
2000-03-24 19:48:05 +00:00
|
|
|
print "Enter the number that corresponds to Wine's location: ";
|
|
|
|
$wineloc=<STDIN>;
|
|
|
|
chomp $wineloc;
|
1999-04-25 09:20:40 +00:00
|
|
|
}
|
2000-03-24 19:48:05 +00:00
|
|
|
while ( ! ( $wineloc >=1 and $wineloc <= 2+@locations ) );
|
1999-04-25 09:20:40 +00:00
|
|
|
if ($wineloc == 1) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var25 = qq{
|
1999-04-25 09:20:40 +00:00
|
|
|
Enter the full path to wine (Example: /usr/bin/wine):
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var26 = qq{
|
1999-04-25 09:20:40 +00:00
|
|
|
Please enter the full path to wine. A full path is the
|
|
|
|
directories leading up to a program's location, and then the
|
|
|
|
program. For example, if you had the program "wine" in the
|
|
|
|
directory "/usr/bin", you would type in "/usr/bin/wine". Now
|
|
|
|
try:
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
1999-04-25 09:20:40 +00:00
|
|
|
print do_var($var25) if $debuglevel == 3;
|
|
|
|
print do_var($var26) if $debuglevel < 3;
|
|
|
|
$wineloc=<STDIN>;
|
|
|
|
chomp $wineloc;
|
|
|
|
while ($wineloc =~ /^(\s)*$/) {
|
|
|
|
print do_var($var23);
|
|
|
|
$wineloc=<STDIN>;
|
|
|
|
chomp $wineloc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elsif ($wineloc == 2) {
|
|
|
|
$wineloc=$locations[0];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$wineloc=$locations[$wineloc-3];
|
1999-02-09 14:07:49 +00:00
|
|
|
}
|
2004-10-04 19:28:43 +00:00
|
|
|
return $wineloc;
|
1999-04-06 06:59:49 +00:00
|
|
|
}
|
2004-10-04 19:28:43 +00:00
|
|
|
my $wineloc=select_wineloc();
|
1999-03-22 12:39:49 +00:00
|
|
|
print "Checking if $wineloc is stripped...\n";
|
2004-10-04 19:28:43 +00:00
|
|
|
my $ifstrip = `nm $wineloc 2>&1`;
|
1999-04-06 06:59:49 +00:00
|
|
|
while ($ifstrip =~ /no symbols/) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var24 = qq{
|
2003-11-25 01:47:22 +00:00
|
|
|
Your wine is stripped! Stripped versions make useless debug reports
|
1999-04-06 06:59:49 +00:00
|
|
|
If you have another location of wine that may be used, enter it now.
|
2003-11-25 01:47:22 +00:00
|
|
|
Otherwise, hit control-c and download an unstripped (Debug) version, then re-run
|
|
|
|
this script.
|
1999-04-06 06:59:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var24);
|
2004-10-04 19:28:43 +00:00
|
|
|
$wineloc=select_wineloc();
|
1999-04-25 09:20:40 +00:00
|
|
|
$ifstrip = `nm $wineloc 2>&1`;
|
|
|
|
}
|
|
|
|
while ($ifstrip =~ /not recognized/) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var26 = qq{
|
2003-01-05 01:08:56 +00:00
|
|
|
Looks like you gave me something that isn't a Wine binary (It could be a
|
1999-04-25 09:20:40 +00:00
|
|
|
text file). Try again.
|
|
|
|
};
|
|
|
|
print do_var($var26);
|
2004-10-04 19:28:43 +00:00
|
|
|
$wineloc=select_wineloc();
|
1999-04-25 09:20:40 +00:00
|
|
|
print "Checking if $wineloc is stripped...\n";
|
1999-04-06 06:59:49 +00:00
|
|
|
$ifstrip = `nm $wineloc 2>&1`;
|
1999-03-22 12:39:49 +00:00
|
|
|
}
|
2000-03-24 19:48:05 +00:00
|
|
|
|
2003-01-05 01:08:56 +00:00
|
|
|
print "\nWhat version of Windows are you using with Wine?\n\n".
|
2000-03-24 19:48:05 +00:00
|
|
|
"0 - None\n".
|
|
|
|
"1 - Windows 3.x\n".
|
|
|
|
"2 - Windows 95\n".
|
|
|
|
"3 - Windows 98\n".
|
2003-11-25 01:47:22 +00:00
|
|
|
"4 - Windows ME\n".
|
|
|
|
"5 - Windows NT 3.5x\n".
|
|
|
|
"6 - Windows NT4.x\n".
|
|
|
|
"7 - Windows 2000\n".
|
|
|
|
"8 - Windows XP\n".
|
|
|
|
"9 - Windows Server 2003\n".
|
|
|
|
"10 - Other\n\n";
|
2004-10-04 19:28:43 +00:00
|
|
|
my $winver;
|
2000-03-24 19:48:05 +00:00
|
|
|
do
|
|
|
|
{
|
2003-01-05 01:08:56 +00:00
|
|
|
print "Enter the number that corresponds to your Windows version: ";
|
2002-06-01 02:55:48 +00:00
|
|
|
$winver=<STDIN>;
|
|
|
|
chomp $winver;
|
2000-03-24 19:48:05 +00:00
|
|
|
}
|
2003-11-25 01:47:22 +00:00
|
|
|
until ($winver >= 0 and $winver <= 10);
|
2002-06-01 02:55:48 +00:00
|
|
|
if ($winver =~ 0) {
|
|
|
|
$winver="None Installed";
|
|
|
|
} elsif ($winver =~ 1) {
|
|
|
|
$winver="Windows 3.x";
|
|
|
|
} elsif ($winver =~ 2) {
|
|
|
|
$winver="Windows 95";
|
|
|
|
} elsif ($winver =~ 3) {
|
|
|
|
$winver="Windows 98";
|
|
|
|
} elsif ($winver =~ 4) {
|
2003-11-25 01:47:22 +00:00
|
|
|
$winver="Windows ME";
|
2002-06-01 02:55:48 +00:00
|
|
|
} elsif ($winver =~ 5) {
|
2003-11-25 01:47:22 +00:00
|
|
|
$winver="Windows NT 3.5x";
|
2002-06-01 02:55:48 +00:00
|
|
|
} elsif ($winver =~ 6) {
|
2003-11-25 01:47:22 +00:00
|
|
|
$winver="Windows NT 4.x";
|
2002-06-01 02:55:48 +00:00
|
|
|
} elsif ($winver =~ 7) {
|
2003-11-25 01:47:22 +00:00
|
|
|
$winver="Windows 2000";
|
2003-01-02 17:53:26 +00:00
|
|
|
} elsif ($winver =~ 8) {
|
2003-11-25 01:47:22 +00:00
|
|
|
$winver="Windows XP";
|
|
|
|
} elsif ($winver =~ 9) {
|
|
|
|
$winver="Windows Server 2003";
|
|
|
|
} elsif ($winver =~ 10) {
|
2000-03-24 19:48:05 +00:00
|
|
|
print "What version of Windows are you using? ";
|
2002-06-01 02:55:48 +00:00
|
|
|
$winver=<STDIN>;
|
|
|
|
chomp $winver;
|
1999-02-09 14:07:49 +00:00
|
|
|
}
|
1999-01-26 17:22:15 +00:00
|
|
|
if ($debuglevel < 3) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var7 = qq{
|
1999-02-09 14:07:49 +00:00
|
|
|
Enter the full path to the program you want to run. Remember what you
|
|
|
|
were told before - a full path is the directories leading up to the
|
|
|
|
program and then the program's name, like /dos/windows/sol.exe, not
|
|
|
|
sol.exe:
|
|
|
|
};
|
|
|
|
print do_var($var7);
|
1999-01-26 17:22:15 +00:00
|
|
|
}
|
|
|
|
if ($debuglevel =~ 3) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var8 = qq{
|
2002-06-01 02:55:48 +00:00
|
|
|
Enter the full path to the program you want to run (Example:
|
|
|
|
/dos/windows/sol.exe, NOT sol.exe):
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var8);
|
2002-06-01 02:55:48 +00:00
|
|
|
}
|
2004-10-04 19:28:43 +00:00
|
|
|
my $program=<STDIN>;
|
1999-01-26 17:22:15 +00:00
|
|
|
chomp $program;
|
1999-04-06 06:59:49 +00:00
|
|
|
while ($program =~ /^(\s)*$/) {
|
|
|
|
print do_var($var23);
|
|
|
|
$program=<STDIN>;
|
|
|
|
chomp $program;
|
|
|
|
}
|
|
|
|
$program =~ s/\"//g;
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var9 = qq{
|
1999-01-26 17:22:15 +00:00
|
|
|
Enter the name, version, and manufacturer of the program (Example:
|
|
|
|
Netscape Navigator 4.5):
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var9);
|
2004-10-04 19:28:43 +00:00
|
|
|
my $progname=<STDIN>;
|
1999-01-26 17:22:15 +00:00
|
|
|
chomp $progname;
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var10 = qq{
|
2003-11-25 01:47:22 +00:00
|
|
|
Enter 1 if your program is 16 bit (Windows 3.x), 2 if your program is 32
|
|
|
|
bit (Windows 95, NT3.x and up), or 3 if you are unsure:
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var10);
|
2004-10-04 19:28:43 +00:00
|
|
|
my $progbits=<STDIN>;
|
1999-01-26 17:22:15 +00:00
|
|
|
chomp $progbits;
|
2003-11-25 01:47:22 +00:00
|
|
|
until ($progbits == 1 or $progbits == 2 or $progbits == 3) {
|
|
|
|
print "You must enter 1, 2 or 3!\n";
|
1999-02-09 14:07:49 +00:00
|
|
|
$progbits=<STDIN>;
|
2002-06-01 02:55:48 +00:00
|
|
|
chomp $progbits
|
1999-01-26 17:22:15 +00:00
|
|
|
}
|
2003-11-25 01:47:22 +00:00
|
|
|
if ($progbits =~ 1) {
|
2004-10-04 19:28:43 +00:00
|
|
|
$progbits = "Win16";
|
2003-11-25 01:47:22 +00:00
|
|
|
} elsif ($progbits =~ 2) {
|
2004-10-04 19:28:43 +00:00
|
|
|
$progbits = "Win32";
|
2002-06-01 02:55:48 +00:00
|
|
|
} else {
|
2004-10-04 19:28:43 +00:00
|
|
|
$progbits = "Unsure";
|
2002-06-01 02:55:48 +00:00
|
|
|
}
|
2004-10-04 19:28:43 +00:00
|
|
|
my $debugopts;
|
1999-01-26 17:22:15 +00:00
|
|
|
if ($debuglevel > 1) {
|
1999-02-09 14:07:49 +00:00
|
|
|
if ($debuglevel =~ 2) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var11 = qq{
|
1999-02-09 14:07:49 +00:00
|
|
|
Enter any extra debug options. Default is +relay - If you don't
|
|
|
|
know what options to use, just hit enter, and I'll use those (Example, the
|
2004-03-27 20:42:34 +00:00
|
|
|
developer tells you to re-run with WINEDEBUG=+dosfs,+module you would type
|
1999-02-09 14:07:49 +00:00
|
|
|
in +dosfs,+module). Hit enter if you're not sure what to do:
|
|
|
|
};
|
|
|
|
print do_var($var11);
|
|
|
|
} elsif ($debuglevel =~ 3) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var12 = qq{
|
1999-02-09 14:07:49 +00:00
|
|
|
Enter any debug options you would like to use. Just enter parts after
|
2004-03-27 20:42:34 +00:00
|
|
|
WINEDEBUG. Default is +relay:
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var12);
|
|
|
|
}
|
|
|
|
$debugopts=<STDIN>;
|
|
|
|
chomp $debugopts;
|
2003-11-26 05:05:17 +00:00
|
|
|
if ($debugopts =~ /--debugmsg /) {
|
2004-10-04 19:28:43 +00:00
|
|
|
$debugopts = (split / /,$debugopts)[1];
|
|
|
|
}
|
2004-03-31 00:55:25 +00:00
|
|
|
if ($debugopts =~ /WINEDEBUG= /) {
|
2004-10-04 19:28:43 +00:00
|
|
|
$debugopts = (split / /,$debugopts)[1];
|
2002-06-01 02:55:48 +00:00
|
|
|
}
|
|
|
|
if ($debugopts =~ /^\s*$/) {
|
|
|
|
$debugopts="+relay";
|
1999-02-09 14:07:49 +00:00
|
|
|
}
|
|
|
|
} elsif ($debuglevel =~ 1) {
|
2002-06-01 02:55:48 +00:00
|
|
|
$debugopts = "+relay";
|
|
|
|
}
|
2004-10-04 19:28:43 +00:00
|
|
|
my $lastnlines;
|
1999-01-28 09:55:51 +00:00
|
|
|
if ($debuglevel > 1) {
|
1999-02-09 14:07:49 +00:00
|
|
|
if ($debuglevel =~ 2) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var13 = qq{
|
1999-02-09 14:07:49 +00:00
|
|
|
How many trailing lines of debugging info do you want to include in the report
|
|
|
|
you're going to submit (First file)? If a developer asks you to include
|
2003-01-02 17:53:26 +00:00
|
|
|
the last 15000 lines, enter 15000 here. Default is 3000, which is reached by
|
1999-02-09 14:07:49 +00:00
|
|
|
pressing enter. (If you're not sure, just hit enter):
|
|
|
|
};
|
|
|
|
print do_var($var13);
|
|
|
|
} elsif ($debuglevel =~ 3) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var14 = qq{
|
1999-02-09 14:07:49 +00:00
|
|
|
Enter how many lines of trailing debugging output you want in your nice
|
2003-01-02 17:53:26 +00:00
|
|
|
formatted report. Default is 3000:
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var14);
|
|
|
|
}
|
|
|
|
$lastnlines=<STDIN>;
|
|
|
|
chomp $lastnlines;
|
2002-06-01 02:55:48 +00:00
|
|
|
if ($lastnlines =~ /^\s*$/) {
|
2003-01-02 17:53:26 +00:00
|
|
|
$lastnlines=3000;
|
2002-06-01 02:55:48 +00:00
|
|
|
}
|
1999-02-09 14:07:49 +00:00
|
|
|
} elsif ($debuglevel =~ 1) {
|
2003-01-02 17:53:26 +00:00
|
|
|
$lastnlines=3000;
|
1999-01-28 09:55:51 +00:00
|
|
|
}
|
2004-10-04 19:28:43 +00:00
|
|
|
my $extraops;
|
2002-06-01 02:55:48 +00:00
|
|
|
if ($debuglevel > 1) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var15 = qq{
|
2003-01-05 01:08:56 +00:00
|
|
|
Enter any extra options you want to pass to Wine.
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var15);
|
|
|
|
$extraops=<STDIN>;
|
|
|
|
chomp $extraops;
|
|
|
|
} elsif ($debuglevel =~ 1) {
|
2002-05-30 20:08:26 +00:00
|
|
|
$extraops=" ";
|
1999-01-28 09:55:51 +00:00
|
|
|
}
|
2000-03-24 19:48:05 +00:00
|
|
|
|
2004-03-27 20:42:34 +00:00
|
|
|
print "\nEnter the name of your distribution (Example: RedHat 9.0): ";
|
2004-10-04 19:28:43 +00:00
|
|
|
my $dist=<STDIN>;
|
1999-01-26 17:22:15 +00:00
|
|
|
chomp $dist;
|
2000-03-24 19:48:05 +00:00
|
|
|
|
2004-10-04 19:28:43 +00:00
|
|
|
my $configopts;
|
1999-01-26 17:22:15 +00:00
|
|
|
if ($debuglevel > 1) {
|
1999-02-09 14:07:49 +00:00
|
|
|
if ($debuglevel =~ 2) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var16 = qq{
|
1999-02-09 14:07:49 +00:00
|
|
|
When you ran ./configure to build wine, were there any special options
|
|
|
|
you used to do so (Example: --enable-dll)? If you didn't use any special
|
2003-11-25 01:47:22 +00:00
|
|
|
options or didn't compile Wine yourself, just hit enter:
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var16);
|
|
|
|
} elsif ($debuglevel =~ 3) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var17 = qq{
|
2003-01-05 01:08:56 +00:00
|
|
|
Enter any special options you used when running ./configure for Wine
|
|
|
|
(Default is none, use if you didn't compile Wine yourself):
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var17);
|
|
|
|
}
|
|
|
|
$configopts=<STDIN>;
|
|
|
|
chomp $configopts;
|
2002-06-01 02:55:48 +00:00
|
|
|
if ($configopts =~ /^\s*$/) {
|
|
|
|
$configopts="None";
|
|
|
|
}
|
1999-02-09 14:07:49 +00:00
|
|
|
} elsif ($debuglevel =~ 1) {
|
2002-06-01 02:55:48 +00:00
|
|
|
$configopts="None";
|
1999-01-26 17:22:15 +00:00
|
|
|
}
|
2004-10-04 19:28:43 +00:00
|
|
|
my $winever;
|
1999-01-26 17:22:15 +00:00
|
|
|
if ($debuglevel > 1) {
|
1999-02-09 14:07:49 +00:00
|
|
|
if ($debuglevel =~ 2) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var18 = qq{
|
2003-11-25 01:47:22 +00:00
|
|
|
Is your Wine version CVS or from a .tar.gz or RPM file? As in... did you download it
|
1999-02-09 14:07:49 +00:00
|
|
|
off a website/ftpsite or did you/have you run cvs on it to update it?
|
2004-03-27 20:42:34 +00:00
|
|
|
For CVS: YYYYMMDD, where YYYY is the year (2004), MM is the month (03), and DD
|
|
|
|
is the day (09), that you last updated it (Example: 20040309).
|
2003-11-25 01:47:22 +00:00
|
|
|
For tar.gz and RPM: Just hit enter and I'll figure out the version for you:
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var18);
|
|
|
|
} elsif ($debuglevel =~ 3) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var19 = qq{
|
2003-01-05 01:08:56 +00:00
|
|
|
Is your Wine from CVS? Enter the last CVS update date for it here, in
|
2003-11-25 01:47:22 +00:00
|
|
|
YYYYMMDD form (If it's from a tarball or RPM, just hit enter):
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var19);
|
|
|
|
}
|
|
|
|
$winever=<STDIN>;
|
|
|
|
chomp $winever;
|
2002-06-01 02:55:48 +00:00
|
|
|
if ($winever =~ /[0-9]+/) {
|
1999-02-09 14:07:49 +00:00
|
|
|
$winever .= " CVS";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$winever = `$wineloc -v 2>&1`;
|
|
|
|
chomp $winever;
|
2002-06-01 02:55:48 +00:00
|
|
|
}
|
1999-02-09 14:07:49 +00:00
|
|
|
} elsif ($debuglevel =~ 1) {
|
|
|
|
$winever=`$wineloc -v 2>&1`;
|
|
|
|
chomp $winever;
|
1999-01-26 17:22:15 +00:00
|
|
|
}
|
2004-10-04 19:28:43 +00:00
|
|
|
my $gccver=`gcc -v 2>&1`;
|
|
|
|
$gccver = (split /\n/,$gccver)[1];
|
1999-01-26 17:22:15 +00:00
|
|
|
chomp $gccver;
|
2004-10-04 19:28:43 +00:00
|
|
|
my $cpu=`uname -m`;
|
1999-01-26 17:22:15 +00:00
|
|
|
chomp $cpu;
|
2004-10-04 19:28:43 +00:00
|
|
|
my $kernelver=`uname -r`;
|
1999-01-26 17:22:15 +00:00
|
|
|
chomp $kernelver;
|
2004-10-04 19:28:43 +00:00
|
|
|
my $ostype=`uname -s`;
|
1999-01-26 17:22:15 +00:00
|
|
|
chomp $ostype;
|
2004-10-04 19:28:43 +00:00
|
|
|
my $wineneeds=`ldd $wineloc`;
|
1999-01-26 17:22:15 +00:00
|
|
|
if ($debuglevel < 3) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var20 = qq{
|
2003-01-05 01:08:56 +00:00
|
|
|
OK, now I'm going to run Wine. I will close it for you once the Wine
|
1999-02-09 14:07:49 +00:00
|
|
|
debugger comes up. NOTE: You won't see ANY debug messages. Don't
|
|
|
|
worry, they are being output to a file. Since there are so many, it's
|
2002-06-01 02:55:48 +00:00
|
|
|
not a good idea to have them all output to a terminal (Speed slowdown
|
1999-02-09 14:07:49 +00:00
|
|
|
mainly).
|
2003-01-05 01:08:56 +00:00
|
|
|
Wine will still run much slower than normal, because there will be so
|
2002-06-01 02:55:48 +00:00
|
|
|
many debug messages being output to file.
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var20);
|
|
|
|
} elsif ($debuglevel =~ 3) {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var21 = qq{
|
2003-01-05 01:08:56 +00:00
|
|
|
OK, now it's time to run Wine. I will close down Wine for you after
|
1999-02-09 14:07:49 +00:00
|
|
|
the debugger is finished doing its thing.
|
|
|
|
};
|
|
|
|
print do_var($var21);
|
1999-01-26 17:22:15 +00:00
|
|
|
}
|
2003-01-05 01:08:56 +00:00
|
|
|
print "Hit enter to start Wine!\n";
|
2004-10-04 19:28:43 +00:00
|
|
|
<STDIN>;
|
|
|
|
my $dir=$program;
|
1999-02-09 14:07:49 +00:00
|
|
|
$dir=~m#(.*)/#;
|
|
|
|
$dir=$1;
|
1999-04-25 09:20:40 +00:00
|
|
|
use Cwd;
|
2004-10-04 19:28:43 +00:00
|
|
|
my $nowdir=getcwd;
|
1999-02-09 14:07:49 +00:00
|
|
|
chdir($dir);
|
1999-09-10 13:53:20 +00:00
|
|
|
if (!($outfile =~ /\//) and $outfile ne "no file") {
|
|
|
|
$outfile = "$nowdir/$outfile";
|
1999-04-25 09:20:40 +00:00
|
|
|
}
|
1999-09-10 13:53:20 +00:00
|
|
|
if (!($dbgoutfile =~ /\//) and $dbgoutfile ne "no file") {
|
|
|
|
$dbgoutfile = "$nowdir/$dbgoutfile";
|
|
|
|
}
|
|
|
|
if (!($tmpoutfile =~ /\//)) {
|
|
|
|
$tmpoutfile = "$nowdir/$tmpoutfile";
|
|
|
|
}
|
|
|
|
$SIG{CHLD}=$SIG{CLD}=sub { wait };
|
2004-10-04 19:28:43 +00:00
|
|
|
my $lastlines;
|
|
|
|
sub generate_outfile();
|
1999-09-10 13:53:20 +00:00
|
|
|
if ($dbgoutfile ne "no file") {
|
|
|
|
unlink("$dbgoutfile");
|
2004-10-04 19:28:43 +00:00
|
|
|
my $pid=fork();
|
|
|
|
if ($pid) {
|
1999-09-10 13:53:20 +00:00
|
|
|
}
|
|
|
|
elsif (defined $pid) {
|
|
|
|
close(0);close(1);close(2);
|
2004-03-27 20:42:34 +00:00
|
|
|
exec "echo quit | WINEDEBUG=$debugopts $wineloc $extraops \"$program\" > $dbgoutfile 2>&1";
|
1999-09-10 13:53:20 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
die "couldn't fork";
|
|
|
|
}
|
|
|
|
while (kill(0, $pid)) {
|
|
|
|
sleep(5);
|
2004-10-04 19:28:43 +00:00
|
|
|
my $last = `tail -n 5 $dbgoutfile | grep Wine-dbg`;
|
1999-09-10 13:53:20 +00:00
|
|
|
if ($last =~ /Wine-dbg/) {
|
|
|
|
kill "TERM", $pid;
|
2004-10-04 19:28:43 +00:00
|
|
|
last;
|
1999-09-10 13:53:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($outfile ne "no file") {
|
|
|
|
$lastlines=`tail -n $lastnlines $dbgoutfile`;
|
|
|
|
system("gzip $dbgoutfile");
|
2004-10-04 19:28:43 +00:00
|
|
|
generate_outfile();
|
1999-09-10 13:53:20 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
system("gzip $dbgoutfile");
|
|
|
|
}
|
1999-04-25 09:20:40 +00:00
|
|
|
}
|
1999-09-10 13:53:20 +00:00
|
|
|
elsif ($outfile ne "no file" and $dbgoutfile eq "no file") {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $pid=fork();
|
|
|
|
if ($pid) {
|
1999-09-10 13:53:20 +00:00
|
|
|
}
|
|
|
|
elsif (defined $pid) {
|
|
|
|
close(0);close(1);close(2);
|
2004-03-27 20:42:34 +00:00
|
|
|
exec "echo quit | WINEDEBUG=$debugopts $wineloc $extraops \"$program\" 2>&1| tee $tmpoutfile | tail -n $lastnlines > $outfile";
|
1999-09-10 13:53:20 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
die "couldn't fork";
|
|
|
|
}
|
|
|
|
print "$outfile $tmpoutfile";
|
|
|
|
while (kill(0, $pid)) {
|
|
|
|
sleep(5);
|
2004-10-04 19:28:43 +00:00
|
|
|
my $last = `tail -n 5 $tmpoutfile | grep Wine-dbg`;
|
1999-09-10 13:53:20 +00:00
|
|
|
if ($last =~ /Wine-dbg/) {
|
|
|
|
kill "TERM", $pid;
|
2004-10-04 19:28:43 +00:00
|
|
|
last;
|
1999-09-10 13:53:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
unlink($tmpoutfile);
|
|
|
|
open(OUTFILE, "$outfile");
|
|
|
|
while (<OUTFILE>) {
|
|
|
|
$lastlines .= $_;
|
|
|
|
}
|
|
|
|
close(OUTFILE);
|
|
|
|
unlink($outfile);
|
2004-10-04 19:28:43 +00:00
|
|
|
generate_outfile();
|
1999-04-25 09:20:40 +00:00
|
|
|
}
|
|
|
|
else {
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var27 = qq{
|
1999-04-25 09:20:40 +00:00
|
|
|
I guess you don't want me to make any debugging output. I'll send
|
|
|
|
it to your terminal. This will be a *lot* of output -- hit enter to
|
|
|
|
continue, control-c to quit.
|
|
|
|
Repeat: this will be a lot of output!
|
|
|
|
};
|
|
|
|
print do_var($var27);
|
2004-10-04 19:28:43 +00:00
|
|
|
<STDIN>;
|
2004-03-27 20:42:34 +00:00
|
|
|
system("$wineloc WINEDEBUG=$debugopts $extraops \"$program\"");
|
1999-04-25 09:20:40 +00:00
|
|
|
}
|
2004-10-04 19:28:43 +00:00
|
|
|
sub generate_outfile() {
|
1999-09-10 13:53:20 +00:00
|
|
|
open(OUTFILE,">$outfile");
|
1999-01-26 17:22:15 +00:00
|
|
|
print OUTFILE <<EOM;
|
2004-03-27 20:42:34 +00:00
|
|
|
Auto-generated debug report by Wine Quick Debug Report Maker Tool:
|
1999-01-26 17:22:15 +00:00
|
|
|
WINE Version: $winever
|
|
|
|
Windows Version: $winver
|
|
|
|
Distribution: $dist
|
|
|
|
Kernel Version: $kernelver
|
|
|
|
OS Type: $ostype
|
|
|
|
CPU: $cpu
|
|
|
|
GCC Version: $gccver
|
|
|
|
Program: $progname
|
|
|
|
Program Type: $progbits
|
2004-03-27 20:42:34 +00:00
|
|
|
Debug Options: WINEDEBUG=$debugopts
|
1999-01-26 17:22:15 +00:00
|
|
|
Other Extra Commands Passed: $extraops
|
|
|
|
Extra ./configure Commands: $configopts
|
2002-06-01 02:55:48 +00:00
|
|
|
Wine Dependencies:
|
1999-01-26 17:22:15 +00:00
|
|
|
$wineneeds
|
|
|
|
Last $lastnlines lines of debug output follows:
|
|
|
|
$lastlines
|
|
|
|
I have a copy of the full debug report, if it is needed.
|
|
|
|
Thank you!
|
|
|
|
EOM
|
1999-04-25 09:20:40 +00:00
|
|
|
}
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var22 = qq{
|
2003-11-26 03:55:01 +00:00
|
|
|
Great! We're finished making the debug report. Please go to http://bugs.winehq.org
|
2003-11-25 01:47:22 +00:00
|
|
|
and enter it as a new bug. Check that nobody has already reported the same bug!
|
1999-04-25 09:20:40 +00:00
|
|
|
};
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var28 = qq{
|
1999-04-25 09:20:40 +00:00
|
|
|
The filename for the formatted report is:
|
1999-01-26 17:22:15 +00:00
|
|
|
$outfile
|
1999-04-25 09:20:40 +00:00
|
|
|
};
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var29 = qq{
|
1999-01-26 17:22:15 +00:00
|
|
|
The filename for the compressed full debug is:
|
|
|
|
$dbgoutfile.gz
|
|
|
|
Note that it is $dbgoutfile.gz, since I compressed it with gzip for you.
|
1999-04-25 09:20:40 +00:00
|
|
|
};
|
2004-10-04 19:28:43 +00:00
|
|
|
my $var30 = qq{
|
2003-11-25 01:47:22 +00:00
|
|
|
If you have any problems with this bug reporting tool,
|
2003-11-26 03:55:01 +00:00
|
|
|
please submit a bug report to Wine bugtracking system at http://bugs.winehq.org
|
2003-11-25 01:47:22 +00:00
|
|
|
or tell the Wine newsgroup (comp.emulators.ms-windows.wine).
|
1999-02-09 14:07:49 +00:00
|
|
|
};
|
|
|
|
print do_var($var22);
|
1999-04-25 09:20:40 +00:00
|
|
|
print do_var($var28) if $outfile ne "no file";
|
|
|
|
print do_var($var29) if $dbgoutfile ne "no file";
|
|
|
|
print do_var($var30);
|