aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-05-29 23:50:04 +0000
committerAlan Modra <amodra@gmail.com>2003-05-29 23:50:04 +0000
commitf8843e87137de9944a4cead9ecfc2b4c4b13905d (patch)
treeffa049b2cd99820539c0e2b8e6ed7aca01f436e9
parentd2427a719bedac1dff31c9566234062b887f7cce (diff)
downloadgdb-f8843e87137de9944a4cead9ecfc2b4c4b13905d.zip
gdb-f8843e87137de9944a4cead9ecfc2b4c4b13905d.tar.gz
gdb-f8843e87137de9944a4cead9ecfc2b4c4b13905d.tar.bz2
* elf.c (elfcore_grok_nto_status): Only set lwpid for the active or
signalled thread. (elfcore_grok_nto_gregs): Only make .reg section for the active thread.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c28
2 files changed, 28 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bca4a7b..aa1aeae 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2003-05-30 Kris Warkentin <kewarken@qnx.com>
+
+ * elf.c (elfcore_grok_nto_status): Only set lwpid for the active or
+ signalled thread.
+ (elfcore_grok_nto_gregs): Only make .reg section for the active thread.
+
2003-05-29 Nick Clifton <nickc@redhat.com>
* pef.c: Include "safe-ctype.h" instead of <ctype.h>.
diff --git a/bfd/elf.c b/bfd/elf.c
index 66383e7..e1cbe0a 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -7015,18 +7015,30 @@ elfcore_grok_nto_status (abfd, note, tid)
char buf[100];
char *name;
asection *sect;
+ short sig;
+ unsigned flags;
/* nto_procfs_status 'pid' field is at offset 0. */
elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, (bfd_byte *) ddata);
- /* nto_procfs_status 'tid' field is at offset 4. */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, (bfd_byte *) ddata + 4);
+ /* nto_procfs_status 'tid' field is at offset 4. Pass it back. */
+ *tid = bfd_get_32 (abfd, (bfd_byte *) ddata + 4);
+
+ /* nto_procfs_status 'flags' field is at offset 8. */
+ flags = bfd_get_32 (abfd, (bfd_byte *) ddata + 8);
/* nto_procfs_status 'what' field is at offset 14. */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, (bfd_byte *) ddata + 14);
+ if ((sig = bfd_get_16 (abfd, (bfd_byte *) ddata + 14)) > 0)
+ {
+ elf_tdata (abfd)->core_signal = sig;
+ elf_tdata (abfd)->core_lwpid = *tid;
+ }
- /* Pass tid back. */
- *tid = elf_tdata (abfd)->core_lwpid;
+ /* _DEBUG_FLAG_CURTID (current thread) is 0x80. Some cores
+ do not come from signals so we make sure we set the current
+ thread just in case. */
+ if (flags & 0x00000080)
+ elf_tdata (abfd)->core_lwpid = *tid;
/* Make a ".qnx_core_status/%d" section. */
sprintf (buf, ".qnx_core_status/%d", *tid);
@@ -7075,7 +7087,11 @@ elfcore_grok_nto_gregs (abfd, note, tid)
sect->flags = SEC_HAS_CONTENTS;
sect->alignment_power = 2;
- return elfcore_maybe_make_sect (abfd, ".reg", sect);
+ /* This is the current thread. */
+ if (elf_tdata (abfd)->core_lwpid == tid)
+ return elfcore_maybe_make_sect (abfd, ".reg", sect);
+
+ return TRUE;
}
#define BFD_QNT_CORE_INFO 7