From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23341 invoked by alias); 13 Feb 2003 22:08:07 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23334 invoked from network); 13 Feb 2003 22:08:07 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 172.16.49.205 with SMTP; 13 Feb 2003 22:08:07 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18jTPS-000781-00; Thu, 13 Feb 2003 18:08:54 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18jRWK-0003y3-00; Thu, 13 Feb 2003 17:07:52 -0500 Date: Thu, 13 Feb 2003 22:08:00 -0000 From: Daniel Jacobowitz To: Kris Warkentin Cc: Mark Kettenis , Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: patch to add QNX NTO i386 support Message-ID: <20030213220751.GA15234@nevyn.them.org> Mail-Followup-To: Kris Warkentin , Mark Kettenis , Andrew Cagney , gdb-patches@sources.redhat.com References: <1c3601c2cbc1$72eac3b0$0202040a@catdog> <3E40387D.50001@redhat.com> <008f01c2ce4b$427295f0$2a00a8c0@dash> <86lm0r3nha.fsf@elgar.kettenis.dyndns.org> <01dd01c2d3aa$d4c1b1c0$0202040a@catdog> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01dd01c2d3aa$d4c1b1c0$0202040a@catdog> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-02/txt/msg00311.txt.bz2 On Thu, Feb 13, 2003 at 04:56:58PM -0500, Kris Warkentin wrote: > > > #define HANDLE_SVR4_EXEC_EMULATORS 1 > > > #include "solib.h" /* shared lib support */ > > > > Including solib.h is fine. However I wonder why you need > > HANDLE_SVR4_EXEC_EMULATORS. AFAIK this deals with Solaris BCP > > (running SunOS 4 a.out files on Solaris 2 a.k.a. SunOS 5). What is > > its relevance on QNX? Could this be the reason that you need to set > > SOLIB_BKPT_NAME? > > I've discovered why HANDLE_SVR4_EXEC_EMULATORS is needed but I'm not sure of > the correct way to fix it. The relevant code is from solib-svr4.c below. A > typical remote qnx debugging session would be something like this: > > kewarken@CATDOG ~/test > $ ntox86-gdb > GNU gdb 5.2.1qnx-326 QNX Neutrino 6.2.1 > Copyright 2002 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "--host=i686-pc-cygwin --target=ntox86". > (gdb) target qnx ren:10000 > Remote debugging using ren:10000 > (gdb) sym blah > Reading symbols from blah...done. Silly question - why not say "file blah" here? That'll set exec_bfd, and you'll be just fine. If I'm right, and you want to support the above sequence, you could probably locally make sym set the exec file, if none was set. > (gdb) upload blah /tmp/blah > (gdb) r /tmp/blah > Starting program: /tmp/blah > (gdb) b main > Breakpoint 1 at 0x8048402: file blah.c, line 10. > (gdb) c > Continuing. > > Breakpoint 1, main () at blah.c:10 > 10 func(); > > The problem that we're running into is that exec_bfd is NULL in the code > below so we fall back on the 'hard way' which is not really necessary (if > exec_bfd is set). On the native qnx gdb, this isn't a problem because > exec_bfd is set when main() calls attach_command() which calls > exec_file_attach(). What I'd like to know is at what point should I stuff > exec_bfd? In the case of remote debugging, the file with the symbols is > '/home/kewarken/test/blah' and the file being run (on the remote) is > /tmp/blah. We need to set exec_bfd to point to the same file as the one > we've read symbols from but the question is, when and where? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer