This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug cli/22435] During remote debugging, gdbserver is unable to connect to gdb client when the debug session is invoked for the second time


https://sourceware.org/bugzilla/show_bug.cgi?id=22435

--- Comment #1 from eshaahuja1991 at gmail dot com ---
For debugging an application which is already running on remote target
(architecture: arm-linux-gnueabihf), I am using gdb from Linaro toolchain: GNU
gdb (Linaro_GDB-2017.05) 7.12.1.20170417-git and on the target, gdbserver(GNU
gdbserver (GDB) 7.12.1.20170417-git). I have ran the gdbserver on the remote
target side in a multi mode as: 'gdbserver --multi :<port no>. The commands
used for debugging the application (myApp) remotely, which is already running
on remote target are highlighted in the gdb traces below.
After the debug is complete, I want to detach my application (myApp) from gdb,
because my application (myApp) should be running indefinitely. I tried the
commands: detach, detach inferior id, but got the response that "Cannot execute
this command while the target is running. Use the "interrupt" command to stop
the target and then try again". I then tried to give interrupt command,
keyboard interrupt. After this, I got back the gdb control, then I tried to
quit the gdb session using "q" command. I response I got after this is: "A
debugging session is active. Inferior 1 [process 12910] will be detached. Quit
anyway? (y or n)". I entered "y" as my response which gave the response as:
"Cannot execute this command while the target is running. Use the "interrupt"
command to stop the target and then try again". This completed my gdb client
session. At the remote target side, gdbserver responded to this quit as:
"client connection closed". 
This debug session was successful. But as my gdbserver was in multi mode, when
I try to start a new debug session and attach my running application (myApp)
again to gdbserver which is already running in multi mode on the same port
number, my gdb client at host is unable to connect to gdbserver at target side.
This command is not executed: "target extended-remote 192.168.2.2:5000"
Earlier with gdb 7.8 and gdbserver 7.8, I was able to successfully detach my
running application (myApp). And the above scenario of attaching a process
again to the same gdbserver used to work. But gdbserver 7.8 did not support
debugging child process, hence i needed to move to gdb client and server 7.12,
which supports child process debug.
Detailed gdb traces are as provided before

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]