From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8122 invoked by alias); 24 Mar 2003 20:36:56 -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 8105 invoked from network); 24 Mar 2003 20:36:56 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 24 Mar 2003 20:36:56 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18xaaB-000549-00; Mon, 24 Mar 2003 16:38:19 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18xYgf-0007IL-00; Mon, 24 Mar 2003 15:36:53 -0500 Date: Mon, 24 Mar 2003 20:36:00 -0000 From: Daniel Jacobowitz To: Kris Warkentin Cc: gdb@sources.redhat.com Subject: Re: problem with exec-file when targetting remote machine Message-ID: <20030324203652.GA27939@nevyn.them.org> Mail-Followup-To: Kris Warkentin , gdb@sources.redhat.com References: <003101c2f241$078b7050$0202040a@catdog> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003101c2f241$078b7050$0202040a@catdog> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-03/txt/msg00331.txt.bz2 On Mon, Mar 24, 2003 at 03:07:43PM -0500, Kris Warkentin wrote: > This problem comes up when using the QNX remote protocol but it's probably > more generic than that. I'm not asking for a fix but more for some guidance > as to what might be happening. > > The long and short of it is that if I attach to a process on a remote > machine after having read the symbols, everything works fine. I run gdb, > load symbols, set a breakpoint on main, run and get: > > Breakpoint 1, main (argc=1, argv=0x803fcc4) at NetController.cpp:62 > 62 int lSuccessCode = 0; // Success > > as one might expect. If, however, exec-file has been set, either explicitly > or implicitly by calling "gdb myapp" from the command line, I get something > like: > > Breakpoint 1, 0x40380000 in ?? () > (gdb) bt > #0 0x40380000 in ?? () > #1 0x00000001 in ?? () > > Note that this doesn't happen with everything - it seems to be mostly with > large projects, particularily C++. There's obviously some data being read > by gdb based on what the exec-file is set as that is causing a problem. > > Can anyone give me an idea as to what gdb might be doing differently when > exec-file has been set? This means shared library handling is messed up, I bet. It only triggers based on exec_bfd. Probably the app is being relocated in memory by the shared library code, and ending up wrong. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer