From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17953 invoked by alias); 17 Apr 2003 18:14:30 -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 17945 invoked from network); 17 Apr 2003 18:14:30 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sources.redhat.com with SMTP; 17 Apr 2003 18:14:30 -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 OAA26154; Thu, 17 Apr 2003 14:13:32 -0400 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id OAA04469; Thu, 17 Apr 2003 14:14:29 -0400 Message-ID: <01cf01c3050d$3736fc50$0202040a@catdog> From: "Kris Warkentin" To: "Kris Warkentin" , "Daniel Jacobowitz" Cc: References: <020001c3044b$31fba6e0$2a00a8c0@dash> <20030416190423.GA31524@nevyn.them.org> <023001c30465$323a85d0$2a00a8c0@dash> <20030416221452.GA7300@nevyn.them.org> <000f01c304eb$728c2a40$0202040a@catdog> Subject: Re: auto-solib-add when attaching to inferior Date: Thu, 17 Apr 2003 18:14: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/msg00197.txt.bz2 > > 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? > > Good question. For some reason locate_base() seems to be failing. Maybe > that's the answer to the puzzle. It looks like the SOLIB_ADD() in > attach_command() should do the right thing. I'll chase it deeper from that > end. Well, I think I've found the cause but only part of the solution. When solib-svr4.c:elf_locate_base() is called, the dynamic pointer stored in the DT_DEBUG section is zero. This is because QNX has a util called 'on' which can spawn a process in a 'held' state where it's stopped on the very first instruction. This is handy if you want to attach to a process before it gets going but in this case, the loader hasn't been run yet so the DT_DEBUG section isn't filled in. If I attach to a process that is running properly, I get my solibs loaded up and everything is fine. This, however, presents the next problem: the shlib_event breakpoint not being set. On our native gdb, if I just add a SOLIB_CREATE_INFERIOR_HOOK call to the attach function, it works properly. The remote is another case. I'm still thinking it's a sync issue with the debug agent though. Thanks for the help. You definitely got me barking up the right tree. cheers, Kris