• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: gdb start-with-shell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb start-with-shell


  • Subject: Re: gdb start-with-shell
  • From: Peter O'Gorman <email@hidden>
  • Date: Mon, 21 Jul 2008 15:04:43 -0500

Jeff LaMarche wrote:
> Does anyone know where the start-with-shell option for gdb is
> documented? I've seen it mentioned in a few places in release notes,
> mailing lists, and in the Memory Usage Performance Guidelines. This
> option does not appear in the documentation for gdb, neither in the user
> documentation or the documentation of GDB internals.. is this something
> that Apple added? Is there a description of exactly what it's doing?

I don't know that it is really documented. The gdb source is available,
and you can see what the APPLE LOCAL marked changes do here:
http://www.opensource.apple.com/darwinsource/DevToolsMar2008/gdb-908/src/gdb/fork-child.c

Instead of execing the application directly, with start-with-shell on,
gdb execs the shell which execs the application, this is useful in that
the shell will do parameter expansion and globbing of the arguments etc.

To illustrate:
$ gdb /bin/ls
[ ]
(gdb) show start-with-shell
If GDB should use shell to invoke inferior (performs argument expansion
in shell) is off.
(gdb) set start-with-shell 1
(gdb) set args -d D*
(gdb) r
Starting program: /bin/ls -d D*
Desktop         Documents       Downloads

Program exited normally.
(gdb) set start-with-shell 0
(gdb) r
Starting program: /bin/ls -d D*
ls: D*: No such file or directory

Program exited with code 01.

With start-with-shell on, the shell expanded D* for me, with it off, ls
was passed 'D*' in argv[2], did not do globbing, and failed to find a
directory named 'D*'.

Hope this helps,
Peter
--
Peter O'Gorman
http://pogma.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >gdb start-with-shell (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: Re: Error codes
  • Next by Date: Re: Error codes
  • Previous by thread: gdb start-with-shell
  • Next by thread: Re: gdb start-with-shell
  • Index(es):
    • Date
    • Thread