Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tcf-dev] Extending TCF Processes service to provide thread creation capability

Hello,

In order to extend run control and debugging capabilities with TCF, we would like to extend the Processes service to:

    #1 - Add thread creation support.
    #2 - Add a getCapabilities command.

    #3 - Extend "Processes start" with new options.

You will find below details on those 3 proposals.

Thanks in advance for your comments!
Best regards,
Jean-Michel


#1 - Here is a proposal for a new "Processes createThread" command:

----------------------------------------------------------------------------------
Processes createThread

C . <token> . Processes . createThread . <string: context ID> . <string: entry point> . <string array: arguments> . <options>

The command starts a new thread in process identified by given context ID.

     <string: context ID> - ID of the context in which thread must be created.
     <string: entry point> - Symbol or Address of thread entry point.
     <string array: arguments> - list of arguments.

<options>
    options consists of a list of options properties:
         "Attach" : <boolean> : If true, debugger should be attached to created context.
         "AttachChildren" : <boolean> : If true, debugger should be attached to children of created context.
         "StopAtEntry" :  <boolean> : If true, debugger should break at entry point.
         "Name" : <string> : Name of thread to create.
         "Priority" : <int> : Priority of thread to create.
         "StackSize" : <int> : Stack size of thread to create.
         "UseTerminal" : <boolean> : If true, use terminal for IO redirection.
         "ThreadOptions" : <string array> : thread option names selected from "SupportedThreadOptions" returned by "Processes getCapabilities".

Reply:
    R . <token> . <error report> . <context data>

On success the command returns context data for created thread. Context data has same format as Get Context result.
----------------------------------------------------------------------------------


#2 - Here is a proposal for a new "Processes getCapabilities" command:

----------------------------------------------------------------------------------
Processes getCapabilities

C . <token> . Processes . getCapabilities . <string: context ID>

The command reports processes service capabilities to clients so they can adjust to different implementations of the service. When called with a null ("") context ID the global capabilities are returned, otherwise context specific capabilities are returned.

Reply:
R . <token> . <error report> . <service capabilities>

<service capabilities>

Service capabilities consist of a list of properties. All properties are optional. Tools and targets can define additional properties. Predefined properties are:

     "ID" : <string: context ID> - ID of a context that was used to query capabilities
     "ProcessCreation" : <boolean> - if true, process creation is supported.
     "ThreadCreation" : <boolean> - if true, thread creation is supported.
     "StackSizeSupport" : <boolean> - if true, StackSize option is supported for processes and thread creation.
     "PrioritySupport" : <boolean> - if true, Priority option is supported for processes and thread creation.
     "SupportedProcessOptions" : <options> - List of supported options for process creation.
     "SupportedThreadOptions" : <options> - List of supported options for thread creation.

<options>
    => null
    => [ ]
    => [ <option description list> ]
 
<option description list>
    => <object: option description>
    => <option description list> , <object: option description>
 
<option description>
 
<option description> is a list of properties. All properties are optional. Tools and targets can define additional properties. Predefined option properties are:
"Name" : <string> - Option name to use in ProcessOptions & ThreadOptions parameters of start or createThread commands.
"ShortDescription" : <string> - Short description for the option.
"Description" : <string> - Complete description for the option.
"Default" : <boolean> - true if option should be enabled by default, false otherwise.
 
To help understand the format, here is an example of getCapabilities output:
 
["ID":"P1","ProcessCreation":"true","ThreadCreation":"false","StackSizeSupport":"true","PrioritySupport":"true","SupportedProcessOptions":[{"Name":"OPT1","ShortDescription":"option 1","Description":"This option enables ...","Default":"false"},{"Name":"OPT2","ShortDescription":"option 2","Description":"This option enables ...","Default":"true"}]]


NOTE: The options format that is described above is very basic: It only support boolean values, and does not allow support of options which could be exclusive, but <option description> could be extended with additional options to solve this.
-----------------------------------------
-----------------------------------------

#3 - Here is a proposal to extend "Processes start" command with new options:

With ProcessesV1 service it is not possible to specify a stack size, a priority, or options for thread/process creation.
Our proposal consists of adding the following new options to the existing ProcessesV1 options.
For "ProcessOptions", the idea is to select options from the values returned by getCapabilities:
"SupportedProcessOptions" & "DefaultProcessOptions" (Same for "ThreadOptions").

----------------------------------------------------------------------------------
     "ProcessOptions" : <string array> : process option names selected from "SupportedProcessOptions" returned by "Processes getCapabilities".
     "ThreadOptions" : <string array> : thread option names selected from "SupportedThreadOptions" returned by "Processes getCapabilities".
     "StackSize" : <int> : stack size.
     "Priority" : <int> : priority.
----------------------------------------------------------------------------------

#4 - Questions:

- Should we create a ProcessesV2?
- Are there other options that should be added to "Processes start" or "Processes createThread"? If yes, it is time to add them.


-- 
Jean-Michel Pédrono
www.windriver.com

Back to the top