Target Communication Framework Services - Debug Print

Debug Print Service

Version History

Version Date Change
1.0 2011-11-11 Initial

Overview

The service provides access to "dynamic printf" output stream that is generated by invocations of '$printf' function by the Expressions service on the remote target.

The function has same arguments as the C library function int printf(const char * format, ...). While '$printf' is most usefull as a breakpoint action, any debugger expression can call the function.

The service uses standard format for error reports, see Error Report Format.

Commands

Open


C • <token> • DPrintf • open • <object: stream properties>

Open "dynamic printf" stream. If the stream is already open, just return its ID.

Stream properties are optional and can be null. No standard stream properties are defined yet.

Reply:


R • <token><error report><string: stream ID>

Reply contains ID of the stream. The stream is accessible through the Streams service.

Close


C • <token> • DPrintf • close •

Close "dynamic printf" stream.

Reply:


R • <token><error report>

API

/**
 * DPrintf service provides access to "dynamic printf" output stream that is generated by invocations of
 * '$printf' function on the remote target. '$printf' is usually used as a breakpoint action.
 *
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface IDPrintf extends IService {

    /**
     * This service name, as it appears on the wire - a TCF name of the service.
     */
    static final String NAME = "DPrintf";

    /**
     * Open "dynamic printf" stream and get ID of the stream.
     * The service maintains one such stream per client.
     * The stream is managed by Streams service.
     * @param properties - optional stream properties.
     * @param done - command result call back object.
     * @return - pending command handle.
     */
    IToken open(Map<String,Object>[] properties, DoneCommandOpen done);

    interface DoneCommandOpen {
        void doneCommandOpen(IToken token, Exception error, String id);
    }

    /**
     * Close "dynamic printf" stream.
     * Further '$printf' output will be discarded.
     * @param done - command result call back object.
     * @return - pending command handle.
     */
    IToken close(DoneCommandClose done);

    interface DoneCommandClose {
        void doneCommandClose(IToken token, Exception error);
    }
}