public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* gdb/2540: GDB needs a --sysroot command line option
@ 2008-10-21 22:08 psmith
  0 siblings, 0 replies; 2+ messages in thread
From: psmith @ 2008-10-21 22:08 UTC (permalink / raw)
  To: gdb-gnats


>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 <targ> <core>" 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 ...' <targ> <core>" 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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gdb/2540: GDB needs a --sysroot command line option
@ 2008-10-21 22:18 Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2008-10-21 22:18 UTC (permalink / raw)
  To: nobody; +Cc: gdb-prs

The following reply was made to PR gdb/2540; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@false.org>
To: psmith@gnu.org
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/2540: GDB needs a --sysroot command line option
Date: Tue, 21 Oct 2008 18:12:53 -0400

 On Tue, Oct 21, 2008 at 09:59:56PM -0000, psmith@gnu.org wrote:
 > Even if I try something like "gdb -ex 'set sysroot ...' <targ> <core>" it won't help, because GDB will internalize the executable and core before running the set sysroot command.
 
 I think that this is the actual bug; we should have a way to run
 commands before or after loading.  I usually work around it with this
 awkward form:
 
 gdb -ex 'set sysroot ...' -ex 'core-file core' <targ>
 
 -- 
 Daniel Jacobowitz
 CodeSourcery


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-21 22:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-21 22:08 gdb/2540: GDB needs a --sysroot command line option psmith
2008-10-21 22:18 Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).