Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "suresh ds" <dssuresh66@mail.com>
To: gdb@sourceware.org
Subject: Behaviour of default all-stop mode -- Why no one has replied ?
Date: Wed, 10 Jun 2009 07:18:00 -0000	[thread overview]
Message-ID: <20090610071819.04F30606884@ws1-4.us4.outblaze.com> (raw)

I'm re-posting my previous query. I need information on this urgently. Please reply.

The foll. are w.r.to remote debugging in gdb 6.8 cross-compiled for mips64.

In the default all-stop mode,

1) The document says, "whenever your program stops under GDB for any reason,all threads of execution stop, not just the current thread"
-- Here, the initiation is done by gdb or the (remote) stub should take care of this ?
Suppose three threads are running, say 1, 2, & 3.
Suppose thread 1 hits the breakpoint; It'll send the status to gdb; At this point, gdb itself will send (further) packets to stop other threads, or the stub itself should take the initiative to stop other threads ?

2) The document says, "whenever you restart the program, all threads start executing".
-- Again, the gdb takes initiative to continue all the threads or the stub should have a mechanism to do this ?
Suppose three threads, 1, 2, & 3 are in a stopped state.
Now, "continue" from thread 1 will continue all the threads ?
When I checked the packets, I found that it does only "Hc1" to set the further continue packets only for thread 1.
Ideally, what I expected is, gdb will take care of continuing all the  threads, something like this (assuming no breakpoints set in any of the threads ):

<gdb-thread1> continue
Sending packet: $Hc1#xx...Ack
Packet received: OK
Sending packet: $c#63...Ack
Sending packet: $Hc2#xx...Ack
Packet received: OK
Sending packet: $c#63...Ack
Sending packet: $Hc3#xx...Ack
Packet received: OK
Sending packet: $c#63...Ack

gdb can even do this in a simpler way, as just:
<gdb-thread1> continue
Sending packet: $Hc-1#xx...Ack
Packet received: OK
Sending packet: $c#63...Ack

since the '-1' in "Hc-1" indicates 'all threads'.

But, it does neither of this, and does something like this:
<gdb-thread1> continue
Sending packet: $Hc1#xx...Ack
Packet received: OK
Sending packet: $c#63...Ack
Sending packet: $Hc0#xx...Ack
Sending packet: $c#63...Ack

But '0' in "Hc0" indicates 'any thread'; Should the stub take this as an indication to continue all the threads ?

The document does not clearly explain whether the initiative, to stop all the threads once a thread hits a break and to continue all the threads if a continue is given from a thread, is the responsibility of gdb or stub, and how. And an inspection of gdb's packets sent to stub throw no light either.

Can someone clarify ?


Thanks,
Suresh

-- 
Be Yourself @ mail.com!
Choose From 200+ Email Addresses
Get a Free Account at www.mail.com


             reply	other threads:[~2009-06-10  7:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-10  7:18 suresh ds [this message]
2009-06-10 17:55 ` Pedro Alves
2009-06-15 10:38 suresh ds
2009-06-15 11:01 ` Pedro Alves
2009-06-15 15:10 suresh ds
2009-06-15 15:20 ` Daniel Jacobowitz
2009-06-15 18:44 ` Pedro Alves
2009-06-15 15:37 suresh ds
2009-06-15 16:51 ` Daniel Jacobowitz
2009-07-06 14:42 suresh ds
2009-07-06 17:03 ` Pedro Alves
2009-07-20 10:50 suresh ds
2009-07-21 14:00 ` Pedro Alves

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=20090610071819.04F30606884@ws1-4.us4.outblaze.com \
    --to=dssuresh66@mail.com \
    --cc=gdb@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