I cannot find the command set the working directory and
(lldb) process launch --working-dir /tmp
If you are attaching to a GDB server that already has an existing process running, your GDB server is responsible for setting the working directory prior to LLDB attaching.
If you start GDB server with no executable, then you can use the LLDB specific packets for setting environment variables and setting the working directory, but most GDB servers don't support that. Let me know if you want to know more about that.
The command to set temporary breakpoint like tbreak in
(lldb) help tbreak
Set a one shot breakpoint using a regular expression to specify the location, where <linenum> is in decimal and <address> is in hex. This command takes 'raw' input (no need to quote stuff).
Syntax: _regexp-tbreak [<filename>:<linenum>]
'tbreak' is an abbreviation for '_regexp-tbreak'
For remote connection, I only find gdb-remote, which based
On manual is target remote. But I cannot find about how to
Use it and those matching control commands
LLDB doesn't need to switch targets. To connect to a remote GDB server:
1 - launch remote GDB server
remote% debugserver local:1234 -- /bin/ls -lAF
2 - launch lldb and attach
(lldb) process connect --plugin gdb-remote connect://remote:1234
The command below is equivalent to the above command:
(lldb) gdb-remote remote:1234
"gdb-remote" is just a regex alias that will run "process connect".
(lldb) process detach
I have no idea what this does.
set remote exec-file
This is where you want to use the python API, but you can do this via the "script" command line command. Lets say you have a local copy of "/bin/ls" for your remote system on your current machine at "/tmp/ls". When you launch lldb you would use the local copy:
(lldb) target create --platform remote-macosx /tmp/ls
When you can set the remote path:
(lldb) script exe_module = lldb.target.FindModule(lldb.SBFileSpec('/tmp/ls', false)); exe_module.SetPlatformFileSpec(lldb.SBFileSpec('/bin/ls', False))