NAME
Devel::DebugInit::GDB - Perl extension for creating .gdbinit file from C header file macros
SYNOPSIS
use Devel::DebugInit::GDB;
use Config;
my $g = new Devel::DebugInit::GDB "filename => $Config{'archlib'}/CORE/perl.h";
$g->print("~/perl5.00403/.gdbinit");
DESCRIPTION
This module is a backend for the GNU debugger, gdb, that is used together with the generic Devel::DebugInit front end to produce an initialization file for gdb. This module provides the output routines that are specific for gdb. See Devel::DebugInit for more information.
METHODS
print() =head2 print($filename)
This method prints out the macros to $filename, which defaults to "./gdbinit". It first prints out any macros without arguments (if enabled, see "INTERNALS" in Devel::DebugInit for more info), and then it prints any macros with arguments.
scan($name,$macro)
This is used by the print function to determine if $macro should be printed or not. It returns 0 if the macro should NOT be printed. Currently, the method rejects undefined macros (this is possible if the user specified printing of local macros only), empty macros (typical compiler flags like -DDEBUG, or #define linux), macros whose names begin with '_', as well as any macro whose name is a built-in GDB command.
This function can be overloaded by the user to more rigidly restrict the output of print. For example:
package myGDB;
use Devel::DebugInit::GDB;
@myGDB::ISA = (Devel::DebugInit::GDB);
sub scan {
my ($gdb,$key,$macro) = @_;
#first give the superclass scan a chance
return 0 unless $gdb->SUPER::scan(@_);
# dont' print out any macros beginning with 'rfsf_'
return 0 if $macro =~ /^rfsf_/;
# print the rest
return 1;
}
AUTHOR
Jason E. Stewart, jasons@cs.unm.edu
SEE ALSO
perl(1), Devel::DebugInit(3).