Files
openairinterface5g/docker/debug_core_image.sh
Robert Schmidt 8107939f08 Change OAI license to CSSL v1.0 (and others)
- all RAN code, CI code, configuration files, dockerfiles, in CSSL v1.0
- all deployment code (openshift, charts, ancillary files like shell
  scripts), in MIT
- documentation in CC-BY-4.0
- exceptions might apply and are listed in NOTICE
- there is a new LICENSES folder with all licenses
- CONTRIBUTIONS.md has been updated accordingly

For automated changes based on OAI PL v1.1:

    perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.{c,h,cpp}
    perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.ts
    perl -i~ -0pe 's/<!--.*Licensed to the OpenAirInterface.*openairinterface.org\n.*-->/<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->/s' **/*.xml

The rest (cmake, files with missing license, cmake) manually.
2026-03-27 16:36:37 +01:00

62 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# SPDX-License-Identifier: MIT
if [ $# -ne 3 ]; then
echo "usage: $0 <image> <coredump> <path-to-sources>"
exit 1
fi
die() {
echo $1
exit 1
}
# for mounting into docker, need absolute path -> realpath
IMAGE=$1
COREDUMP=$(realpath $2)
SOURCES=$(realpath $3)
set -x
# the image/build_oai builds in cmake_targets/ran_build/build, so source
# information is relative to this path. In case the user did not compile on
# their computer, this directory will not exist. still allow to find it by
# creating it
BUILD_DIR=$SOURCES/cmake_targets/ran_build/build
mkdir -p $BUILD_DIR || die "cannot create $BUILD_DIR: is $SOURCES valid?"
# check if coredump is valid file
[ -f $COREDUMP ] || die "no such file: $COREDUMP"
# check if image exists, and determine type (gnb, nr-ue) for correct invocation
# of gdb
docker image inspect $IMAGE > /dev/null || exit 1
if [ $(grep "oai-gnb:" <<< $IMAGE) ] || [ $(grep "oai-gnb-aerial:" <<< $IMAGE) ]; then
EXEC=bin/nr-softmodem
TYPEPATH=oai-gnb
elif [ $(grep "oai-gnb-aw2s:" <<< $IMAGE) ]; then
EXEC=bin/nr-softmodem
TYPEPATH=oai-gnb-aw2s
elif [ $(grep "oai-nr-ue:" <<< $IMAGE) ]; then
EXEC=bin/nr-uesoftmodem
TYPEPATH=oai-nr-ue
elif [ $(grep "oai-enb:" <<< $IMAGE) ]; then
EXEC=bin/lte-softmodem
TYPEPATH=oai-enb
elif [ $(grep "oai-lte-ue:" <<< $IMAGE) ]; then
EXEC=bin/lte-uesoftmodem
TYPEPATH=oai-lte-ue
else
die "cannot determine if image is gnb or nr-ue: must match \"oai-gnb:\" or \"oai-nr-ue:\""
fi
# run gdb inside a container. We mount the coredump and the sources inside the
# container, and run gdb with the core dump, the correct executable, and using
# the source directory to show correct line numbers
docker run --rm -it \
-v $COREDUMP:/tmp/coredump \
-v $SOURCES:/oai-ran/ \
--entrypoint bash \
$IMAGE \
-c "gdb --dir=src/cmake_targets/ran_build/build $EXEC /tmp/coredump"