LLDB identifies all command options via their short option character (e.g. 'c' for the '-c' option).
We have 3 options that apparently don't have a short option and only a long option, so for
those we are using 4 chars that we store in an int and identify the option based on that.
This also the reason why we store the short option character as an int in most of the code
as we might also have one of those 4-character strings packed inside an integer.
It doesn't seem that really works as we apparently not all code is aware that the character is
sometimes also a 4-byte string, so that's why we have these random short options sometimes:
(lldb) target var - Available completions: -e -- A basename or fullpath to a file that contains global variables. This option can be specified multiple times. -b -- A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times.
The e and b are actually just the truncated last part of this 4-byte strings file and shlb that were used for these options.
These two short options also appear to be not usable:
(lldb) target variable -e asdf error: invalid option with value '101'
We could fix this, but this patch is instead just giving the three options a short character and removes the whole
'4-byte strings in an int' from the code base. We anyway have a few places where people accidentially used 'char'
to store the value, and that silently transforms these options into the short option of the last character ('file' -> '-e').
The added short options are:
target variable --file -> -l (F and f were already occupied).
target variable --shlib -> -S (s was already occupied)
Some commands such as memory read have a --append-outfile option, which is now aliased to -a.