This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: POSIX Semaphore under gdb
- From: Hans Zuidam <h dot zuidam at wanadoo dot nl>
- To: jigisha at spectross dot com
- Cc: gdb at sourceware dot org
- Date: Mon, 16 Apr 2007 23:20:02 +0200
- Subject: Re: POSIX Semaphore under gdb
- Reply-to: Hans Zuidam <h dot zuidam at computer dot org>
Hi,
It is not a gdb problem, but a Ddd problem. When you hover over a
variable, Ddd interrupts the application to retrieve it's value and
then continues it. If the application (or a thread) was blocked in a
sem_wait() it will return -1 and set errno to EINTR.
There are two solutions:
1. Keep the mouse pointer out of the source window.
2. Replace all sem_wait()s with something like:
while (sem_wait(...) < 0)
if (errno != EINTR)
break;
No ideal, but workable.
This also holds for all other system calls that can be interrupted,
but it usually only matters for semaphores.
Regards,
Hans
--
Hans Zuidam
De Koppele 136, 5632 LD Eindhoven, The Netherlands
Tel. +31 40 2481546, Mob. +31 6 42345456
h.zuidam@computer.org