From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15862 invoked by alias); 22 Apr 2009 19:38:34 -0000 Received: (qmail 15852 invoked by uid 22791); 22 Apr 2009 19:38:33 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Apr 2009 19:38:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9E4492BAC5A; Wed, 22 Apr 2009 15:38:24 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id SAjXvlxc9ivb; Wed, 22 Apr 2009 15:38:24 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 39D2A2BAB1B; Wed, 22 Apr 2009 15:38:24 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 7A951F5886; Wed, 22 Apr 2009 12:38:12 -0700 (PDT) Date: Wed, 22 Apr 2009 19:38:00 -0000 From: Joel Brobecker To: Jerome Guitton Cc: Eli Zaretskii , Daniel Jacobowitz , gdb-patches@sourceware.org Subject: Re: Setting up GDB init files broken in DJGPP Message-ID: <20090422193812.GD22514@adacore.com> References: <83ljq3m999.fsf@gnu.org> <20090417174113.GA4851@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <20090417174113.GA4851@adacore.com> User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00607.txt.bz2 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 517 > 2009-04-17 Jerome Guitton > > * main.c (captured_main): Move gdbinit lookups after gdb_init. This looks fine, but I propose we move this call further down, past the blocks that do an early exist if --version or --help is specified, as well as past the interpreter initialization. If those fail, no point in spending time computing these files. That also corresponds better to what used to be done before. I'm testing the attached patch... (Jerome is supposed to be on holiday) -- Joel --cNdxnHkX5QqsyA0e Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="gdbinit.diff" Content-length: 1064 commit 9493d644c2a2cb3464cf139515be528a6e140ffe Author: Joel Brobecker Date: Wed Apr 22 12:35:50 2009 -0700 * main.c (captured_main): Move gdbinit lookups further down, making sure it's not called until the basename of the gdbinit file has been set. diff --git a/gdb/main.c b/gdb/main.c index 86607d3..2f6cd75 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -359,8 +359,6 @@ captured_main (void *data) } } - get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit); - #ifdef RELOC_SRCDIR add_substitute_path_rule (RELOC_SRCDIR, make_relative_prefix (argv[0], BINDIR, @@ -778,6 +776,8 @@ Excess command line arguments ignored. (%s%s)\n"), quit_pre_print = error_pre_print; warning_pre_print = _("\nwarning: "); + get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit); + /* Read and execute the system-wide gdbinit file, if it exists. This is done *before* all the command line arguments are processed; it sets global parameters, which are independent of --cNdxnHkX5QqsyA0e--