<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Devel::ebug - A simple, extensible Perl debugger

SYNOPSIS
      use Devel::ebug;
      my $ebug = Devel::ebug-&gt;new;
      $ebug-&gt;program("calc.pl");
      $ebug-&gt;load;

      print "At line: "       . $ebug-&gt;line       . "\n";
      print "In subroutine: " . $ebug-&gt;subroutine . "\n";
      print "In package: "    . $ebug-&gt;package    . "\n";
      print "In filename: "   . $ebug-&gt;filename   . "\n";
      print "Code: "          . $ebug-&gt;codeline   . "\n";
      $ebug-&gt;step;
      $ebug-&gt;step;
      $ebug-&gt;next;
      $ebug-&gt;break_point(6);
      $ebug-&gt;break_point(6, '$e = 4');
      $ebug-&gt;break_point("t/Calc.pm", 29);
      $ebug-&gt;break_point("t/Calc.pm", 29, '$i == 2');
      $ebug-&gt;break_point_subroutine("main::add");
      my @break_points = $ebug-&gt;break_points();
      $ebug-&gt;watch_point('$x &gt; 100');
      my $codelines = $ebug-&gt;codelines(@span);
      $ebug-&gt;run;
      my $pad  = $ebug-&gt;pad;
      foreach my $k (sort keys %$pad) {
        my $v = $pad-&gt;{$k};
        print "Variable: $k = $v\n";
      }
      my $v = $ebug-&gt;eval('2 ** $exp');

DESCRIPTION
    A debugger is a computer program that is used to debug other programs.
    Devel::ebug is a simple, extensible Perl debugger with a clean API.
    Using this module, you may easily write a Perl debugger to debug your
    programs. Alternatively, it comes with an interactive debugger, ebug.

    The reasoning behind building Devel::ebug is that the current Perl
    debugger, perl5db.pl, is very crufty, hard to use and extend and has no
    tests. Devel::ebug provides a simple programmatic interface to debugging
    programs, which is well tested. This makes it easier to build debuggers
    on top of Devel::ebug, be they console-, curses-, GUI- or Ajax-based.

    Devel::ebug is a work in progress.

    Internally, Devel::ebug consists of two parts. The frontend is
    Devel::ebug, which you interact with. The frontend starts the code you
    are debugging in the background under the backend (running it under perl
    -d:ebug code.pl). The backend starts a TCP server, which the frontend
    then connects to, and uses this to drive the backend. This adds some
    flexibilty in the debugger. There is some minor security in the
    client/server startup (a secret word), and a random port is used from
    3141-4165 so that multiple debugging sessions can happen concurrently.

CONSTRUCTOR
  new
    The constructor creats a Devel::ebug object:

      my $ebug = Devel::ebug-&gt;new;

  program
    The program method selects which program to load:

      $ebug-&gt;program("calc.pl");

  load
    The load method loads the program and gets ready to debug it:

      $ebug-&gt;load;

METHODS
  break_point
    The break_point method sets a break point in a program. If you are
    run-ing through a program, the execution will stop at a break point.
    Break points can be set in a few ways.

    A break point can be set at a line number in the current file:

      $ebug-&gt;break_point(6);

    A break point can be set at a line number in the current file with a
    condition that must be true for execution to stop at the break point:

      $ebug-&gt;break_point(6, '$e = 4');

    A break point can be set at a line number in a file:

      $ebug-&gt;break_point("t/Calc.pm", 29);

    A break point can be set at a line number in a file with a condition
    that must be true for execution to stop at the break point:

      $ebug-&gt;break_point("t/Calc.pm", 29, '$i == 2');

  break_point_subroutine
    The break_point_subroutine method sets a break point in a program right
    at the beginning of the subroutine. The subroutine is specified with the
    full package name:

      $ebug-&gt;break_point_subroutine("main::add");
      $ebug-&gt;break_point_subroutine("Calc::fib");

  break_points
    The break_points method returns a list of all the line numbers in the
    current file that have a break point set.

      my @break_points = $ebug-&gt;break_points();

  codeline
    The codeline method returns the line of code that is just about to be
    executed:

      print "Code: "          . $ebug-&gt;codeline   . "\n";

  codelines
    The codelines method returns lines of code.

    It can return all the code lines in the current file:

      my @codelines = $ebug-&gt;codelines();

    It can return a span of code lines from the current file:

      my @codelines = $ebug-&gt;codelines(1, 3, 4, 5);

    It can return all the code lines in a file:

      my @codelines = $ebug-&gt;codelines("t/Calc.pm");

    It can return a span of code lines in a file:

      my @codelines = $ebug-&gt;codelines("t/Calc.pm", 5, 6);

  eval
    The eval method evaluates Perl code in the current program and returns
    the result:

      my $v = $ebug-&gt;eval('2 ** $exp');

  filename
    The filename method returns the filename of the currently running code:

      print "In filename: "   . $ebug-&gt;filename   . "\n";

  line
    The line method returns the line number of the statement about to be
    executed:

      print "At line: "       . $ebug-&gt;line       . "\n";

  next
    The next method steps onto the next line in the program. It executes any
    subroutine calls but does not step through them.

      $ebug-&gt;next;

  package
    The package method returns the package of the currently running code:

      print "In package: "    . $ebug-&gt;package    . "\n";

  pad
      my $pad  = $ebug-&gt;pad;
      foreach my $k (sort keys %$pad) {
        my $v = $pad-&gt;{$k};
        print "Variable: $k = $v\n";
      }

  run
    The run subroutine starts executing the code. It will only stop on a
    break point or watch point.

      $ebug-&gt;run;

  step
    The step method steps onto the next line in the program. It steps
    through into any subroutine calls.

      $ebug-&gt;step;

  subroutine
    The subroutine method returns the subroutine of the currently working
    code:

      print "In subroutine: " . $ebug-&gt;subroutine . "\n";

  watch_point
    The watch point method sets a watch point. A watch point has a
    condition, and the debugger will stop run-ing as soon as this condition
    is true:

      $ebug-&gt;watch_point('$x &gt; 100');

SEE ALSO
    perldebguts

AUTHOR
    Leon Brocard, "&lt;acme@astray.com&gt;"

COPYRIGHT
    Copyright (C) 2005, Leon Brocard

    This module is free software; you can redistribute it or modify it under
    the same terms as Perl itself.

</pre></body></html>