Jason E. Stewart > Devel-DebugInit-0.3 > Devel::DebugInit::GDB



Annotate this POD

View/Report Bugs
Module Version: 0.1   Source  


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";



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.


write() =head2 write($filename)

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).

syntax highlighting: