Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach olly to external process #41

Open
tmcgilchrist opened this issue Feb 28, 2024 · 1 comment
Open

Attach olly to external process #41

tmcgilchrist opened this issue Feb 28, 2024 · 1 comment

Comments

@tmcgilchrist
Copy link
Collaborator

It should be possible to attach Olly to an existing OCaml program that is already running.

When enabled (either via setting the OCAML_RUNTIME_EVENTS_START environment
variable or calling Runtime_events.start) a file with the pid of the process
and extension .events will be created. By default this is in the
current directory but can be over-ridden by the OCAML_RUNTIME_EVENTS_DIR
environment variable. Each domain maintains its own ring buffer in a section
of the larger file into which it emits events.

From https://v2.ocaml.org/api/Runtime_events.html

Conceptually it could look like:

┌─────────────────────┐     ┌────────────┐
│                     │     │  olly      │
│  OCaml application  │     │            │
│  with runtime events│     │            │
│               │     │     └────────────┘
│               │     │        ▲    export to file,
│        events ▼     │        │    online agent (http,grpc), or
│               ┌─────┼────────┼─┐  other API
│               └─────┼──────────┘
│                 ring│buffer
└─────────────────────┘
@kayceesrk
Copy link
Collaborator

kayceesrk commented Feb 28, 2024

"rather than" or "in addition to"? I would like it to be the latter so that the current interface where you can do olly <command> <executable> continues to work.

@tmcgilchrist tmcgilchrist changed the title Attach olly to external process rather than forking Attach olly to external process Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants