Commit Graph

11 Commits (540996d21ee3793a1cecce252c81fb76a6b9fd61)

Author SHA1 Message Date
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
Xavier Leroy 08e58c836e
More efficient management of code fragments (#9654)
* Introducing codefrag: a new runtime module to work with code fragments

This module collects all the operations on code fragments performed in
various places of the runtime systems.  Applies both to bytecode and
to native code.

The implementation is based on skiplists, so that "lookup fragment by
PC" and "lookup fragment by number" are efficient (logarithmic in the
number of code fragments).  "Lookup fragment by digest" remains
linear-time.

The new module also improves the handling of digests: now it is
possible to mark a code fragment as "no digest" i.e. not marshal-able.

* Use the new "codefrag" runtime module for marshaling and for the
  debugger interface

Replace the previous handling of code fragments with calls to the
functions provided by the "codefrag" runtime module.
2020-06-11 10:39:19 +02:00
Enguerrand Decorne b7f0494df5 Rewrite the instrumented runtime to store traces in the CTF format.
The instrumentation code in the instrumented runtime was replaced
with new APIs to gather runtime statistics and output them in a new format
(Common Trace Format).
This commit also exposes new functions in the Gc module to pause or resume
instrumentation during a program execution (Gc.eventlog_pause and
Gc.eventlog_resume).
2020-04-30 10:32:01 +02:00
Xavier Leroy 41441a65f1 Cast `getpid()` to `long long` before printing
Process IDs such as returned by `getpid()` are of type `pid_t`,
which can be `int` but can be any other signed integer type.
For example it's `long` in Solaris.

Printing a `pid_t` with a `%d` format is therefore incorrect and
causes an error in Solaris.

This commit casts to type `long long` and prints as `%lld`.
2019-12-22 17:43:33 +01:00
Xavier Leroy 9d84841c46
Merge branch 'trunk' into fatal_error_abort 2019-07-31 11:18:57 +02:00
Jacques-Henri Jourdan 78de99ecc2 Xavier Clerc's remarks. 2019-07-16 13:42:04 +02:00
Jacques-Henri Jourdan 593f94055a Dynlink support for ocamldebug
This commit adds dynlink support for ocamldebug. As a side effect, it also:
  - factorizes the various functions searching for a code fragment into one,
    called [caml_find_code_fragment];
  - removes the [caml_register_code_fragment], which does not seem to
    be used anywhere, and which clearly should not be used by external code.
2019-07-16 10:52:48 +02:00
Jacques-Henri Jourdan cddec18fde Add [caml_fatal_error_hook].
When not NULL, this hook is called when a fatal error is encountered
instead of printing an error message on stderr.
2019-06-08 23:05:16 +02:00
Jacques-Henri Jourdan 97656b1498 Use abort instead of exit(2) in caml_fatal_error.
This makes it possible to get a core dump in case of a fatal error,
which makes debugging easier.

This also
- turns a use of exit(2) to call to caml_fata_error
- replaces some uses of caml_fatal_error to a call to exit(127), when
  the error results in misuse of the runtime
- removes some useless calls to exit(-1)
2019-06-08 23:04:54 +02:00
Damien Doligez b6cf38d9d6
MPR#7814: fix non-prefixed symbol names in debug and instrumented runtimes (#1900)
* make `names_of_instructions` a static variable
* use lowercase names for CAML_INSTR functions, variables, and structs
* add changelog entry
2018-07-13 16:06:36 +02:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00