[commit] aix-thread: Fix getthrds declaration and call.

Joel Brobecker brobecker@adacore.com
Thu Dec 6 05:05:00 GMT 2012


This patch fixes a warning when compiling aix-thread.c on ppc-aix 7.1.
The 4th parameter type is a "tid_t *", not a "pthdb_tid_t *", and
these two types point to types with different sizes (one is an "int",
while the other is an "unsigned long long").

This is confirmed by the declaration found in the system headers on
AIX version 6.1 and 7.1. On older systems, the function prototype is
not available in any of the system headers, so GDB provided one,
which this patch fixes. Confirmation of the correctness can be found
in the system documentation:

    http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.basetechref/doc/basetrf1/getthrds.htm

gdb/ChangeLog:

        * aix-thread.c (getthrds): Fix type of 4th parameter.
        (get_signaled_thread): Change type of variable ktid to tid_t.

Tested on ppc-aix versions 5.3 and 7.1. No regression (quite surprising,
the getthrds function must not be using this parameter for the
iteration, and we don't either).

Checked in.

Thanks,
-- 
Joel

PS: Thanks to Perry Smith and Michael Haubenwallner for digging
    the info out regarding AIX 6.1 and 5.3.

---
 gdb/ChangeLog    |    5 +++++
 gdb/aix-thread.c |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cc89930..1bfbc7d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-06  Joel Brobecker  <brobecker@adacore.com>
+
+	* aix-thread.c (getthrds): Fix type of 4th parameter.
+	(get_signaled_thread): Change type of variable ktid to tid_t.
+
 2012-12-06  Hui Zhu  <hui_zhu@mentor.com>
 
 	* dwarf2loc.c (dwarf_expr_frame_base): Add check for the return
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 5da6c4e..3d8b453 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -59,7 +59,7 @@
 #include <sys/pthdebug.h>
 
 #if !HAVE_DECL_GETTHRDS
-extern int getthrds (pid_t, struct thrdsinfo64 *, int, pthdb_tid_t *, int);
+extern int getthrds (pid_t, struct thrdsinfo64 *, int, tid_t *, int);
 #endif
 
 /* Whether to emit debugging output.  */
@@ -648,7 +648,7 @@ static pthdb_tid_t
 get_signaled_thread (void)
 {
   struct thrdsinfo64 thrinf;
-  pthdb_tid_t ktid = 0;
+  tid_t ktid = 0;
   int result = 0;
 
   while (1)
-- 
1.7.10.4



More information about the Gdb-patches mailing list