Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Alexandru Sutii <sutii.alex@gmail.com>
To: gdb@sourceware.org
Subject: How to switch threads in gdb while a thread is being blocked
Date: Mon, 28 Mar 2011 20:45:00 -0000	[thread overview]
Message-ID: <AANLkTi==mUb71Nx35PYy2A_22VS3df6DQzx4ZscYxDp5@mail.gmail.com> (raw)

Hello!

I am developing a GUI application that uses gdb. The purpose of the
application is
to give the user the chance to graphically see what happens when processes
communicate using IPC, or when a process blocks when taking a mutex, and so on.

I have a problem with processes that block waiting for another process
to take an action.
For instance, say I have the following situation: A process P creates
a child process C.
The child and the parent communicate through a pipe. After fork() the
parent waits for the
child to write something in the pipe. If debugging this in gdb the
parent blocks when waiting
for the child to write in the pipe. As a result gdb freezes and I
cannot switch to the child
process in order to make it write in the pipe, so the parent could
continue. I mention that
I set detach-on-fork off.

Is there a way to switch threads in gdb after the current
thread/process blocks? I have also
thought of setting detach-on-fork on and try to attache to the newly
created process with
another gdb instance, but I didn't manage to accomplish this. Any
advices are welcome.

Thanks in advance.
--Alex.


             reply	other threads:[~2011-03-28 20:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 20:45 Alexandru Sutii [this message]
2011-03-29 15:05 ` Tom Tromey
2011-03-29 21:59   ` Alexandru Sutii
2011-03-30  0:03   ` chris.hall.list
2011-03-30 13:58     ` Tom Tromey
2011-03-30 15:16       ` 'Chris Hall'

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='AANLkTi==mUb71Nx35PYy2A_22VS3df6DQzx4ZscYxDp5@mail.gmail.com' \
    --to=sutii.alex@gmail.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