Skip to content

Commit 31aceda

Browse files
committed
Export glue as stabs on Windows as well
1 parent 09ebda7 commit 31aceda

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/boot/be/pe.ml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -785,18 +785,26 @@ let crate_exports (sem:Semant.ctxt) : pe_export array =
785785
in
786786

787787
(* Make some fake symbol table entries to aid in debugging. *)
788-
let export_stab (node_id, fixup) =
789-
let name = Hashtbl.find sem.Semant.ctxt_all_item_names node_id in
788+
let export_stab name fixup =
790789
{
791790
pe_export_name_fixup = new_fixup "export name fixup";
792-
pe_export_name = "rust$" ^ (Ast.sprintf_name () name);
791+
pe_export_name = "rust$" ^ name;
793792
pe_export_address_fixup = fixup
794793
}
795794
in
795+
let export_stab_of_fn (node_id, fixup) =
796+
let name = Hashtbl.find sem.Semant.ctxt_all_item_names node_id in
797+
export_stab ("fn$" ^ (Semant.string_of_name name)) fixup
798+
in
799+
let export_stab_of_glue (glue, code) =
800+
export_stab (Semant.glue_str sem glue) code.Semant.code_fixup
801+
in
796802

797803
let stabs =
798-
let pairs = htab_pairs sem.Semant.ctxt_fn_fixups in
799-
Array.of_list (List.map export_stab pairs)
804+
Array.of_list (List.concat [
805+
(List.map export_stab_of_fn (htab_pairs sem.Semant.ctxt_fn_fixups));
806+
(List.map export_stab_of_glue (htab_pairs sem.Semant.ctxt_glue_code))
807+
])
800808
in
801809

802810
Array.concat

0 commit comments

Comments
 (0)