[Lldb-commits] [PATCH] Close terminal after LaunchInTerminalTestCase test

jingham at apple.com jingham at apple.com
Fri Feb 6 11:40:22 PST 2015


A long-standing bug in the lldb command help system is that it doesn't print what the default value of boolean flags is.  So for instance you get:

(lldb) help process launch
     Launch the executable in the debugger.

Syntax: process launch <cmd-options> [<run-args>]

Command Options Usage:
  process launch [-s] [-A <boolean>] [-p <plugin>] [-w <directory>] [-a <arch>] [-v <none>] [-c[<filename>]] [-i <filename>] [-o <filename>] [-e <filename>] [<run-args>]
  process launch [-st] [-A <boolean>] [-p <plugin>] [-w <directory>] [-a <arch>] [-v <none>] [-c[<filename>]] [<run-args>]
  process launch [-ns] [-A <boolean>] [-p <plugin>] [-w <directory>] [-a <arch>] [-v <none>] [-c[<filename>]] [<run-args>]

       -A <boolean> ( --disable-aslr <boolean> )
            Set whether to disable address space layout randomization when launching a process.

You can't tell what you are going to get if don't specify -A.  So I try to write the option so that it indicates what the default value is.  In this case, if you say nothing we'll disable ASLR.  This is obviously just a hack to work around an omission in the help system.  And in a couple of places (like --one-shot in the "breakpoint set" command where I don't do this because it would have made the name really non-obvious.)  

That's a pretty weak reason for the naming, and we really should include the default value - at least for booleans - in the command table and then use it in the help system.

Jim


> On Feb 6, 2015, at 11:20 AM, Vince Harron <vharron at google.com> wrote:
> 
>> You can set "don't close after exit" flag in settings
> 
> 
> Awesome
> 
> FWIW, I prefer flags being expressed in positive terms.  I think it
> significantly improves understanding.  (e.g. "close after exit" is better
> than "don't close after exit")  I would also default to "close after exit"
> 
> false
> -----
> 
> UI presentation:
> 
> [X] Launch in new TTY
>  [X] Close TTY after process exit
> 
> 
> http://reviews.llvm.org/D7468
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 





More information about the lldb-commits mailing list