Everything

csplus.add_event_listener


This command adds the specified listener to the list of functions to be called when an event happen in CS+.

[Specification format]

csplus.add_event_listener(listener)

[Argument(s)]

Argument

Description

listener

A function which accept a String parameter.

[Return value]

None

[Detailed description]

-

The function has format function_name(string_parameter)

-

The value which will be passed to the String parameter of listener has the format debugger_state;0;event.

Value

Description

debugger_state

A fixed string indicating that the event is related to debug activity.

event

The name of the event. The information has one of following value:

Program is downloaded: downloaded

Debug session is reset: reset

Debug session is about to resume: resuming

Debug session is suspended: suspended

[Example of use]

>>> def listener1(event): print("Listener 1: " + event)
...
>>> csplus.add_event_listener(listener1)
>>> csplus.download_loadmodule(session_id)
>>> Listener 1: debugger state;0;reset
Listener 1: debugger state;0;resuming