Stas Bekman wrote:
Philippe M. Chiasson wrote:
Happened onto the cute Devel::GDB module and quickly wiped out a patch to make
t/REPORT attempt to automatically generate back traces for core files it finds in t/
Any interest in this ?
Excellent!
Though I doubt that anybody will have this optional module installed. I wish we could find a good way to suggest all the optional modules one wants to install (there are quite a few needed to have 'make test' not skip some tests).
Yeah, too bad ExtUtils::MakeMaker doesn't have an 'optionnal requirements' section like Module::Build 'recommends' option.
We could always write our own, and list a bunch of 'suggested' modules one might want to consider installing, 'LWP' comes to mind as a first candidate.
BTW, there is also http://search.cpan.org/dist/Debug-FaultAutoBT/ but it has some problems sometimes :) But I don't think we need it, since normally we get the core dumped (with the exception to some OSes)
but please drop the spaces in the core_dump code. Thanks...
Will do. And the thread gdb commands also work fine with non-threaded dumps, just sees one thread.
-- -------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
Index: Apache-Test/lib/Apache/TestReport.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestReport.pm,v
retrieving revision 1.14
diff -u -I$Id -r1.14 TestReport.pm
--- Apache-Test/lib/Apache/TestReport.pm 5 Sep 2004 00:11:30 -0000 1.14
+++ Apache-Test/lib/Apache/TestReport.pm 11 Oct 2004 19:32:29 -0000
@@ -21,6 +21,7 @@
use Apache::TestConfig ();
use File::Spec::Functions qw(catfile);
+use File::Find;
sub new {
my $class = shift;
@@ -79,6 +80,31 @@
sub executable { $0 }
+my $core_dump;
+sub core_dump {
+ my $self = shift;
+ $core_dump = "";
+ if ( eval { require Devel::GDB } ) {
+ find(\&dump_core_file, 't')
+ }
+ $core_dump || ' [CORE TRACE COMES HERE]';
+}
+
+sub dump_core_file {
+ return unless /^core\.\d+$/;
+ my $core = $_;
+ my $gdb = new Devel::GDB ();
+ my $test_config = Apache::TestConfig->new({thaw=>1});
+ my $httpd = $test_config->{vars}->{httpd};
+ return unless defined $httpd;
+ $core_dump .= join '',
+ $gdb->get("file $httpd"),
+ $gdb->get('sharedlibrary'),
+ $gdb->get("core $core"),
+ $gdb->get('info threads'),
+ $gdb->get('thread apply all bt');
+}
+
sub date { scalar gmtime() . " GMT" }
sub template {
@@ -94,7 +120,7 @@
3. This is the core dump trace: (if you get a core dump):
- [CORE TRACE COMES HERE]
[EMAIL PROTECTED]@
This report was generated by @EXECUTABLE@ on @[EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
