From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18325 invoked by alias); 16 Apr 2003 22:14:55 -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 18311 invoked from network); 16 Apr 2003 22:14:55 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 16 Apr 2003 22:14:55 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 195vBI-0000X6-00; Wed, 16 Apr 2003 17:15:04 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 195vB6-0001ut-00; Wed, 16 Apr 2003 18:14:52 -0400 Date: Wed, 16 Apr 2003 22:14:00 -0000 From: Daniel Jacobowitz To: Kris Warkentin Cc: gdb@sources.redhat.com Subject: Re: auto-solib-add when attaching to inferior Message-ID: <20030416221452.GA7300@nevyn.them.org> Mail-Followup-To: Kris Warkentin , gdb@sources.redhat.com References: <020001c3044b$31fba6e0$2a00a8c0@dash> <20030416190423.GA31524@nevyn.them.org> <023001c30465$323a85d0$2a00a8c0@dash> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <023001c30465$323a85d0$2a00a8c0@dash> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-04/txt/msg00183.txt.bz2 On Wed, Apr 16, 2003 at 06:11:56PM -0400, Kris Warkentin wrote: > > > 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. Remember that you don't use attach with the normal remote protocol. When you to_open the target has already started. For your agent it sounds like you need to do it at to_attach time; but why isn't the one in infcmd.c:attach_command working? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer