From c8e04ac435ee95f6ae86e16b9e34f6c92a6d4efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Backstr=C3=B6m?= Date: Mon, 4 Nov 2024 16:12:29 +0100 Subject: [PATCH] erts: Include jit.pdb and release all pdb files When debugging on windows, the name of the pdb file is not the name of the file being debugger, but the name of the file as it was compiled. We rename beam.jit.dll to beam.smp.dll during the build so the pdb needed is called jit.pdb and not smp.pdb. We also make sure to release all pdb files so that they are part of the installer. --- erts/emulator/Makefile.in | 4 ++++ erts/epmd/src/Makefile.in | 3 +++ erts/etc/common/Makefile.in | 5 +++++ lib/sasl/src/systools_make.erl | 3 ++- lib/sasl/test/systools_SUITE.erl | 24 ++++++++++++++++++------ otp_build | 15 ++++----------- 6 files changed, 36 insertions(+), 18 deletions(-) diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in index a35bc38d4099..f926ab69291f 100644 --- a/erts/emulator/Makefile.in +++ b/erts/emulator/Makefile.in @@ -559,6 +559,10 @@ release_spec: all $(INSTALL_DATA) $(RELEASE_INCLUDES) "$(RELEASE_PATH)/usr/include" $(INSTALL_DATA) $(RELEASE_INCLUDES) "$(RELSYSDIR)/include" $(INSTALL_PROGRAM) $(BINDIR)/$(EMULATOR_EXECUTABLE) "$(RELSYSDIR)/bin" +ifeq ($(TARGET),win32) + $(INSTALL_DATA) $(BINDIR)/$(EMULATOR_EXECUTABLE:.dll=.pdb) "$(RELSYSDIR)/bin" + $(INSTALL_DATA) $(BINDIR)/$(FLAVOR_EXECUTABLE:.dll=.pdb) "$(RELSYSDIR)/bin" +endif ifeq ($(RELEASE_LIBBEAM),yes) $(INSTALL_DIR) "$(RELSYSDIR)/lib" $(INSTALL_PROGRAM) $(BINDIR)/$(EMULATOR_LIB) "$(RELSYSDIR)/lib" diff --git a/erts/epmd/src/Makefile.in b/erts/epmd/src/Makefile.in index f21ac5e38652..87df52f4812a 100644 --- a/erts/epmd/src/Makefile.in +++ b/erts/epmd/src/Makefile.in @@ -120,6 +120,9 @@ include $(ERL_TOP)/make/otp_release_targets.mk release_spec: all $(INSTALL_DIR) "$(RELEASE_PATH)/erts-$(VSN)/bin" $(INSTALL_PROGRAM) $(INSTALL_PROGS) "$(RELEASE_PATH)/erts-$(VSN)/bin" +ifeq ($(TARGET),win32) + $(INSTALL_DATA) $(INSTALL_PROGS:.exe=.pdb) "$(RELEASE_PATH)/erts-$(VSN)/bin" +endif release_docs_spec: diff --git a/erts/etc/common/Makefile.in b/erts/etc/common/Makefile.in index 2778fb1504d9..b8efe9ceda2c 100644 --- a/erts/etc/common/Makefile.in +++ b/erts/etc/common/Makefile.in @@ -467,6 +467,7 @@ $(OBJDIR)/safe_string.o: $(ETC)/safe_string.c $(RC_GENERATED) # erl_call $(BINDIR)/erl_call@EXEEXT@: $(ERL_TOP)/lib/erl_interface/bin/$(TARGET)/erl_call@EXEEXT@ $(ld_verbose)cp $< $@ + $(ld_verbose)cp $(<:.exe=.pdb) $(@:.exe=.pdb) ifneq ($(TARGET),win32) $(BINDIR)/$(ERLEXEC): $(OBJDIR)/$(ERLEXEC).o $(ERTS_LIB) @@ -545,6 +546,10 @@ ifneq ($(TARGET), win32) endif ifneq ($(INSTALL_PROGS),) $(INSTALL_PROGRAM) $(INSTALL_PROGS) "$(RELEASE_PATH)/erts-$(VSN)/bin" +ifeq ($(TARGET),win32) + $(INSTALL_DATA) $(INSTALL_PROGS:.exe=.pdb) "$(RELEASE_PATH)/erts-$(VSN)/bin" + $(INSTALL_DATA) $(ERLEXEC:.dll=.pdb) "$(RELEASE_PATH)/erts-$(VSN)/bin" +endif endif ifneq ($(INSTALL_TOP),) $(INSTALL_SCRIPT) $(INSTALL_TOP) "$(RELEASE_PATH)" diff --git a/lib/sasl/src/systools_make.erl b/lib/sasl/src/systools_make.erl index bc3b0ae92cf4..55743777feae 100644 --- a/lib/sasl/src/systools_make.erl +++ b/lib/sasl/src/systools_make.erl @@ -1589,9 +1589,10 @@ preloaded() -> erts_binary_filter() -> Cmds = ["typer", "dialyzer", "ct_run", "yielding_c_fun", "erlc"], + Extensions = [".exe", ".pdb"], case os:type() of {unix,_} -> Cmds; - {win32,_} -> [ [Cmd, ".exe"] || Cmd <- Cmds] + {win32,_} -> [ [Cmd, Ext] || Cmd <- Cmds, Ext <- Extensions] end. %%______________________________________________________________________ diff --git a/lib/sasl/test/systools_SUITE.erl b/lib/sasl/test/systools_SUITE.erl index a72b65f0f777..3d1487991752 100644 --- a/lib/sasl/test/systools_SUITE.erl +++ b/lib/sasl/test/systools_SUITE.erl @@ -1119,12 +1119,24 @@ erts_tar(Config) -> "start","start_erl.src","start.src","to_erl"], ["ct_run","dialyzer","erlc","typer","yielding_c_fun"]}; {win32, _} -> - {["beam.smp.pdb","erl.exe", - "erl.pdb","erl_log.exe","erlexec.dll","erlsrv.exe","heart.exe", - "start_erl.exe","beam.smp.dll", - "epmd.exe","erl.ini","erl_call.exe", - "erlexec.pdb","escript.exe","inet_gethost.exe"], - ["dialyzer.exe","erlc.exe","yielding_c_fun.exe","ct_run.exe","typer.exe"]} + Files = ["beam.smp.dll", + "epmd.exe", + "erl.exe", + "erl_log.exe", + "erlexec.dll", + "erlsrc.exe", + "escript.exe", + "heart.exe", + "inet_gethost.exe", + "start_erl.exe"], + PdbFiles = [filename:rootname(F) ++ ".pdb" || F <- Files], + Ignored = ["ct_run.exe", + "dialyzer.exe", + "erlc.exe", + "typer.exe", + "yielding_c_fun.exe"], + PdbIgnored = [filename:rootname(F) ++ ".pdb" || F <- Ignored], + {Files ++ PdbFiles, Ignored ++ PdbIgnored} end, ErtsTarContent = diff --git a/otp_build b/otp_build index d2946fec2507..bec4886e1ca8 100755 --- a/otp_build +++ b/otp_build @@ -1257,20 +1257,13 @@ do_update_ex_doc () do_debuginfo_win32 () { setup_make - (cd erts/emulator && $MAKE MAKE="$MAKE" TARGET=$TARGET debug) || exit 1 + ($MAKE MAKE="$MAKE" TARGET=$TARGET TYPE=debug) || exit 1 if [ -z "$1" ]; then - RELDIR="$ERL_TOP/release/$TARGET" + RELDIR="$ERL_TOP/release/$TARGET" else - RELDIR="$1" + RELDIR="$1" fi - BINDIR="$ERL_TOP/bin/$TARGET" - EVSN=`grep '^VSN' erts/vsn.mk | sed 's,^VSN.*=[^0-9]*\([0-9].*\)$,@\1,g;s,^[^@].*,,g;s,^@,,g'` - for f in beam.debug.smp.dll beam.smp.pdb beam.debug.smp.dll.pdb erl.pdb erlexec.pdb; do - if [ -f $BINDIR/$f ]; then - rm -f $RELDIR/erts-$EVSN/bin/$f - cp $BINDIR/$f $RELDIR/erts-$EVSN/bin/$f - fi - done + ($MAKE release RELEASE_ROOT="$RELDIR" MAKE="$MAKE" TARGET=$TARGET TYPE=debug) || exit 1 } do_installer_win32 ()