Commit Graph

23 Commits (master)

Author SHA1 Message Date
David Allsopp 692bd73123 OCAMLRUNPARAM=b=2 => load debuginfo
Load the debug information during runtime startup if OCAMLRUNPARAM=b=2.
This guards against the specific case of running out of fds, since the
debug information can't then be loaded.
2018-12-11 10:17:04 +01:00
David Allsopp 43b28fac00 Improve error messages when loading backtrace info
Before, any errors when loading bytecode backtrace information were
fatal and the error message was potentially misleading.
2018-12-11 08:54:49 +01:00
Stephen Dolan e678885007 Lock channels before doing I/O
The debugger's use of channels doesn't support locking, but it
doesn't work on threaded programs anyway.
2020-07-27 17:29:39 +01:00
Xavier Leroy 53d55f2522 Revised linking of trap frames in bytecode interpreter stack
Rather than storing a pointer to the previous frame in the Trap_link
field of the current frame, store the distance (pointer difference)
between the current frame and the previous frame, tagged as an OCaml
integer.

Using a tagged integer instead of a raw pointer means fever problems
later with strict no-naked-pointer support.

Using a distance rather than an absolute address simplifies
the code that resizes the stack.
2020-06-18 15:06:24 +02:00
Stephen Dolan 0040c5d783 Print function names (derived from Lambda.scoped_location) in backtraces
Function names now appear in backtraces and are available via Printexc.
2020-04-27 12:58:53 +01:00
Jérémie Dimino c7de942730
Fix #9344 (#9368)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2020-03-17 11:38:45 +00:00
Nicolás Ojeda Bär 87296ee8e0
Dynlink: preserve module initializers backtrace (#9183)
* dynlink: preserve backtrace of module initializers
* Stabilize debug event sort
* Update test reference file
2020-02-06 07:21:23 +01:00
Stephen Dolan 20f6a17ae3 Review 2020-02-04 11:03:07 +00:00
Stephen Dolan 060f6e8e47 Avoid scanning the stack twice when collecting callstacks in Memprof. 2020-02-03 10:51:53 +00:00
Stephen Dolan 8dd88c792d Fix bytecode backtrace generation when large integers are present.
Again.
2020-01-29 10:14:33 +00:00
Gabriel Scherer 7e41a961e9
Merge pull request #9268 from stedolan/bytecode-backtrace-fix
Fix bytecode backtrace generation when large integers are present
2020-01-28 22:39:30 +01:00
Stephen Dolan 994cf75fbc Fix bytecode backtrace generation when large integers are present 2020-01-28 15:00:11 +00:00
Stephen Dolan 8633c32525 Distinguish "0" from "don't care" in caml_current_callstack_write. 2020-01-25 22:55:56 +01:00
Stephen Dolan f874b3ee01 Memprof: report different callstacks for different combined allocations 2020-01-25 22:55:56 +01:00
Gabriel Scherer 2d5c5f031d runtime/backtrace_byt.c: minor code simplification
(no change entry needed)
2019-12-15 11:14:25 +01:00
Jacques-Henri Jourdan 23e5bfa3bb Better stack backtraces for C calls in bytecode (#8641)
The previous mechanism worked for C calls that raise an exception, but not for C calls that call back into OCaml code which raises an exception.

This commit addresses the issue by saving the PC in the interpreter stack before a C call, so that the backtrace mechanism always sees it.

However, if an external is declared in the .ml file and exposed in the .mli file as a val, then ocamlc generates a wrapper that adds a spurious entry in the stack frame. In this PR, this change in behavior results in the re-declaration of Printexc.get_callstack as an external instead of a val, so that the spurious stack frame does not appear in call stacks obtained from Printexc.get_callstack.
2019-10-12 18:25:58 +02:00
KC Sivaramakrishnan 126383b2b2 Fix long lines 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan 111f6af469 Move bytecode global variables to domain state 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan c06038a0ee Move backtrace support global variables to domain state.
Since we cannot access backtrace position in cmmgen.ml anymore,
Cmm.raise_kind in removed. Instead, we use Lambda.raise_kind. When
assembly code is generated, we reset the backtrace position to 0 in the
case of regular raise. Importantly, the semantics remains the same.
2019-08-23 09:50:05 +05:30
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 052a950dea Statistical memory profiling of blocks allocated in the major heap. 2019-05-09 16:40:45 +02:00
Stephen Dolan 838e44a245
Update issue numbers in comments after Mantis -> Github migration. (#8505) 2019-03-18 09:42:23 +00:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00