You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5597 Reporter:@avsm Assigned to: meyer Status: closed (set by @xavierleroy on 2015-12-11T18:08:00Z) Resolution: fixed Priority: low Severity: feature Version: 3.12.1 Target version: 4.00.1+dev Fixed in version: 4.00.0+dev Category: runtime system and C interface
Bug description
When using caml_trace_flag=1 with an embedded bytecode application (linked with ocamlc -output-obj -o x.c), the names of primitives are not registered in caml_startup_code. Thus the instrtrace looks like:
./run.sh in the attached tar ball will show the before after.
The only way to activate caml_trace_flag is via manually compiling the debug libasmrun.d and setting the flag, as parsing command line parameters is not done by caml_startup_code. Would a patch to add "t" to OCAMLRUNPARAM for debug bytecode builds be ok?
Original bug ID: 5597
Reporter: @avsm
Assigned to: meyer
Status: closed (set by @xavierleroy on 2015-12-11T18:08:00Z)
Resolution: fixed
Priority: low
Severity: feature
Version: 3.12.1
Target version: 4.00.1+dev
Fixed in version: 4.00.0+dev
Category: runtime system and C interface
Bug description
When using caml_trace_flag=1 with an embedded bytecode application (linked with ocamlc -output-obj -o x.c), the names of primitives are not registered in caml_startup_code. Thus the instrtrace looks like:
4801 PUSHACC1
4802 C_CALL1 unknown primitive 204
4804 SUBINT
4805 PUSHACC2
4806 GTINT
4807 BRANCHIFNOT 8
4816 ACC2
4817 C_CALL1 unknown primitive 205
4819 PUSHACC3
4820 PUSHCONST0
4821 PUSHACC2
4822 PUSHACC5
4823 PUSHACC5
4824 C_CALL5 unknown primitive 215
and after registering them, looks like:
4801 PUSHACC1
4802 C_CALL1 caml_ml_string_length
4804 SUBINT
4805 PUSHACC2
4806 GTINT
4807 BRANCHIFNOT 8
4816 ACC2
4817 C_CALL1 caml_create_string
4819 PUSHACC3
4820 PUSHCONST0
4821 PUSHACC2
4822 PUSHACC5
4823 PUSHACC5
4824 C_CALL5 caml_blit_string
Steps to reproduce
./run.sh in the attached tar ball will show the before after.
The only way to activate caml_trace_flag is via manually compiling the debug libasmrun.d and setting the flag, as parsing command line parameters is not done by caml_startup_code. Would a patch to add "t" to OCAMLRUNPARAM for debug bytecode builds be ok?
Additional information
diff --git a/byterun/dynlink.c b/byterun/dynlink.c
index 7df594d..729abe3 100644
--- a/byterun/dynlink.c
+++ b/byterun/dynlink.c
@@ -184,8 +184,15 @@ void caml_build_primitive_table_builtin(void)
{
int i;
caml_ext_table_init(&caml_prim_table, 0x180);
+#ifdef DEBUG
+#endif
caml_ext_table_add(&caml_prim_table, (void *) caml_builtin_cprim[i]);
+#ifdef DEBUG
+#endif
+}
}
#endif /* NATIVE_CODE */
File attachments
The text was updated successfully, but these errors were encountered: