1
package GenTest::Reporter::Backtrace;
4
@ISA = qw(GenTest::Reporter);
8
use GenTest::Constants;
10
use GenTest::Incident;
14
my $datadir = $reporter->serverVariable('datadir');
15
say("datadir is $datadir");
16
my $binary = $reporter->serverInfo('binary');
17
my $bindir = $reporter->serverInfo('bindir');
19
my $pid = $reporter->serverInfo('pid');
20
my $core = <$datadir/core*>;
21
$core = </cores/core.$pid> if $^O eq 'darwin';
22
say("Core file appears to be $core");
27
$bindir =~ s{/}{\\}sgio;
28
my $cdb_cmd = "!sym prompts off; !analyze -v; .ecxr; !for_each_frame dv /t;~*k;q";
29
push @commands, 'cdb -i "'.$bindir.'" -y "'.$bindir.';srv*C:\\cdb_symbols*http://msdl.microsoft.com/download/symbols" -z "'.$datadir.'\mysqld.dmp" -lines -c "'.$cdb_cmd.'"';
31
push @commands, "gdb --batch --se=$binary --core=$core --command=backtrace.gdb";
32
push @commands, "gdb --batch --se=$binary --core=$core --command=backtrace-all.gdb";
35
if ($^O eq 'solaris') {
36
push @commands, "echo '::stack' | mdb $core | c++filt";
41
foreach my $command (@commands) {
42
my $output = `$command`;
44
push @debugs, [$command, $output];
48
my $incident = GenTest::Incident->new(
53
return STATUS_OK, $incident;
57
return REPORTER_TYPE_CRASH | REPORTER_TYPE_DEADLOCK;