From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14424 invoked by alias); 16 Apr 2003 22:05:14 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 14417 invoked from network); 16 Apr 2003 22:05:14 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sources.redhat.com with SMTP; 16 Apr 2003 22:05:14 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3p2/8.9.3) with ESMTP id SAA24866; Wed, 16 Apr 2003 18:04:20 -0400 Received: from dash ([192.168.20.27]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id SAA09559; Wed, 16 Apr 2003 18:05:12 -0400 Message-ID: <023001c30465$323a85d0$2a00a8c0@dash> From: "Kris Warkentin" To: "Daniel Jacobowitz" Cc: References: <020001c3044b$31fba6e0$2a00a8c0@dash> <20030416190423.GA31524@nevyn.them.org> Subject: Re: auto-solib-add when attaching to inferior Date: Wed, 16 Apr 2003 22:05:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-SW-Source: 2003-04/txt/msg00181.txt.bz2 > > When I run a remote process using our QNX remote protocol, I get a solib > > breakpoint set properly and from then on, if solibs are loaded, their > > symbols automatically get added (auto-solib-add is on by default). If, > > however, I attach to the process, even if auto-solib-add is on, I still have > > to go 'shared' to get them to load. If I 'maint info breakpoints' on the > > attached process, I see that there isn't a shlib-events breakpoint set on > > the attached process so I assume either enable_break() isn't getting called > > or is failing. > > > > I'm still building my debug gdb to test but I'm hoping someone will tell me, > > "Oh, when you attach you should always call such-and-such function" and I > > can just add it to our back end code. > > Search for SOLIB in remote.c and see if that helps. I didn't see an explicit "remote_ops.to_attach" in remote.c function but I notice that you're doing SOLIB_CREATE_INFERIOR_HOOK. We also do that when we create a process. Just for chuckles, I tried to do that in our to_attach function but it didn't work. If I call it before I set inferior_ptid to the child process, I get a solib_event_bkpt that is relocated incorrectly. If I do it after, then for some reason the target_wait() function spins blocks forever trying to read from the inferior. On the bright side, the relocation of the solib breakpoint is done correctly (I printed the breakpoint_chain) but the lockup is a real puzzle. I'm wondering if somehow my host and target are getting out of sync. Fun, fun, fun. I think I'm going to have to attach to our remote agent and see what the heck it thinks its doing. cheers, Kris