… | |
… | |
67 | set a tty (eg. with the C<inferior_set_tty> command). |
67 | set a tty (eg. with the C<inferior_set_tty> command). |
68 | |
68 | |
69 | Unfortunately, the MI interface does not seem to support any kind |
69 | Unfortunately, the MI interface does not seem to support any kind |
70 | of I/O redirection, so this module helps you a bit, by setting the |
70 | of I/O redirection, so this module helps you a bit, by setting the |
71 | C<exec-wrapper> variable with a console C<set> commmand. That is, this |
71 | C<exec-wrapper> variable with a console C<set> commmand. That is, this |
72 | module does soemthing like this for you, providing proper file descriptors |
72 | module does soeQmthing like the following for you, providing proper file |
73 | fpr your actual stdin and stdout: |
73 | descriptors for your actual stdin and stdout: |
74 | |
74 | |
75 | set exec-wrapper <&5 >&6 |
75 | set exec-wrapper <&5 >&6 |
76 | |
76 | |
77 | The actual I/O redirection operators are also stored in C<< $gdb->{stdio} |
77 | The actual I/O redirection operators are also stored in C<< $gdb->{stdio} |
78 | >>, so you can even do it yourself, e.gh. when providing your own wrapper: |
78 | >>, so you can even do it yourself, e.g. when providing your own wrapper: |
79 | |
79 | |
80 | $self->cmd_raw ("set exec-wrapper $self->{stdio}", sub { }); |
80 | $self->cmd_raw ("set exec-wrapper $self->{stdio}", sub { }); |
81 | |
81 | |
82 | (You need to use a raw command, as the "correct" C<gdb_set> MI command |
82 | (You need to use a raw command, as the "correct" C<gdb_set> MI command |
83 | silently ignores any C<exec-wrapper> setting). |
83 | silently ignores any C<exec-wrapper> setting). |
… | |
… | |
93 | use Scalar::Util (); |
93 | use Scalar::Util (); |
94 | |
94 | |
95 | use AnyEvent (); |
95 | use AnyEvent (); |
96 | use AnyEvent::Util (); |
96 | use AnyEvent::Util (); |
97 | |
97 | |
98 | our $VERSION = '0.1'; |
98 | our $VERSION = '0.2'; |
99 | |
99 | |
100 | =head2 METHODS |
100 | =head2 METHODS |
101 | |
101 | |
102 | =over 4 |
102 | =over 4 |
103 | |
103 | |
… | |
… | |
109 | at least C<verbose> enabled. And don't forget to provide an C<on_eof> |
109 | at least C<verbose> enabled. And don't forget to provide an C<on_eof> |
110 | callback. |
110 | callback. |
111 | |
111 | |
112 | my $gdb = new AnyEvent::GDB |
112 | my $gdb = new AnyEvent::GDB |
113 | on_eof => sub { |
113 | on_eof => sub { |
114 | print Qe are done.\n"; |
114 | print "We are done.\n"; |
115 | }, |
115 | }, |
116 | trace => 1; # or verbose => 1, for less output |
116 | trace => 1; # or verbose => 1, for less output |
117 | |
117 | |
118 | =over 4 |
118 | =over 4 |
119 | |
119 | |