Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run an external command from lldb prompt

Tags:

lldb

Does lldb have an equivalent for gdb's shell command to run external commands from the prompt? (see How can I execute external commands from the gdb command prompt?)

like image 736
Robert Knight Avatar asked Nov 20 '14 11:11

Robert Knight


People also ask

How do you set a breakpoint in LLDB?

In lldb you can set breakpoints by typing either break or b followed by information on where you want the program to pause. After the b command, you can put either: a function name (e.g., b my_subroutine ) a line number (e.g., b 12 )

Does LLDB work for C?

lldb is the default debugger in Xcode on macOS and supports debugging C, Objective-C and C++ on the desktop and iOS devices and simulator.

Can LLDB connect to Gdbserver?

LLDB supports GDB server that QEMU uses, so you can do the same thing with the previous section, but with some command modification as LLDB has some commands that are different than GDB You can run QEMU to listen for a "GDB connection" before it starts executing any code to debug it.

Is LLDB compatible with GDB?

The standard LLDB installation provides you with an extensive set of commands designed to be compatible with familiar GDB commands. In addition to using the standard configuration, you can easily customize LLDB to suit your needs. Both GDB and LLDB are of course excellent debuggers without doubt.


1 Answers

This might be what you're looking for...

(lldb) help platform shell
     Run a shell command on a the selected platform.  This command takes 'raw'
     input (no need to quote stuff).

Syntax: platform shell <shell-command>

Command Options Usage:
  platform shell [-t <value>]

       -t <value> ( --timeout <value> )
            Seconds to wait for the remote host to finish running the command.

IMPORTANT NOTE:  Because this command takes 'raw' input, if you use any
     command options you must use ' -- ' between the end of the command options
     and the beginning of the raw input.
like image 125
DonCristobal Avatar answered Oct 26 '22 21:10

DonCristobal