You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-commits@perl.apache.org by pg...@apache.org on 2006/07/12 06:31:43 UTC

svn commit: r421115 - in /perl/Apache-Test/trunk: Changes lib/Apache/TestServer.pm

Author: pgollucci
Date: Tue Jul 11 21:31:42 2006
New Revision: 421115

URL: http://svn.apache.org/viewvc?rev=421115&view=rev
Log:
Allow various debugger names with trailing version
information to be accepted.



Modified:
    perl/Apache-Test/trunk/Changes
    perl/Apache-Test/trunk/lib/Apache/TestServer.pm

Modified: perl/Apache-Test/trunk/Changes
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/Changes?rev=421115&r1=421114&r2=421115&view=diff
==============================================================================
--- perl/Apache-Test/trunk/Changes (original)
+++ perl/Apache-Test/trunk/Changes Tue Jul 11 21:31:42 2006
@@ -8,6 +8,10 @@
 
 =item 1.29-dev
 
+Allow version variants of debuggers to be passed as arguments
+to -debug.  i.e. -debug=gdb65 for systems with multiple
+versions of the same debugger. [Philip M. Gollucci]
+
 On Win32, the Apache executable is called httpd.exe in Apache/2.2,
 so let Apache::TestConfig try to find that if Apache.exe isn't
 found [Randy Kobes]

Modified: perl/Apache-Test/trunk/lib/Apache/TestServer.pm
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/lib/Apache/TestServer.pm?rev=421115&r1=421114&r2=421115&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestServer.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestServer.pm Tue Jul 11 21:31:42 2006
@@ -269,7 +269,8 @@
         $command = qq{ddd --gdb --debugger "gdb -command $file" $httpd};
     }
     else {
-        $command = "gdb $httpd -command $file";
+        ## defaults to gdb if not set in %ENV or via -debug
+        $command = "$debugger $httpd -command $file";
     }
 
     $self->note_debugging;
@@ -300,14 +301,28 @@
 
     $opts->{debugger} ||= $ENV{MP_DEBUGGER} || 'gdb';
 
-    unless ($debuggers{ $opts->{debugger} }) {
+    # XXX: FreeBSD 5.2+
+    #      gdb 6.1 and before segfaults when trying to
+    #      debug httpd startup code. 6.5 has been proven
+    #      to work.  FreeBSD typically installs this as
+    #      gdb65.
+    #      Is it worth it to check the debugger and os version 
+    #      and die ?
+ 
+    unless (grep { /^$opts->{debugger}/ } keys %debuggers) {
         error "$opts->{debugger} is not a supported debugger",
               "These are the supported debuggers: ".
               join ", ", sort keys %debuggers;
         die("\n");
     }
 
-    my $method = "start_" . $debuggers{ $opts->{debugger} };
+    my $debugger = $opts->{debugger};  
+    $debugger =~ s/\d+$//;
+
+    my $method = "start_$debugger";
+
+    ## $opts->{debugger} is passed through unchanged
+    ## so when we try to run it next, its found.
     $self->$method($opts);
 }