Skip to content

Attach and debug any child process fork'ed by the target process #2551

@derekparker

Description

@derekparker

Currently Delve does not use PTRACE_O_TRACEFORK or any other mechanism to begin debugging a process created when the target process (the original process being debugged) forks. This is an issue for tracking and discussing this new potential feature.

This would require changes to the API and to the debugger layer to allow for controlling and manipulating multiple processes simultaneously. It also requires some thought on how such a situation should behave from a users perspective.

Open questions / items to consider:

  • Amount of work needed to make the debugger layer be able to handle multiple processes. We abstract a lot away via the Target type so the debugger would essentially need to initialize and keep track of N different child Targets.
  • What new functionality will be needed from an API perspective? We would obviously need a way to switch between which is the "current" process which would affect any command used to manipulate or explore a process being debugged.
  • How do we coordinate the two processes? Stop both when one hits a breakpoint or only the process which hit it? What happens when both programs hit a breakpoint, which do we show / prioritize for the user?

There's certainly a lot more to consider here but this is at least a brief list to get the topic started.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions