This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug corefiles/8210] Linux core files should use linux-thread-db.c
- From: "pedro at codesourcery dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 18 Aug 2010 12:34:34 -0000
- Subject: [Bug corefiles/8210] Linux core files should use linux-thread-db.c
- References: <20030302031800.8210.ac131313@redhat.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2010-08-18 12:24 -------
Subject: Bug 8210
CVSROOT: /cvs/src
Module name: src
Changes by: palves@sourceware.org 2010-08-18 12:24:13
Modified files:
gdb : ChangeLog amd64-sol2-tdep.c corelow.c gdbarch.c
gdbarch.h gdbarch.sh i386-sol2-tdep.c
sparc-sol2-tdep.c sparc64-sol2-tdep.c
Log message:
2010-08-18 Pedro Alves <pedro@codesourcery.com>
PR corefile/8210
bfd/
* bfd-in2.h: Regenerate.
* corefile.c (bfd_core_file_pid): New.
* targets.c (BFD_JUMP_TABLE_CORE): Add NAME##_core_file_pid.
(struct bfd_target) <_core_file_pid>: New.
* libbfd-in.h (_bfd_nocore_core_file_pid): Declare.
* libbfd.c (_bfd_nocore_core_file_pid): New.
* elf-bfd.h (bfd_elf32_core_file_pid, bfd_elf64_core_file_pid):
Declare.
* elfcode.h (elf_core_file_pid): New define.
* elfcore.h (elf_core_file_pid): New function.
* elf.c (elfcore_make_pid): Rewrite.
(elfcore_grok_prstatus): Only set core_pid if not set yet.
(elfcore_grok_prstatus) [!HAVE_PRSTATUS_T_PR_WHO]: Fallback to
getting the lwpid from prstat.pr_pid.
* elf64-x86-64.c (elf64_x86_64_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
(elf64_x86_64_grok_psinfo): Extract the the main process's PID,
and store it in elf_tdata's core_pid field.
* elf32-i386.c (elf_i386_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
(elf_i386_grok_psinfo): Extract the the main process's PID, and
store it in elf_tdata's core_pid field.
* elf32-am33lin.c (elf32_am33lin_grok_prstatus): Write the LWPID
to elf_tdata's core_lwpid instead of to core_pid.
* elf32-arm.c (elf32_arm_nabi_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf32-cris.c (cris_elf_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf32-frv.c (elf32_frv_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf32-hppa.c (elf32_hppa_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf32-mips.c (elf32_mips_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf32-ppc.c (ppc_elf_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf32-s390.c (elf_s390_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf32-score.c (s3_bfd_score_elf_grok_prstatus): Write the LWPID
to elf_tdata's core_lwpid instead of to core_pid.
* elf32-score7.c (s7_bfd_score_elf_grok_prstatus): Write the LWPID
to elf_tdata's core_lwpid instead of to core_pid.
* elf32-sh.c (elf32_shlin_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf32-xtensa.c (elf_xtensa_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf64-hppa.c (elf64_hppa_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf64-mips.c (elf64_mips_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elf64-ppc.c (ppc64_elf_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* elfn32-mips.c (elf32_mips_grok_prstatus): Write the LWPID to
elf_tdata's core_lwpid instead of to core_pid.
* plugin.c (bfd_plugin_core_file_pid): New function.
* aout-target.h (MY_core_file_pid): Define.
* aout-tic30.c (MY_core_file_pid, MY_core_file_p): New defines.
* coff-rs6000.c (coff_core_file_pid): New define.
(rs6000coff_vec, pmac_xcoff_vec): Use BFD_JUMP_TABLE_CORE.
* coff64-rs6000.c (coff_core_file_pid): New define.
(rs6000coff64_vec): Use BFD_JUMP_TABLE_CORE.
(xcoff64_core_file_pid): New define.
(aix5coff64_vec): Use BFD_JUMP_TABLE_CORE.
* mach-o-target.c (bfd_mach_o_core_file_pid): New define.
* aix386-core.c (aix386_core_file_pid): New define.
* hppabsd-core.c (hppabsd_core_core_file_pid): New define.
* hpux-core.c (hpux_core_core_file_pid): New define.
* irix-core.c (irix_core_core_file_pid): New define.
* lynx-core.c (lynx_core_file_pid): New define.
* osf-core.c (osf_core_core_file_pid): New define.
* ptrace-core.c (ptrace_unix_core_file_pid): New define.
* sco5-core.c (sco5_core_file_pid): New define.
* xcoff-target.h (coff_core_file_pid): New define.
* netbsd-core.c (netbsd_core_core_file_pid): New define.
gdb/
2010-08-18 Pedro Alves <pedro@codesourcery.com>
PR corefile/8210
gdb/
* corelow.c (add_to_thread_list): Don't use
gdbarch_core_reg_section_encodes_pid. Use bfd_core_file_pid.
(get_core_register_section): Don't use
gdbarch_core_reg_section_encodes_pid.
* gdbarch.sh (core_reg_section_encodes_pid): Delete.
* gdbarch.h, gdbarch.c: Regenerate.
* amd64-sol2-tdep.c (amd64_sol2_init_abi): Don't set
gdbarch_core_reg_section_encodes_pid.
* i386-sol2-tdep.c (i386_sol2_init_abi): Ditto.
* sparc-sol2-tdep.c (sparc32_sol2_init_abi): Ditto.
* sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Ditto.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12092&r2=1.12093
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/amd64-sol2-tdep.c.diff?cvsroot=src&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/corelow.c.diff?cvsroot=src&r1=1.102&r2=1.103
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbarch.c.diff?cvsroot=src&r1=1.470&r2=1.471
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbarch.h.diff?cvsroot=src&r1=1.419&r2=1.420
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbarch.sh.diff?cvsroot=src&r1=1.515&r2=1.516
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/i386-sol2-tdep.c.diff?cvsroot=src&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/sparc-sol2-tdep.c.diff?cvsroot=src&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/sparc64-sol2-tdep.c.diff?cvsroot=src&r1=1.20&r2=1.21
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2010-08-18 12:26 -------
Subject: Bug 8210
CVSROOT: /cvs/src
Module name: src
Changes by: palves@sourceware.org 2010-08-18 12:25:49
Modified files:
gdb : ChangeLog linux-thread-db.c
Log message:
PR corefile/8210
* linux-thread-db.c (add_thread_db_info): Skip glibc/BZ5983
workaround on core files.
(try_thread_db_load_1): Don't try enabling thread event reporting
on core files.
(thread_db_load): Allow thread_db on core files.
(attach_thread): Don't check thread signals on core files, nor try
really attaching to the thread, nor enabling thread event event
reporting.
(thread_db_detach): Don't try disabing thread event reporting or
removing thread event breakpoints when debugging a core file.
(find_new_threads_callback): Don't try enabling thread event
reporting on core files.
(thread_db_find_new_threads_2): Don't look for a stopped lwp when
debugging a core file.
(thread_db_find_new_threads): Don't update thread
cores (processors) when debugging a core (dump).
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12093&r2=1.12094
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/linux-thread-db.c.diff?cvsroot=src&r1=1.76&r2=1.77
------- Additional Comments From pedro at codesourcery dot com 2010-08-18 12:34 -------
Patches applied.
Note that this will only work on native linux GDBs. Getting this to work on
cross linux builds will be harder to fix, as linux-thread-db.c is only built
native, due to its entanglement with linux-nat.c. I think that can be
considered a separate PR, so I'm closing this one.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://sourceware.org/bugzilla/show_bug.cgi?id=8210
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.