0

I have bash script that launches a program through gdb and is supposed to restart it in case if it crashes.
I've stuck on a misunderstanding on some kind of the "-y" confirmation in the end of the gdb:

sudo nice -n $NICE sudo -u $USER expect_unbuffer -p gdb ./silverback.bin -ex r -ex bt -ex quit \
2>&1 | tee debug-logs/gdb-"`date +%Y.%m.%d-%H:%M:%S`"

And the result is:

Thread 1 "silverback.bin" received signal SIGSEGV, Segmentation fault.
raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
50  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
#0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00005555555c7ffc in ...
...
Core/main_linux_dedicated.cpp:265
A debugging session is active.

Inferior 1 [process 13260] will be killed.

Quit anyway? (y or n)

This script is inside the while-do block to keep restarting

while :; do
...
echo "Restarting, Ctrl-C to exit"
sleep 7

ps: Im using raise(SIGSEGV) to cause a crash for the test.

IgorZ
  • 1,125
  • 3
  • 20
  • 44

1 Answers1

0

My bad. Found an answer: Get rid of "quit anyway" prompt using GDB: Just kill the process and quit

.gdbinit setting:

define hook-quit
  set confirm off
end
IgorZ
  • 1,125
  • 3
  • 20
  • 44