From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24052 invoked by alias); 23 Jan 2006 09:21:25 -0000 Received: (qmail 24039 invoked by uid 22791); 23 Jan 2006 09:21:24 -0000 X-Spam-Check-By: sourceware.org Received: from svr68.ehostpros.com (HELO svr68.ehostpros.com) (67.15.48.48) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 23 Jan 2006 09:21:23 +0000 Received: from [61.11.18.135] (helo=titan.linsyssoft.com) by svr68.ehostpros.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.52) id 1F0xt1-00089O-8a; Mon, 23 Jan 2006 01:21:20 -0800 Received: from krypton (krypton [192.168.1.13] (may be forged)) by titan.linsyssoft.com (8.13.1/8.13.1) with ESMTP id k0N97iuk006483; Mon, 23 Jan 2006 14:37:44 +0530 Subject: Re: [Patch] Mark the thread_event breakpoint as "not inserted" before calling thread_mourn_inferior From: Girish Shilamkar To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com In-Reply-To: <20060120143507.GA2794@nevyn.them.org> References: <1137512294.3217.29.camel@krypton> <20060117154004.GA3672@nevyn.them.org> <1137575670.3221.17.camel@krypton> <20060118135735.GA3154@nevyn.them.org> <1137766638.3225.40.camel@krypton> <20060120143507.GA2794@nevyn.them.org> Content-Type: multipart/mixed; boundary="=-Py3Nkc6Ez5z8Bwez1AGm" Date: Mon, 23 Jan 2006 09:21:00 -0000 Message-Id: <1138008291.3221.19.camel@krypton> Mime-Version: 1.0 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00319.txt.bz2 --=-Py3Nkc6Ez5z8Bwez1AGm Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 2096 > You left out the interesting part of the trace; why is it fetching > registers? My GDB doesn't. Presumably this is something specific to > Red Hat's libthread_db. Does td_thr_validate_p return TD_OK for a > thread which is actually dead? > This is the stack trace td_thr_validate never returns , in fetch_regs gdb calls perror_with_name (_("Couldn't get registers")); and control never returns back to fetch_regs. ---------------------------------------------------------------------- Program exited normally. Breakpoint 1, fetch_regs (tid=-151132512) at ../../src/gdb/i386-linux- nat.c:277 277 perror_with_name (_("Couldn't get registers")); (gdb) bt #0 fetch_regs (tid=-151132512) at ../../src/gdb/i386-linux-nat.c:277 #1 0x0808fdaf in i386_linux_fetch_inferior_registers (regno=-1) at ../../src/gdb/i386-linux-nat.c:513 #2 0x08091848 in thread_db_fetch_registers (regno=-1) at ../../src/gdb/linux-thread-db.c:1007 #3 0x0809058c in ps_lgetregs (ph=0xf6fde6a0, lwpid=29054, gregset=0xfee6383c) at ../../src/gdb/proc-service.c:236 #4 0xf6db26b2 in td_ta_map_lwp2thr () from /lib/tls/libthread_db.so.1 #5 0xf6db3872 in td_thr_validate () from /lib/tls/libthread_db.so.1 #6 0x08091c1e in thread_db_thread_alive (ptid= {pid = 29054, lwp = 29061, tid = -193094736}) at ../../src/gdb/linux-thread-db.c:1135 #7 0x080917b1 in thread_db_xfer_partial (ops=0x8280a80, object=TARGET_OBJECT_MEMORY, annex=0x0, readbuf=0x0, writebuf=0xfee639f0 "U\2174", offset=4626416, len=1) at ../../src/gdb/linux-thread-db.c:983 #8 0x0811267a in target_xfer_partial (ops=0x8280a80, object=TARGET_OBJECT_MEMORY, annex=0x0, readbuf=0x0, writebuf=0xfee639f0, offset=4626416, len=1) at ../../src/gdb/target.c:864 #9 0x08112894 in xfer_using_stratum (object=TARGET_OBJECT_MEMORY, annex=0x0, offset=4626416, len=Unhandled dwarf expression opcode 0x93 > > Try moving remove_thread_event_breakpoints below the call > to target_beneath->to_mourn_inferior (). > It works , I have verified it on FC3 & FC4. I have attached the patch. Thanks, -Girish. --=-Py3Nkc6Ez5z8Bwez1AGm Content-Disposition: attachment; filename=gdb-6.4-first_mourn.patch Content-Type: text/x-patch; name=gdb-6.4-first_mourn.patch; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 626 Index: src/gdb/linux-thread-db.c =================================================================== --- gdb-cvs.orig/gdb/linux-thread-db.c 2006-01-23 14:20:23.331552656 +0530 +++ gdb-cvs/gdb/linux-thread-db.c 2006-01-23 14:25:29.955938664 +0530 @@ -1104,13 +1104,12 @@ static void thread_db_mourn_inferior (void) { - remove_thread_event_breakpoints (); - /* Forget about the child's process ID. We shouldn't need it anymore. */ proc_handle.pid = 0; target_beneath->to_mourn_inferior (); + remove_thread_event_breakpoints (); /* Detach thread_db target ops. */ unpush_target (&thread_db_ops); --=-Py3Nkc6Ez5z8Bwez1AGm--