in gdb there is a command like:
run $(python -c 'print "\x90"*90')
Where you use a pythons scripts output as your args. How do I do something like this in lldb?
lldb doesn't have a way to mix python execution output into the command line like this. Since lldb has always had a Python script interpreter ready to hand, it tends to rely on that for this sort of "script like" task.
The simplest example is just running a command you've made up in Python:
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>> lldb.debugger.HandleCommand("run {0}".format("\x90"*90))
You can also do this on one line:
(lldb) script lldb.debugger.HandleCommand("run {0}".format("\x90"*90))
which is handy if you do it a lot because you can make a command alias for this line, and invoke the alias. And if you want to handle the errors or do further operations on the result, there's an equivalent SBCommandInterpreter.HandleCommand API that will return the error/result to you.
There are also more programmatic ways to do this particular job, for instance:
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>> launch_info = lldb.target.GetLaunchInfo()
>>> launch_info.SetArguments(["\x90"*90], True)
>>> error = lldb.SBError()
>>> lldb.target.Launch(launch_info, error)
if you have ambitions to do fancier stuff.
There's more info on the Python Scripting here:
https://lldb.llvm.org/use/python-reference.html
and on the SB API's here:
"{0} {1} {0}".format("outside", "inside") to get: 'outside inside outside'. If you have only one substitution apparently you can leave off the 0, but that seems like an error-prone shortcut to me. Not sure why the positional marker isn't working for you, however.