# eric7.DebugClients.Python.MultiProcessDebugExtension

Module implementing a function to patch the process creation functions to support multiprocess debugging.

### Global Attributes

_debugClient

### Classes

None

### Functions

_shallPatch | Function to determine, if the multiprocessing patches should be done.
createCreateProcess | Function to patch the 'CreateProcess' process creation function of Windows.
createExecl | Function to patch the 'execl' process creation functions.
createExecv | Function to patch the 'execv' process creation functions.
createExecve | Function to patch the 'execve' process creation functions.
createFork | Function to patch the 'fork' process creation functions.
createForkExec | Function to patch the 'fork_exec' process creation functions.
createPosixSpawn | Function to patch the 'posix_spawn' process creation functions.
createSpawnl | Function to patch the 'spawnl' process creation functions.
createSpawnv | Function to patch the 'spawnv' process creation functions.
createSpawnve | Function to patch the 'spawnve' process creation functions.
newCreateProcess | Function replacing the 'CreateProcess' function of the _subprocess or _winapi module.
newExecl | Function replacing the 'execl' functions of the os module.
newExecv | Function replacing the 'execv' functions of the os module.
newExecve | Function replacing the 'execve' functions of the os module.
newFork | Function replacing the 'fork' function of the os module.
newForkExec | Function replacing the 'fork_exec' functions of the _posixsubprocess module.
newPosixSpawn | Function replacing the 'posix_spawn' functions of the os module.
newSpawnl | Function replacing the 'spawnl' functions of the os module.
newSpawnv | Function replacing the 'spawnv' functions of the os module.
newSpawnve | Function replacing the 'spawnve' functions of the os module.
patchModule | Function to replace a function of a module with a modified one.
patchNewProcessFunctions | Function to patch the process creation functions to support multiprocess debugging.

## _shallPatch

_shallPatch()

Function to determine, if the multiprocessing patches should be done.

Return:
  flag indicating patching should be performed

Return Type:
  bool

Up

## createCreateProcess

createCreateProcess(originalName)

Function to patch the 'CreateProcess' process creation function of Windows.

originalName (str)
  original name of the function to be patched

Return:
  function replacing the original one

Return Type:
  function

Up

## createExecl

createExecl(originalName)

Function to patch the 'execl' process creation functions.

- os.execl(path, arg0, arg1, ...)
- os.execle(path, arg0, arg1, ..., env)
- os.execlp(file, arg0, arg1, ...)
- os.execlpe(file, arg0, arg1, ..., env)

originalName (str)
  original name of the function to be patched

Return:
  function replacing the original one

Return Type:
  function

Up

## createExecv

createExecv(originalName)

Function to patch the 'execv' process creation functions.

- os.execv(path, args)
- os.execvp(file, args)

originalName (str)
  original name of the function to be patched

Return:
  function replacing the original one

Return Type:
  function

Up

## createExecve

createExecve(originalName)

Function to patch the 'execve' process creation functions.

- os.execve(path, args, env)
- os.execvpe(file, args, env)

originalName (str)
  original name of the function to be patched

Return:
  function replacing the original one

Return Type:
  function

Up

## createFork

createFork(originalName)

Function to patch the 'fork' process creation functions.

- os.fork()

originalName (str)
  original name of the function to be patched

Return:
  function replacing the original one

Return Type:
  function

Up

## createForkExec

createForkExec(originalName)

Function to patch the 'fork_exec' process creation functions.

- _posixsubprocess.fork_exec(args, executable_list, close_fds, ... (13 more))

originalName (str)
  original name of the function to be patched

Return:
  function replacing the original one

Return Type:
  function

Up

## createPosixSpawn

createPosixSpawn(originalName)

Function to patch the 'posix_spawn' process creation functions.

- os.posix_spawn(path, argv, env, *, file_actions=None, ... (6 more))
- os.posix_spawnp(path, argv, env, *, file_actions=None, ... (6 more))

originalName (str)
  original name of the function to be patched

Return:
  function replacing the original one

Return Type:
  function

Up

## createSpawnl

createSpawnl(originalName)

Function to patch the 'spawnl' process creation functions.

- os.spawnl(mode, path, arg0, arg1, ...)
- os.spawnlp(mode, file, arg0, arg1, ...)

originalName (str)
  original name of the function to be patched

Return:
  function replacing the original one

Return Type:
  function

Up

## createSpawnv

createSpawnv(originalName)

Function to patch the 'spawnv' process creation functions.

- os.spawnv(mode, path, args)
- os.spawnvp(mode, file, args)

originalName (str)
  original name of the function to be patched

Return:
  function replacing the original one

Return Type:
  function

Up

## createSpawnve

createSpawnve(originalName)

Function to patch the 'spawnve' process creation functions.

- os.spawnve(mode, path, args, env)
- os.spawnvpe(mode, file, args, env)

originalName (str)
  original name of the function to be patched

Return:
  function replacing the original one

Return Type:
  function

Up

## newCreateProcess

newCreateProcess(appName, cmdline, *args)

Function replacing the 'CreateProcess' function of the _subprocess or _winapi module.

Up

## newExecl

newExecl(path, *args)

Function replacing the 'execl' functions of the os module.

Up

## newExecv

newExecv(path, args)

Function replacing the 'execv' functions of the os module.

Up

## newExecve

newExecve(path, args, env)

Function replacing the 'execve' functions of the os module.

Up

## newFork

newFork()

Function replacing the 'fork' function of the os module.

Up

## newForkExec

newForkExec(args, *other_args)

Function replacing the 'fork_exec' functions of the _posixsubprocess module.

Up

## newPosixSpawn

newPosixSpawn(path, argv, env, **kwargs)

Function replacing the 'posix_spawn' functions of the os module.

Up

## newSpawnl

newSpawnl(mode, path, *args)

Function replacing the 'spawnl' functions of the os module.

Up

## newSpawnv

newSpawnv(mode, path, args)

Function replacing the 'spawnv' functions of the os module.

Up

## newSpawnve

newSpawnve(mode, path, args, env)

Function replacing the 'spawnve' functions of the os module.

Up

## patchModule

patchModule(module, functionName, createFunction)

Function to replace a function of a module with a modified one.

module (types.ModuleType)
  reference to the module
functionName (str)
  name of the function to be replaced
createFunction (types.FunctionType)
  function creating the replacement

Up

## patchNewProcessFunctions

patchNewProcessFunctions(multiprocessEnabled, debugClient)

Function to patch the process creation functions to support multiprocess debugging.

multiprocessEnabled (bool)
  flag indicating multiprocess support
debugClient (DebugClient)
  reference to the debug client object

Up