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

Continuation of PR2027 (tests passing for runtime 4 and 5) #2057

Merged
merged 47 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
ac3f47d
Dummy C stubs
mshinwell Nov 15, 2023
f8a889b
Run max_arity_locals test only when stack allocation is enabled
mshinwell Nov 15, 2023
025e60d
Fix and promote typing-local/ tests for stack allocation being disabled
mshinwell Nov 16, 2023
362d41e
Predicate some tests on having stack allocation
mshinwell Nov 16, 2023
023843e
Forward port all SIMD runtime changes from d3c14133b919058f3d499a43a0…
mshinwell Nov 15, 2023
d550d1f
Fix globrootsprim.c test
mshinwell Nov 16, 2023
00d3470
Fix asmgen tests
mshinwell Nov 16, 2023
555301e
Add runtime4 predicate to ocamltest and use it in runtime-naked-point…
mshinwell Nov 16, 2023
c9a687d
Add runtime_dir ocamltest variable + use it to fix output-complete-ob…
mshinwell Nov 16, 2023
d3c2c1d
git mv debugger debugger4
mshinwell Nov 16, 2023
1f72ca3
Import debugger/ from upstream 5
mshinwell Nov 16, 2023
d66deec
Debugger build system
mshinwell Nov 16, 2023
df5d223
Apply JS-specific modifications from debugger4/ -> debugger/
mshinwell Nov 16, 2023
86de82c
Fix pr9971 test
mshinwell Nov 16, 2023
56d41b5
Fix tests/regression/pr9326
mshinwell Nov 16, 2023
6f40023
Fix tests/gc-roots
mshinwell Nov 16, 2023
f239e95
Fix tests/asmcomp/polling.c
mshinwell Nov 16, 2023
0bcf995
Fixing of backtrace tests
mshinwell Nov 16, 2023
cd68323
Skip instrumented-runtime tests on 5.x (these tests are not present i…
mshinwell Nov 16, 2023
08c3b51
Fix Ctype.unify call in debugger/loadprinter.ml
mshinwell Nov 16, 2023
ffdb32d
Fixes for systhreads/ build and importing of build attributes from sy…
mshinwell Nov 15, 2023
6412966
Add Condition, Mutex and Semaphore to the stdlib
mshinwell Nov 15, 2023
f63a611
Fix dynlink (including for move of Mutex to the stdlib)
mshinwell Nov 16, 2023
ee74f51
Fix get_header.ml test
mshinwell Nov 17, 2023
58844ed
Add runtime5 predicate in ocamltest and use it to fix backtrace_c_exn.ml
mshinwell Nov 16, 2023
e0f0401
Fix wrong position of modules line in ocaml/testsuite/tests/typing-lo…
mshinwell Nov 17, 2023
6126f65
Fix bug in caml_gc_counters in the 5 runtime
mshinwell Nov 17, 2023
6988364
Remove ocaml/otherlibs/systhreads4/st_pthreads.h, merge error
mshinwell Nov 20, 2023
9efa13b
Promote tests
mshinwell Nov 16, 2023
cd79df8
Move caml_stat_free call in ocaml/runtime4/dynlink_nat.c
mshinwell Nov 20, 2023
8b2867b
port #797 (long frames in frametable) (#2048)
riaqn Nov 20, 2023
61c5e3a
Fix upstream bug with dynlink check/registration ordering, and revert…
mshinwell Nov 20, 2023
bc9a60d
Fix caml_natdynlink_run_toplevel to actually call the registration fu…
mshinwell Nov 20, 2023
3e3e9f0
Add GC test for ocamlnat
stedolan Nov 20, 2023
9e41e2a
Address code review comments
mshinwell Nov 20, 2023
571e11d
Regenerate stdlib/.depend
mshinwell Nov 20, 2023
a258ebf
Fix upstream build
mshinwell Nov 20, 2023
f9f1c74
Fix three runtime4/ occurrences
mshinwell Nov 20, 2023
f9f6c3d
Fix for upstream systhreads4 build
mshinwell Nov 20, 2023
ed0ec49
Don't skip statmemprof tests on runtime4/
mshinwell Nov 20, 2023
9ef13ee
Fix upstream build for debugger4/
mshinwell Nov 20, 2023
e6a48d6
Use runtime_dir not RUNTIME_DIR in the testsuite scriptsd
mshinwell Nov 20, 2023
042326b
Re-enabling (for runtime4) and fixing statmemprof tests
mshinwell Nov 20, 2023
a4687d6
Fix _runtest debugger installation paths
mshinwell Nov 21, 2023
fdf9dac
Port bc9a60dd1eb8cb5a1f7d352ccf149459c7810cdb to runtime/ (fix for ca…
mshinwell Nov 21, 2023
488ee82
Address comments
mshinwell Nov 21, 2023
dd4a923
Merge remote-tracking branch 'flambda-backend/main' into runtime5-fea…
mshinwell Nov 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ocaml/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ clean::
subdirs = \
stdlib $(addprefix otherlibs/, \
$(filter-out runtime_events, $(ALL_OTHERLIBS))) \
debugger ocamldoc ocamltest
debugger$(RUNTIME_SUFFIX) ocamldoc ocamltest

.PHONY: alldepend
alldepend: depend
Expand Down Expand Up @@ -1352,10 +1352,10 @@ clean::

.PHONY: ocamldebugger
ocamldebugger: ocamlc ocamlyacc ocamllex otherlibraries
$(MAKE) -C debugger all
$(MAKE) -C debugger$(RUNTIME_SUFFIX) all

partialclean::
$(MAKE) -C debugger clean
$(MAKE) -C debugger$(RUNTIME_SUFFIX) clean

# Check that the native-code compiler is supported
.PHONY: checknative
Expand Down Expand Up @@ -1667,7 +1667,7 @@ depend: beforedepend

.PHONY: distclean
distclean: clean
$(MAKE) -C debugger distclean
$(MAKE) -C debugger$(RUNTIME_SUFFIX) distclean
$(MAKE) -C manual distclean
$(MAKE) -C ocamldoc distclean
$(MAKE) -C ocamltest distclean
Expand Down Expand Up @@ -1797,7 +1797,7 @@ ifeq "$(WITH_OCAMLDOC)-$(STDLIB_MANPAGES)" "ocamldoc-true"
$(MAKE) -C api_docgen install
endif
if test -n "$(WITH_DEBUGGER)"; then \
$(MAKE) -C debugger install; \
$(MAKE) -C debugger$(RUNTIME_SUFFIX) install; \
fi
ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true"
ifeq "$(TOOLCHAIN)" "msvc"
Expand Down
12 changes: 6 additions & 6 deletions ocaml/Makefile.common-jst
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ $(ocamldir)/otherlibs/dune:

$(ocamldir)/dune.runtime_selection:
if [ "$(RUNTIME_DIR)" = "runtime4" ]; then \
echo "(dirs (:standard \ runtime))" > $@; \
echo "(dirs (:standard \ runtime debugger))" > $@; \
else \
echo "(dirs (:standard \ runtime4))" > $@; \
echo "(dirs (:standard \ runtime4 debugger4))" > $@; \
fi

_build/_bootinstall: Makefile.config $(dune_config_targets)
Expand Down Expand Up @@ -276,10 +276,10 @@ install_for_test: _install
mkdir -p _runtest/lib/ocaml/stublibs/
cp $(main_prefix)/lib/ocaml/stublibs/*.so _runtest/lib/ocaml/stublibs
# ocamldebug
mkdir _runtest/debugger
ln -s ../ocamldebug _runtest/debugger
cp $(main_build)/$(ocamldir)/debugger/.ocamldebug.objs/byte/*.cm* \
_runtest/debugger
mkdir _runtest/debugger$(RUNTIME_SUFFIX)
ln -s ../ocamldebug _runtest/debugger$(RUNTIME_SUFFIX)
cp $(main_build)/$(ocamldir)/debugger$(RUNTIME_SUFFIX)/.ocamldebug.objs/byte/*.cm* \
_runtest/debugger$(RUNTIME_SUFFIX)
# The ast_invariants test needs VERSION to be present. In fact ideally
# we should have all the source files in _runtest too for this test,
# but for the moment we accept it being a weaker check. We're not
Expand Down
16 changes: 7 additions & 9 deletions ocaml/bytecomp/dll.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ type dll_handle
type dll_address
type dll_mode = For_checking | For_execution

(* BACKPORT BEGIN
external dll_open: string -> dll_handle = "caml_dynlink_open_lib"
*)
external dll_open: dll_mode -> string -> dll_handle = "caml_dynlink_open_lib"
(* BACKPORT END *)
external dll_open5: string -> dll_handle = "caml_dynlink_open_lib"

external dll_open4: dll_mode -> string -> dll_handle = "caml_dynlink_open_lib"

let dll_open mode path =
if Config.runtime5 then dll_open5 path else dll_open4 mode path

external dll_close: dll_handle -> unit = "caml_dynlink_close_lib"
external dll_sym: dll_handle -> string -> dll_address
= "caml_dynlink_lookup_symbol"
Expand Down Expand Up @@ -85,11 +87,7 @@ let open_dll mode name =
failwith (fullname ^ ": " ^ Binutils.error_to_string err)
end
| (None | Some (Checking _) as current), For_execution ->
(* BACKPORT BEGIN
begin match dll_open fullname with
*)
begin match dll_open For_execution fullname with
(* BACKPORT END *)
| dll ->
let opened = match current with
| None -> List.remove_assoc fullname !opened_dlls
Expand Down
10 changes: 1 addition & 9 deletions ocaml/debugger/.depend
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ eval.cmo : \
../typing/env.cmi \
debugcom.cmi \
../typing/ctype.cmi \
../utils/compilation_unit.cmi \
../typing/btype.cmi \
eval.cmi
eval.cmx : \
Expand All @@ -203,7 +202,6 @@ eval.cmx : \
../typing/env.cmx \
debugcom.cmx \
../typing/ctype.cmx \
../utils/compilation_unit.cmx \
../typing/btype.cmx \
eval.cmi
eval.cmi : \
Expand Down Expand Up @@ -286,12 +284,10 @@ loadprinter.cmo : \
../utils/misc.cmi \
../parsing/longident.cmi \
../utils/load_path.cmi \
../typing/jkind.cmi \
../typing/ident.cmi \
../typing/env.cmi \
../otherlibs/dynlink/dynlink.cmi \
../typing/ctype.cmi \
../utils/compilation_unit.cmi \
loadprinter.cmi
loadprinter.cmx : \
../typing/types.cmx \
Expand All @@ -303,12 +299,10 @@ loadprinter.cmx : \
../utils/misc.cmx \
../parsing/longident.cmx \
../utils/load_path.cmx \
../typing/jkind.cmx \
../typing/ident.cmx \
../typing/env.cmx \
../otherlibs/dynlink/dynlink.cmx \
../otherlibs/dynlink/dynlink.cmi \
../typing/ctype.cmx \
../utils/compilation_unit.cmx \
loadprinter.cmi
loadprinter.cmi : \
../parsing/longident.cmi \
Expand Down Expand Up @@ -407,7 +401,6 @@ printval.cmo : \
../toplevel/genprintval.cmi \
../typing/env.cmi \
debugcom.cmi \
../utils/compilation_unit.cmi \
printval.cmi
printval.cmx : \
../typing/types.cmx \
Expand All @@ -419,7 +412,6 @@ printval.cmx : \
../toplevel/genprintval.cmx \
../typing/env.cmx \
debugcom.cmx \
../utils/compilation_unit.cmx \
printval.cmi
printval.cmi : \
../typing/types.cmi \
Expand Down
58 changes: 0 additions & 58 deletions ocaml/debugger/debugcom.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ type pc =
module Sp = struct

(* Position in the debuggee's stack. *)
(* BACKPORT BEGIN
type t = {
block : int;
offset : int;
Expand All @@ -66,25 +65,14 @@ module Sp = struct
match Stdlib.compare sp1.block sp2.block with
| 0 -> Stdlib.compare sp1.offset sp2.offset
| x -> x
*)
type t = int

let null = 0
let base _ _ = assert false
let compare = Int.compare
(* BACKPORT END *)

end

(* Identifier of the code fragment for the main program.
Numbering starts at 1 and the runtime registers 2 fragments before
the main program: one for uncaught exceptions and one for callbacks.
*)
(* BACKPOR BEGIN
let main_frag = 3
*)
let main_frag = 0
(* BACKPORT END *)

let set_event {frag; pos} =
output_char !conn.io_out 'e';
Expand Down Expand Up @@ -149,21 +137,13 @@ let do_go_smallint n =
| c -> Misc.fatal_error (Printf.sprintf "Debugcom.do_go %c" c)
in
let event_counter = input_binary_int !conn.io_in in
(* BACKPORT BEGIN
let block = input_binary_int !conn.io_in in
let offset = input_binary_int !conn.io_in in
*)
let rep_stack_pointer = input_binary_int !conn.io_in in
(* BACKPORT END *)
let frag = input_binary_int !conn.io_in in
let pos = input_binary_int !conn.io_in in
{ rep_type = summary;
rep_event_count = Int64.of_int event_counter;
(* BACKPORT BEGIN
rep_stack_pointer = Sp.{block; offset};
*)
rep_stack_pointer;
(* BACKPORT END *)
rep_program_pointer = {frag; pos} })

let rec do_go n =
Expand Down Expand Up @@ -212,19 +192,11 @@ let wait_child chan =
let initial_frame () =
output_char !conn.io_out '0';
flush !conn.io_out;
(* BACKPORT BEGIN
let block = input_binary_int !conn.io_in in
let offset = input_binary_int !conn.io_in in
*)
let stack_pos = input_binary_int !conn.io_in in
(* BACKPORT END *)
let frag = input_binary_int !conn.io_in in
let pos = input_binary_int !conn.io_in in
(* BACKPORT BEGIN
(Sp.{block; offset}, {frag; pos})
*)
(stack_pos, {frag; pos})
(* BACKPOR END *)

let set_initial_frame () =
ignore(initial_frame ())
Expand All @@ -237,14 +209,9 @@ let up_frame stacksize =
output_char !conn.io_out 'U';
output_binary_int !conn.io_out stacksize;
flush !conn.io_out;
(* BACKPORT BEGIN
let block = input_binary_int !conn.io_in in
let offset = input_binary_int !conn.io_in in
*)
let stack_pos = input_binary_int !conn.io_in in
(* BACKPORT END *)
let frag, pos =
(* BACKPORT BEGIN
if block = -1 then
begin
assert (offset = -1);
Expand All @@ -254,56 +221,31 @@ let up_frame stacksize =
let pos = input_binary_int !conn.io_in in
frag, pos
end
*)
if stack_pos = -1
then 0, 0
else let frag = input_binary_int !conn.io_in in
let pos = input_binary_int !conn.io_in in
frag, pos
(* BACKPORT END *)
in
(* BACKPORT BEGIN
(Sp.{block; offset}, { frag; pos })
*)
(stack_pos, { frag; pos })
(* BACKPORT END *)

(* Get and set the current frame position *)

let get_frame () =
output_char !conn.io_out 'f';
flush !conn.io_out;
let stack_pos = input_binary_int !conn.io_in in
(*
let block = input_binary_int !conn.io_in in
let offset = input_binary_int !conn.io_in in
*)
let frag = input_binary_int !conn.io_in in
let pos = input_binary_int !conn.io_in in
(*
(Sp.{block; offset}, {frag; pos})
*)
(stack_pos, {frag; pos})

let set_frame stack_pos =
output_char !conn.io_out 'S';
(* BACKPORT BEGIN
output_binary_int !conn.io_out stack_pos.Sp.block;
output_binary_int !conn.io_out stack_pos.Sp.offset
*)
output_binary_int !conn.io_out stack_pos
(* BACKPORT END *)

(* Set the trap barrier to given stack position. *)

let set_trap_barrier pos =
output_char !conn.io_out 'b';
(* BACKPORT BEGIN
output_binary_int !conn.io_out pos.Sp.block;
output_binary_int !conn.io_out pos.Sp.offset
*)
output_binary_int !conn.io_out pos
(* BACKPORT END *)

(* Handling of remote values *)

Expand Down
4 changes: 0 additions & 4 deletions ocaml/debugger/debugcom.mli
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
(* Low-level communication with the debuggee *)

module Sp : sig
(* BACKPORT BEGIN
type t
*)
type t = int
(* BACKPORT END *)
val null : t
val base : t -> int -> t
val compare : t -> t -> int
Expand Down
1 change: 0 additions & 1 deletion ocaml/debugger/eval.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ exception Error of error

let abstract_type =
Btype.newgenty (Tconstr (Pident (Ident.create_local "<abstr>"), [], ref Mnil))

let get_global_or_predef id =
try
Debugcom.Remote_value.global (Symtable.get_global_position id)
Expand Down
8 changes: 0 additions & 8 deletions ocaml/debugger/frames.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ let selected_event_is_before () =
let rec move_up frame_count event =
if frame_count <= 0 then event else begin
let (sp, pc) = up_frame event.ev_ev.ev_stacksize in
(* BACKPORT BEGIN
if sp = Sp.null then raise Not_found;
*)
if sp < Sp.null then raise Not_found;
(* BACKPORT END *)
move_up (frame_count - 1) (any_event_at_pc pc)
end

Expand Down Expand Up @@ -117,11 +113,7 @@ let do_backtrace action =
begin try
while action (Some !event) do
let (sp, pc) = up_frame !event.ev_ev.ev_stacksize in
(* BACKPORT BEGIN
if sp = Sp.null then raise Exit;
*)
if sp < Sp.null then raise Exit;
(* BACKPORT END *)
event := any_event_at_pc pc
done
with Exit -> ()
Expand Down
Loading
Loading