DBGp::Client::Connection - DBGp connection class
$connection = $listener->accept; $res = $connection->send_command('step_over'); die $res->message if $res->is_error; $res = $connection->send_command('eval', '--', encode_base64('$var')); die $res->message if $res->is_error; # assumes result is a scalar value, it should check ->children print $res->result->value, "\n";
Simple blocking interface for a DBGp connection.
$connection = DBGp::Client::Connection->new( socket => $connected_socket, );
Usually called by DBGp::Client::Listener, not used directly.
Creates a new connection object wrapping the passed-in socket; after construction, call "parse_init" to process the initialization message sent by the debugger.
$init = $connection->parse_init;
Parses the init message sent by the debugger, and returns a "init" in DBGp::Client::Response object.
$res = $connection->send_command('step_over'); $res = $connection->send_command('eval', '--', 'base64-encoded-data');
Sends a command to the debugger, parses the answer and returns it as a response object (see DBGp::Client::Response).
It automatically adds the DBGp transaction id (-i parameter) to the command.
-i
Note that this method could block indefinitely.
$connection->on_stream(sub { ... });
Set a callback for receiving redirected program output.
The callback receives a "stream" in DBGp::Client::Response object.
$connection->on_notification(sub { ... });
Set a callback for receiving notifications.
The callback receives a "notify" in DBGp::Client::Response object.
Mattia Barbon <mbarbon@cpan.org>
Copyright (c) 2015 Mattia Barbon. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install DBGp::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBGp::Client
CPAN shell
perl -MCPAN -e shell install DBGp::Client
For more information on module installation, please visit the detailed CPAN module installation guide.