Devel::DebugInit::GDB - Perl extension for creating .gdbinit file from C header file macros
use Devel::DebugInit::GDB; use Config; my $g = new Devel::DebugInit::GDB "filename => $Config{'archlib'}/CORE/perl.h"; $g->write("~/perl5.00403/.gdbinit");
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.
This method outputs the macros to $filename, which defaults to "./gdbinit". It first writes out any macros without arguments (if enabled, see "INTERNALS" in Devel::DebugInit for more info), and then it writes any macros with arguments.
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; }
Jason E. Stewart, jasons@cs.unm.edu
perl(1), Devel::DebugInit(3).
To install Devel::DebugInit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::DebugInit
CPAN shell
perl -MCPAN -e shell install Devel::DebugInit
For more information on module installation, please visit the detailed CPAN module installation guide.