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

otp: move gdb-tools outside of erlang/otp repo #9178

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
1 change: 1 addition & 0 deletions .github/dockerfiles/Dockerfile.32-bit
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ENV CFLAGS="-O2 -g -Werror -DwxSTC_DISABLE_MACRO_DEPRECATIONS=1"
## Configure, check that no application are disabled, then make and then build doc chunks
RUN ./configure --with-ssl --prefix=/otp && \
if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
./otp_build download_gdb_tools && \
make && make install

## Disable -Werror as testcases do not compile with it on
Expand Down
1 change: 1 addition & 0 deletions .github/dockerfiles/Dockerfile.clang
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ENV CC=clang CXX=clang++ \
# give us this information such as gcc does...
RUN ./configure --with-ssl --with-ssl-lib-subdir=lib/x86_64-linux-gnu --prefix=/otp && \
if cat lib/*/CONF_INFO || cat lib/*/SKIP || cat lib/SKIP-APPLICATIONS; then exit 1; fi && \
./otp_build download_gdb_tools && \
make && sudo make install && \
make FLAVOR=emu && sudo make install FLAVOR=emu

Expand Down
3 changes: 2 additions & 1 deletion .github/dockerfiles/Dockerfile.cross-compile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ WORKDIR /buildroot/otp
# We cannot use config.guess for --build since its value clashes with the
# canonical value of host...
RUN ./configure --prefix=/otp/ --host=$HOST --build=x86-pc-linux-gnu && \
./otp_build download_gdb_tools && \
OTP_SMALL_BUILD=true V=1 make && \
make install

Expand All @@ -70,7 +71,7 @@ RUN cd release/tests/test_server && \
-eval "ts:install([{cross,\"yes\"},{crossflags,[{\"host\",\"$HOST\"}]},{crossroot,\"/$ERL_TOP\"}])." \
-s ts compile_testcases -s init stop

FROM debian as install
FROM ghcr.io/erlang/otp/debian-base as install

# Install the released application
COPY --from=build /otp /otp
Expand Down
2 changes: 1 addition & 1 deletion .github/dockerfiles/Dockerfile.debian-base
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ENV CROSS_LIBS="$INSTALL_LIBS"
## 1. Install build-essential to get access to dpkg-architecture
## 2. Use dpkg-architecture to figure out what we are running on
## 3. If the HOST_TRIP does not equal BUILD_TRIP we should cross compile
RUN apt-get update && apt-get -y upgrade && apt-get install -y build-essential pkg-config && \
RUN apt-get update && apt-get -y upgrade && apt-get install -y build-essential pkg-config git && \
BUILD_TRIP=`dpkg-architecture -t${HOST_TRIP} -qDEB_BUILD_MULTIARCH` && \
BUILD_ARCH=`dpkg-architecture -t${HOST_TRIP} -qDEB_BUILD_ARCH` && \
if [ "$HOST_TRIP" != "$BUILD_TRIP" ]; then \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ jobs:
-e EXTRA_ARGS="-ct_hooks cth_surefire [{path,\"/buildroot/otp/$DIR/make_test_dir/${{ matrix.type }}_junit.xml\"}]" \
-v "$PWD/make_test_dir:/buildroot/otp/$DIR/make_test_dir" \
-v "$PWD/scripts:/buildroot/otp/scripts" \
otp "make TYPE=${TYPE} && make ${APP}_test TYPE=${TYPE}"
otp "./otp_build download_gdb_tools && make emulator && make TYPE=${TYPE} && make ${APP}_test TYPE=${TYPE}"
## Rename os_mon to debug for debug build
if [ "$APP" != "${{ matrix.type }}" ]; then
mv make_test_dir/${APP}_test "make_test_dir/${{ matrix.type }}_test"
Expand Down
14 changes: 7 additions & 7 deletions erts/etc/common/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ ERTS_LIB = $(ERL_TOP)/erts/lib_src/obj/$(TARGET)/$(TYPE)/MADE

EI_LIB = -L$(ERL_TOP)/lib/erl_interface/obj/$(TARGET) -lei $(THR_LIBS)

GDB_TOOLS = $(ETC)/gdb-tools

