[commit+7.4][arm/bfd] Fill in core_pid to fix GDB corethreads.exp failures

Ulrich Weigand uweigand@de.ibm.com
Wed Dec 21 21:26:00 GMT 2011


Hello,

I've noticed another couple of additional test suite failures in GDB 7.4:
FAIL: gdb.threads/corethreads.exp: thread0 found
FAIL: gdb.threads/corethreads.exp: thread1 found

These test verify that GDB shows proper pthread_t thread IDs for core
files.  This works only if bfd_core_file_pid returns the correct PID,
which only works if the ->core_pid field is filled in by target code.

This has been added on a number of platforms, but not ARM so far.

The (obvious) patch below fixes this by filling in this field in
elf32_arm_nabi_grok_psinfo.

Tested on arm-linux-gnueabi, fixes the above test cases.
Committed to mainline and (GDB) 7.4 branch.

Bye,
Ulrich


ChangeLog:

bfd/
	* elf32-arm.c (elf32_arm_nabi_grok_psinfo): Fill in core_pid.


Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.281
diff -u -p -r1.281 elf32-arm.c
--- bfd/elf32-arm.c	17 Nov 2011 00:20:01 -0000	1.281
+++ bfd/elf32-arm.c	21 Dec 2011 20:18:30 -0000
@@ -1966,6 +1966,8 @@ elf32_arm_nabi_grok_psinfo (bfd *abfd, E
 	return FALSE;
 
       case 124:		/* Linux/ARM elf_prpsinfo.  */
+	elf_tdata (abfd)->core_pid
+	 = bfd_get_32 (abfd, note->descdata + 12);
 	elf_tdata (abfd)->core_program
 	 = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
 	elf_tdata (abfd)->core_command
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gdb-patches mailing list