public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug corefiles/8210] Linux core files should use linux-thread-db.c
       [not found] <20030302031800.8210.ac131313@redhat.com>
@ 2010-04-25 13:59 ` jan dot kratochvil at redhat dot com
  2010-08-06 14:34 ` pedro at codesourcery dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-04-25 13:59 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From jan dot kratochvil at redhat dot com  2010-04-25 13:59 -------
Discussed now at:
pthread_t ids of threads not showed by "thread info"
http://sourceware.org/ml/gdb/2010-04/msg00079.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan dot kratochvil at redhat
                   |                            |dot com
            Summary|expected behavior of        |Linux core files should use
                   |corefiles and gcore         |linux-thread-db.c


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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug corefiles/8210] Linux core files should use linux-thread-db.c
       [not found] <20030302031800.8210.ac131313@redhat.com>
  2010-04-25 13:59 ` [Bug corefiles/8210] Linux core files should use linux-thread-db.c jan dot kratochvil at redhat dot com
@ 2010-08-06 14:34 ` pedro at codesourcery dot com
  2010-08-14 19:08 ` pedro at codesourcery dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: pedro at codesourcery dot com @ 2010-08-06 14:34 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From pedro at codesourcery dot com  2010-08-06 14:34 -------
I played with this last weekend, wrote couple of patches, and got it working.  I
needed to tweak bfd to make it possible to get at the pid of the core (well, the
pid of the process core was dumped from), as libthread_db nowadays ignores 
threads whose process id doesn't match ps_getpid, and gdb is currently using
the fake pid of 1 on linux cores, which obviously doesn't match.  I'll post
the patches soon.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware dot|pedro at codesourcery dot
                   |org                         |com


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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug corefiles/8210] Linux core files should use linux-thread-db.c
       [not found] <20030302031800.8210.ac131313@redhat.com>
  2010-04-25 13:59 ` [Bug corefiles/8210] Linux core files should use linux-thread-db.c jan dot kratochvil at redhat dot com
  2010-08-06 14:34 ` pedro at codesourcery dot com
@ 2010-08-14 19:08 ` pedro at codesourcery dot com
  2010-08-18 12:34 ` pedro at codesourcery dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: pedro at codesourcery dot com @ 2010-08-14 19:08 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From pedro at codesourcery dot com  2010-08-14 19:08 -------
Patches posted:

bfd: <http://sourceware.org/ml/binutils/2010-08/msg00164.html>
gdb: <http://sourceware.org/ml/gdb-patches/2010-08/msg00207.html>
gdb: <http://sourceware.org/ml/gdb-patches/2010-08/msg00208.html>


-- 


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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug corefiles/8210] Linux core files should use linux-thread-db.c
       [not found] <20030302031800.8210.ac131313@redhat.com>
                   ` (3 preceding siblings ...)
  2010-08-18 12:34 ` pedro at codesourcery dot com
@ 2010-08-18 12:34 ` pedro at codesourcery dot com
  2010-08-18 12:37 ` pedro at codesourcery dot com
  5 siblings, 0 replies; 6+ messages in thread
From: pedro at codesourcery dot com @ 2010-08-18 12:34 UTC (permalink / raw)
  To: gdb-prs


------- 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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug corefiles/8210] Linux core files should use linux-thread-db.c
       [not found] <20030302031800.8210.ac131313@redhat.com>
                   ` (2 preceding siblings ...)
  2010-08-14 19:08 ` pedro at codesourcery dot com
@ 2010-08-18 12:34 ` pedro at codesourcery dot com
  2010-08-18 12:34 ` pedro at codesourcery dot com
  2010-08-18 12:37 ` pedro at codesourcery dot com
  5 siblings, 0 replies; 6+ messages in thread
From: pedro at codesourcery dot com @ 2010-08-18 12:34 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |7.3


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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug corefiles/8210] Linux core files should use linux-thread-db.c
       [not found] <20030302031800.8210.ac131313@redhat.com>
                   ` (4 preceding siblings ...)
  2010-08-18 12:34 ` pedro at codesourcery dot com
@ 2010-08-18 12:37 ` pedro at codesourcery dot com
  5 siblings, 0 replies; 6+ messages in thread
From: pedro at codesourcery dot com @ 2010-08-18 12:37 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From pedro at codesourcery dot com  2010-08-18 12:37 -------
Oh, dear me, I almost forgot: continuing on the comment above, supporting
thread_db for cross debugging would also mean that we'd need to have available a
libthread_db.so that is built for the host architecture so that GDB can load it,
but that understands the _target_ architecture's glibc.  (This is also the
reason why we have gdbserver itself load libthread_db, not gdb, when remote
debugging).  So, I'm definitely closing this harder.  :-)

-- 


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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-18 12:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20030302031800.8210.ac131313@redhat.com>
2010-04-25 13:59 ` [Bug corefiles/8210] Linux core files should use linux-thread-db.c jan dot kratochvil at redhat dot com
2010-08-06 14:34 ` pedro at codesourcery dot com
2010-08-14 19:08 ` pedro at codesourcery dot com
2010-08-18 12:34 ` pedro at codesourcery dot com
2010-08-18 12:34 ` pedro at codesourcery dot com
2010-08-18 12:37 ` pedro at codesourcery dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).