From: Liang Cheng <liang.cheng555@gmail.com>
To: gdb-patches@sourceware.org
Subject: [patch] failed to attach to the same process after detaching in gdbserver multiprocess mode
Date: Fri, 24 Jun 2011 22:21:00 -0000 [thread overview]
Message-ID: <BANLkTimd3V-uBLXOHmbvGP9hsg5x5XDZ3w@mail.gmail.com> (raw)
Reproduce step:
1. compile and link the test app (which contains an infinite loop)
2. run the app
3. start gdbserver in multiprocess mode (e.g. gdbserver --multi :5040)
3. attach the running process in gdb (e.g. target extended-remote
:5040; attach pid)
4. continue to run the app in gdb, pressing "c"
5. stop the execution of the app by pressing ctrl-c in gdb
4. detach
5. quit
7. attach the same process in gdb (e.g. target extended-remote :5040;
attach pid)
User would get something like below error in gdb
(gdb) attach 19372
Ignoring packet error, continuing...
Attached to process 19372
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
warning: Invalid remote reply: timeout
This issue does not happen in gdb-7.1.0.20100706.tar, but it happens
sometime after wards. The fix would reset cont_thread at detach.
Is the below patch OK? If it is, can anyone help to submit it as I
don't have account with write-access to the cvs?
Thanks,
Liang
licheng@licheng-linux:~/gdb-7.3/gdb-7.3.50.20110622/gdb/gdbserver$
diff -Naur linux-low.c.orig linux-low.c
--- linux-low.c.orig 2011-05-04 15:20:12.000000000 -0500
+++ linux-low.c 2011-06-23 15:05:26.633193953 -0500
@@ -837,6 +837,9 @@
/* Since we presently can only stop all lwps of all processes, we
need to unstop lwps of other processes. */
unstop_all_lwps (0, NULL);
+
+ /* reset cont_thread */
+ cont_thread = null_ptid;
return 0;
}
next reply other threads:[~2011-06-24 22:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-24 22:21 Liang Cheng [this message]
2011-06-27 15:54 ` Joel Brobecker
2011-06-27 17:10 ` Liang Cheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTimd3V-uBLXOHmbvGP9hsg5x5XDZ3w@mail.gmail.com \
--to=liang.cheng555@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox