From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5441 invoked by alias); 21 Oct 2008 22:08:02 -0000 Received: (qmail 5319 invoked by uid 71); 21 Oct 2008 22:08:01 -0000 Resent-Date: 21 Oct 2008 22:08:01 -0000 Resent-Message-ID: <20081021220801.5318.qmail@sourceware.org> Resent-From: gdb-gnats@sources.redhat.com (GNATS Filer) Resent-To: nobody@sources.redhat.com Resent-Cc: gdb-prs@sources.redhat.com Resent-Reply-To: gdb-gnats@sources.redhat.com, psmith@gnu.org Received: (qmail 17214 invoked by uid 48); 21 Oct 2008 21:59:56 -0000 Message-Id: <20081021215956.17213.qmail@sourceware.org> Date: Tue, 21 Oct 2008 22:08:00 -0000 From: psmith@gnu.org Reply-To: psmith@gnu.org To: gdb-gnats@sources.redhat.com X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: gdb/2540: GDB needs a --sysroot command line option Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2008-q4/txt/msg00021.txt.bz2 >Number: 2540 >Category: gdb >Synopsis: GDB needs a --sysroot command line option >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: change-request >Submitter-Id: net >Arrival-Date: Tue Oct 21 22:08:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: psmith@gnu.org >Release: gdb-6.8 >Organization: >Environment: --host=i686-pc-linux-gnu --target=powerpc-linux-gnu >Description: Most of the GCC suite now takes a --sysroot command line argument specifying where to look for the system headers, libraries, etc. GDB has a new "set sysroot" command which does the same thing, and that's very handy. However, GDB really needs this to be available as a command-line option as well. The problem is that if I run "gdb " it will try to read the various libraries, etc. before I get any command-line prompt, and it will of course fail because the ones it finds are not the right sysroot ones. Only after I get a long list of error messages do I get a prompt and the ability to "set sysroot ..." whereupon GDB can now find the right libraries etc. Even if I try something like "gdb -ex 'set sysroot ...' " it won't help, because GDB will internalize the executable and core before running the set sysroot command. What I would really like is a --sysroot=... option to GDB, just like I have for GCC. In this case GDB can see that option and process it first, before it tries to read in the exec file or the core file. This will keep everything loading in the right order and avoid lots of warnings and error messages. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: