Skip to main content

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

Hi Eugene,

On 6/8/2013 6:00 PM, tcf-dev-request@xxxxxxxxxxx wrote:
createThread command looks rather redundant. I would prefer an option for "create" command, e.g. MemSpaceID. It would be similar to CLONE_VM option in clone() function.

I guess you're talking about adding an option to "start" command (not "create" command)?

Handling both processes and threads creation with "start" command was effectively our first idea, but we finally changed our mind because we thought that the "start" command interface would become too complicated, confusing and error-prone:

For thread creation, we need to specify the entry point which could be either a symbol name or an hexa/decimal value. To pass this entry point, we could use the existing <string: program image file> argument, but how would we determine if this argument is a file or symbol name? Testing file or symbol existence seems heavy, and not 100% reliable as we could have a file with same name than a symbol...
Could we assume that if "MemSpaceID" option is specify, then it's a thread creation?
Should we add an option to explicitly indicates that we want to create a thread: "ThreadCreation" : <boolean>.

Moreover, the list of options would be more complicated to read, as some would apply to both processes & threads creation, while others would apply to only processes, or only threads:
    
<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.
         "UseTerminal" : <boolean> : If true, use terminal for IO redirection.
         "StackSize" : <int> : Stack size.
         "Priority" : <int> : Priority.
         "ThreadOptions" <string array> : thread option names selected from "SupportedThreadOptions" returned by Processes getCapabilities.


Process specific options:

         "StopAtMain" :  <boolean> : If true, debugger should break on main.
         "ProcessOptions" <string array> : process option names selected from "SupportedProcessOptions" returned by Processes getCapabilities.


Thread specific options:
         "Name" : <string> : Name of thread to create.
         "Priority" : <int> : Priority of thread to create.
         "StackSize" : <int> :
Stack size of thread to create.


I suggest to create Bugzilla for this.

Should we create a ProcessesV2?
It appear to be clean extension - I don't see compatibility issues, no need to change service version.

OK.

Thanks.
Regards,
Jean-Michel

Back to the top