# ----------------------------------------------------
# Release directory specification
# ----------------------------------------------------
Expand Down Expand Up @@ -204,7 +206,7 @@ INSTALL_MISC = $(UXETC)/format_man_pages
INSTALL_SRC = $(UXETC)/setuid_socket_wrap.c #delivered as an example
ERLEXECDIR = .
INSTALL_LIBS =
EXTRA_LIBS = $(BINDIR)/jit-reader.so
EXTRA_LIBS =
INSTALL_OBJS =
INSTALL_INCLUDES =
TEXTFILES = Install erl.src
Expand All @@ -215,15 +217,19 @@ INSTALL_PROGS = \
$(INSTALL_EMBEDDED_PROGS)
endif

-include ../unix/gdb-tools/jit-reader.mk

CREATE_DIRS=$(OBJDIR) $(BINDIR)

ifneq ($(strip $(CREATE_DIRS)),)
_create_dirs := $(shell mkdir -p $(CREATE_DIRS))
endif

.DEFAULT_GOAL := etc
.PHONY: etc
etc: $(ENTRY_OBJ) $(INSTALL_PROGS) $(EXTRA_LIBS) $(INSTALL_LIBS) $(TEXTFILES) $(INSTALL_TOP_BIN)


# erlexec needs the erts_internal library...
$(ERTS_LIB):
$(V_at)cd $(ERL_TOP)/erts/lib_src && $(MAKE) $(TYPE)
Expand Down Expand Up @@ -500,12 +506,6 @@ $(BINDIR)/ct_run@EXEEXT@: $(OBJDIR)/ct_run.o $(ERTS_LIB)
$(OBJDIR)/ct_run.o: ct_run.c $(RC_GENERATED)
$(V_CC) $(CFLAGS) -o $@ -c ct_run.c

$(OBJDIR)/jit-reader.o: $(ETC)/jit-reader.c $(ETC)/jit-reader.h
$(V_CC) $(DED_CFLAGS) -I$(ETC) -o $@ -c $<

$(BINDIR)/jit-reader.so: $(OBJDIR)/jit-reader.o
$(V_LD) $(DED_LDFLAGS) -o $@ $^

Install: $(UXETC)/Install.src ../../vsn.mk $(TARGET)/Makefile
$(vsn_verbose)sed -e 's;%I_VSN%;$(VSN);' \
-e 's;%EMULATOR%;$(EMULATOR);' \
Expand Down
34 changes: 33 additions & 1 deletion erts/etc/unix/cerl.src
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,30 @@
# FIXME For GDB you can also set the break point using "-break FUNCTION".
# FIXME For GDB you can also point out your own .gdbini......

install_gdb_tools ()
{
if [ -z "$(find $ERL_TOP -name jit-reader.c)" ]
then
printf "%s" "Do you want to install gdb-tools? (Y/n) "
read -r confirm
case "$confirm" in
"Y"|"y"|"")
"$ERL_TOP"/otp_build download_gdb_tools
build_gdb_tools
;;
esac
else
## Check that correct version is present
"$ERL_TOP"/otp_build download_gdb_tools
build_gdb_tools
fi
}

build_gdb_tools ()
{
(cd "$ERL_TOP"/erts/etc/common && make)
}

# These are marked for export
export ROOTDIR
export PROGNAME
Expand Down Expand Up @@ -435,6 +459,9 @@ if [ "x$GDB" = "x" ]; then
exec $EXEC $xargs ${1+"$@"}
fi
elif [ "x$GDB" = "xgdb" ]; then

install_gdb_tools

case "x$core" in
x)
# Get emu args to use from erlexec...
Expand Down Expand Up @@ -474,7 +501,9 @@ elif [ "x$GDB" = "xegdb" ]; then
if [ "x$EMACS" = "x" ]; then
EMACS=emacs
fi


install_gdb_utils

case "x$core" in
x)
# Get emu args to use from erlexec...
Expand Down Expand Up @@ -513,6 +542,9 @@ elif [ "x$GDB" = "xegdb" ]; then
EVAL="(progn (gdb \"gdb $GDBARGS -x $cmdfile\"))"
exec $EMACS --eval "$EVAL"
elif [ "x$GDB" = "xdump" ]; then

install_gdb_tools

cmdfile="/tmp/.cerlgdb.$$"
## Examine the result of "file $core" in case it is not the emulator
## that created the dump
Expand Down
Loading
Loading