Reputation: 2741
I am trying to Debug a service running via docker-compose through GDB. I have the below docker-compose having two services and i wasnt to debug the 'service_test' service using gdb. iam exposing the port 5000 for the same.
I am starting the docker-compose by using the below command. 'start.sh' file is having the 'docker-compose up' command.
gdbserver localhost:5000 start.sh
in another terminal iam connecting using the below command which starts the gdb prompt terminal,
gdb service_exec
In GDB prompt terminal iam trying to connect to the target host using below commands.
target remote localhost:5000
continue
Although it executes the target program it is not able to trace the errors from the host. The GDB prompt is stuck in the below attached message, and in gdbserver the program have ran with the error.
Any idea what could be this issue and how to resolve this?
I tried the below set commands which Andrew commented, but it does not seems to be working. on adding the below two set commands the program is not getting executed in gdbserver terminal and the hiost terminal is showing the below log in the link.
set follow-fork-mode child
set detach-on-fork off
Upvotes: 1
Views: 223