ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-GDB/GDB.pm
(Generate patch)

Comparing AnyEvent-GDB/GDB.pm (file contents):
Revision 1.3 by root, Fri Dec 28 09:28:59 2012 UTC vs.
Revision 1.4 by root, Fri Dec 28 09:52:05 2012 UTC

523 523
524 delete $self->{thread}{$r->{id}}; 524 delete $self->{thread}{$r->{id}};
525} 525}
526 526
527sub _threads { 527sub _threads {
528 my ($self, $r) = @_; 528 my ($self, $id) = @_;
529 529
530 $r->{thread_id} eq "all" 530 ref $id
531 ? @{ $self->{thread} }[@$id]
532 : $id eq "all"
531 ? values %{ $self->{thread} } 533 ? values %{ $self->{thread} }
532 : $self->{thread}{$r->{thread_id}} 534 : $self->{thread}{$id}
533} 535}
534 536
535sub on_exec_running { 537sub on_exec_running {
536 my ($self, undef, $r) = @_; 538 my ($self, undef, $r) = @_;
537 539
538 for ($self->_threads ($r)) { 540 for ($self->_threads ($r->{stopped_threads})) {
539 delete $_->{stopped}; 541 delete $_->{stopped};
540 $_->{running} = 1; 542 $_->{running} = 1;
541 } 543 }
542} 544}
543 545
580 582
581AnyEvent::GDB is asynchronous in nature, as the goal of the MI interface 583AnyEvent::GDB is asynchronous in nature, as the goal of the MI interface
582is to be fully asynchronous. Due to this, a user of this interface must 584is to be fully asynchronous. Due to this, a user of this interface must
583be prepared to handle various events. 585be prepared to handle various events.
584 586
585When an event is produced, the GDB object will look for the following 587When an event is produced, the GDB object will look for the following four
586four handlers and, if found, will call it with the GDB object and event 588handlers and, if found, will call each one in order with the GDB object
587name (without C<on_>) as the first two arguments, followed by any 589and event name (without C<on_>) as the first two arguments, followed by
588event-specific arguments: 590any event-specific arguments:
589 591
590=over 4 592=over 4
591 593
594=item on_event method on the GDB object
595
596Useful when subclassing.
597
598=item on_event constructor parameter
599
600The callback specified as C<on_event> parameter to the constructor.
601
602=item on_EVENTNAME method on the GDB object
603
604Again, mainly useful when subclassing.
605
592=item on_EVENTNAME constructor parameter 606=item on_EVENTNAME constructor parameter
593 607
594Any callback specified as C<on_EVENTNAME> parameter to the constructor. 608Any callback specified as C<on_EVENTNAME> parameter to the constructor.
595
596=item on_EVENTNAME method on the GDB object
597
598Useful when subclassing.
599
600=item on_event constructor parameter
601
602The callback specified as C<on_event> parameter to the constructor.
603
604=item on_event method on the GDB object
605
606Again, mainly useful when subclassing.
607 609
608=back 610=back
609 611
610Here's the list of events with a description of their arguments. 612Here's the list of events with a description of their arguments.
611 613

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines