From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16401 invoked by alias); 20 Jul 2010 14:43:36 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 16392 invoked by uid 22791); 20 Jul 2010 14:43:35 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Date: Tue, 20 Jul 2010 14:43:00 -0000 From: Oleg Nesterov To: archer@sourceware.org Cc: Roland McGrath Subject: Q: who maintains the STOPPED/RUNNING state? Message-ID: <20100720144119.GA20580@redhat.com> References: <20100716205147.GA26313@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100716205147.GA26313@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SW-Source: 2010-q3/txt/msg00044.txt.bz2 To simplify, let's consider the simple case. gdb attaches to the single-threaded process which can never exit. To simplify again, it can be either RUNNING (gdb sent '$c') or STOPPED (say, gdb sends ^C). Who maintains this state? gdb, server, both? To illustrate, suppose that ugdb receives $c <--- resumes the tracee $g <--- asks general registers What should ugdb do? - reply E01 because it is not stopped? - stop it, read the regs, reply ? - stop, read the regs, reply, then resume it again ? This is connected to another question. From gdb.info: `H C THREAD-ID' Set thread for subsequent operations (`m', `M', `g', `G', et.al.). ... What does this "Set" above actually mean? Does it mean "stop this thread" as well? Unrelated question. From gdb.info: `qC' Return the current thread ID. Reply: `QC THREAD-ID' Cough. I simply can't understand what is the "current thread" in general. Perhaps, "current thread" == "the last thread selected by Hg, or the last thead which reported something like T05:thread" ? And, `(anything else)' Any other reply implies the old thread ID. This looks even more confusing. What is the "old thread" ? To clarify, I am mostly asking about the protocol in general, not about the current implementation in gdb. Oleg.