File tree Expand file tree Collapse file tree 3 files changed +3847
-19
lines changed Expand file tree Collapse file tree 3 files changed +3847
-19
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,10 @@ source "$SCRIPT_LOCATION"/utils.sh
1111echo " Arguments received: $@ "
1212
1313optparse.define short=c long=container-name desc=" Name of the Docker container to run tests in" variable=CONTAINER_NAME
14- optparse.define short=i long=docker-image desc=" Docker image name to start container from" variable=DOCKER_IMAGE
15- optparse.define short=r long=result-path desc=" Name suffix used in core dump file path" variable=RESULT
16- optparse.define short=s long=do-setup desc=" Run setup-repo.sh inside the container" variable=DO_SETUP
17- optparse.define short=u long=packages-url desc=" Packages url" variable=PACKAGES_URL
14+ optparse.define short=i long=docker-image desc=" Docker image name to start container from" variable=DOCKER_IMAGE
15+ optparse.define short=r long=result-path desc=" Name suffix used in core dump file path" variable=RESULT
16+ optparse.define short=s long=do-setup desc=" Run setup-repo.sh inside the container" variable=DO_SETUP
17+ optparse.define short=u long=packages-url desc=" Packages url" variable=PACKAGES_URL
1818source $( optparse.build)
1919
2020if [[ " $EUID " -ne 0 ]]; then
104104
105105# install deps
106106if [[ " $RESULT " == * rocky* ]]; then
107- execInnerDockerWithRetry " $CONTAINER_NAME " ' yum update -y && yum install -y cracklib-dicts diffutils elfutils epel-release findutils iproute gawk gcc-c++ gdb hostname lz4 patch perl procps-ng rsyslog sudo tar wget which'
107+ execInnerDockerWithRetry " $CONTAINER_NAME " ' yum update -y && yum install -y cracklib-dicts diffutils elfutils epel-release expect findutils iproute gawk gcc-c++ gdb hostname lz4 patch perl procps-ng rsyslog sudo tar wget which'
108108else
109109 change_ubuntu_mirror_in_docker " $CONTAINER_NAME " " us"
110- execInnerDockerWithRetry " $CONTAINER_NAME " ' apt update -y && apt install -y elfutils findutils iproute2 g++ gawk gdb hostname liblz4-tool patch procps rsyslog sudo tar wget'
110+ execInnerDockerWithRetry " $CONTAINER_NAME " ' apt update -y && apt install -y elfutils expect findutils iproute2 g++ gawk gdb hostname liblz4-tool patch procps rsyslog sudo tar wget'
111111fi
112112
113113# Configure core dump naming pattern
Original file line number Diff line number Diff line change @@ -9,25 +9,24 @@ SCRIPT_LOCATION=$(dirname "$0")
99DUMPNAME=$4
1010STEP_NAME=$5
1111
12- save_ansi_to_html ()
13- {
14- echo " <b> $1 </b>" >> " ${FILENAME} " ;
15- cat " $DUMPNAME " | bash " ${SCRIPT_LOCATION} " /ansi2html.sh --palette=solarized >> " ${FILENAME} "
16- }
12+ save_ansi_to_html () {
1713
18- invoke_gdb_command ()
19- {
20- echo " gdb -q ${BINARY} --core ${COREDUMP} -ex '$1 ' -ex quit"
14+ echo " <h2> $1 </h2>" >> " ${FILENAME} "
15+ cat " $DUMPNAME " | bash " ${SCRIPT_LOCATION} " /ansi2html.sh --palette=solarized >> " ${FILENAME} "
16+ }
17+ invoke_gdb_command () {
18+ unbuffer gdb -x " ${SCRIPT_LOCATION} " /gdbinit -q ${BINARY} --core ${COREDUMP} -ex " $1 " -ex quit >> " $DUMPNAME "
2119}
2220
21+ echo " <h1> Step: ${STEP_NAME} <br> Binary name: ${BINARY} <br> </h1>" >> " ${FILENAME} "
2322
24- gdb -q " ${BINARY} " --core ${COREDUMP} -ex ' bt' -ex quit >> " $DUMPNAME "
25- gdb -q " ${BINARY} " --core ${COREDUMP} -ex ' info args' -ex quit >> " $DUMPNAME "
26- gdb -q " ${BINARY} " --core ${COREDUMP} -ex ' info locals' -ex quit >> " $DUMPNAME "
27-
28- echo " <b> Step: ${STEP_NAME} <br> Binary name: ${BINARY} <br> </b>" >> " ${FILENAME} " ;
23+ invoke_gdb_command ' bt full'
2924save_ansi_to_html " Backtrace"
25+
26+ invoke_gdb_command " info args"
3027save_ansi_to_html " Arguments"
28+
29+ invoke_gdb_command " info locals"
3130save_ansi_to_html " Locals"
3231
3332gzip -5 " ${COREDUMP} "
You can’t perform that action at this time.
0 commit comments