[lldb-dev] expected behavior with run alias

Adrian McCarthy amccarth at google.com
Wed Mar 25 15:58:21 PDT 2015


Thanks for the insight.

On Wed, Mar 25, 2015 at 3:07 PM, <jingham at apple.com> wrote:

> A lot of these aliases were added to emulate the associated gdb commands,
> in order to make the transition easier for gdb users.  So in this case,
> because run is "process launch --" you can launch your program and pass the
> arguments "-foo -bar -baz" to your program by doing:
>
> (lldb) run -foo -bar -baz
>
> which pretty much what you would do in gdb.  So having the -- in the alias
> is necessary to produce the intended behavior.
>
> Since, if you don't like run the way it is, you can easily unalias it in
> your .lldbinit and re-alias it to whatever you want, it doesn't bother me
> that the built-in alias presents a reduced but more familiar view of the
> command.
>
> Jim
>
> > On Mar 25, 2015, at 2:57 PM, Adrian McCarthy <amccarth at google.com>
> wrote:
> >
> > I looking at bug 22968 and trying to figure out if there's a bug here or
> not.
> >
> > The `run` command alias ends with `--`, so there doesn't seem to be a
> way to specify options when using the alias.  For example, if you do:
> >
> >     (lldb) run -s
> >
> > That's treated as though you wrote:
> >
> >     (lldb) process launch -c<shell-path> -- -s
> >
> > The `-s` argument is placed after the `--`, which causes it to be passed
> on to the inferior and not treated as an option to the `process launch`
> command.  That's consistent but possibly surprising behavior.  If you
> wanted the `-s` on the command, you'd have to spell it out explicitly:
> >
> >     (lldb) process launch -c<shell-path> -s
> >
> > Should there be an alias that doesn't end in `--`?
> >
> > Thanks,
> > Adrian McCarthy
> > _______________________________________________
> > lldb-dev mailing list
> > lldb-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150325/89d8c3f1/attachment.html>


More information about the lldb-dev mailing list