Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37734588
en ru br
Репозитории ALT
S:13.2.0.43.854f46b6377-alt2
5.1: 6.6-alt3
4.1: 6.6-alt3
4.0: 6.6-alt2
3.0: 6.3-alt2
www.altlinux.org/Changes

Группа :: Разработка/Отладчики
Пакет: gdb

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: gdb-6.3-ia32el-fix-waitpid-20060615.patch
Скачать


Index: gdb-6.3/gdb/linux-nat.c
===================================================================
--- gdb-6.3.orig/gdb/linux-nat.c	2006-06-15 07:27:02.000000000 -0300
+++ gdb-6.3/gdb/linux-nat.c	2006-06-15 07:27:06.000000000 -0300
@@ -157,12 +157,28 @@ static int
 my_waitpid (int pid, int *status, int flags)
 {
   int ret;
+  int old_status = status ? *status : 0;
+
   do
     {
       ret = waitpid (pid, status, flags);
     }
   while (ret == -1 && errno == EINTR);
 
+  if (ret == 0 && status != 0)
+    {
+      /* waitpid() running within ia32el (on multi-threaded processes
+	 only?) modifies status even when it returns zero, and this
+	 breaks the assumption in linux_nat_wait(), and perhaps
+	 elsewhere, that it remains unchanged in this case.  We
+	 restore the old value before returning zero, such that the
+	 assumption holds.  */
+      if (*status != 0 && *status != old_status)
+        warning ("waitpid: non-zero status %x for zero return value",
+                 *status);
+      *status = old_status;
+    }
+
   return ret;
 }
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin