-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Kim X Goldov wrote:
| Is it possible to use the Emacs GUD debugger when debugging | handlers using Apache::DB? I've been successfully using Apache::DB | with mod_perl1, and find the Emacs debugger useful for Perl | scripts.
Yes you can: you need the latest version of Apache::DB. For now, you have to run httpd -X to prevent it from forking, but I'm working on that limitation.
You have to run a wrapper script around Apache, because Emacs insists on fiddling with command line switches assuming that the real /usr/bin/perl is used as the interpreter (which it won't). That wrapper should run apache -X, after setting the following environment variables:
~ * PERLDB_OPTS="TTY=$tty ReadLine=0 ornaments=0" where $tty is the ~ tty the wrapper script is attached to (obtained e.g. with ~ `/usr/bin/tty`) ~ * MOD_PERL_TRACE="dshg" (only relevant if mod_perl was compiled ~ with debugging on)
Here are appropriate httpd.conf snippets to honor this setup:
PerlPassEnv PERLDB_OPTS PerlPassEnv MOD_PERL_TRACE PerlPassEnv TERM
<Perl> ~ BEGIN { if ($ENV{PERLDB_OPTS}) { ~ require Apache::DB; ~ Apache::DB->init; ~ require 'Apache/perl5db.pl'; ~ warn "Support for editor embedding (e.g. Emacs) enabled\n\n"; ~ $DB::slave_editor=1; ~ }}
~ $DB::single = 1;
# Your usual <Perl> stuff goes here </Perl>
Now launch Emacs, type M-x perldb <ret>, erase the minibuffer contents, type in the path of your wrapper script followed by a bogus command-line argument (e.g. "/home/dom/bin/apache-gud mod_perl"). The debugger should stop at the "$DB::single = 1" line above.
Regards,
- -- Dominique QUATRAVAUX Ingénieur senior 01 44 42 00 08 IDEALX
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCNCzyMJAKAU3mjcsRAnvhAKCbbALXfD9EWgktBr3zQNvaXpmMQQCgoQL4 qRcGq+v4uZJYu7iY+cJQVFg= =P4uz -----END PGP SIGNATURE-----