[lldb-dev] Writing logging to screen

Ed Maste emaste at freebsd.org
Mon Feb 10 06:08:48 PST 2014


On 10 February 2014 08:55, Matthew Gardiner <mg11 at csr.com> wrote:
> Hi,
>
> How do I run lldb in such way that the logging statements are visible on my
> stdout/stderr?

log enable [-STgnpstv] [-f <filename>] <log-channel> <log-category>
[<log-category> [...]]

If you don't specify a "-f <filename>" you'll see the log output on stdout:

(lldb) b main
Breakpoint 1: where = ls`main + 9 at ls.c:166, address = 0x0000000000403069
(lldb) log enable freebsd process
(lldb) run
Process 29265 launching
ProcessFreeBSD::UpdateThreadList (pid = 29265)
ProcessFreeBSD::UpdateThreadList new tid = 102295
Process 29265 stopped
(lldb) process 29265 resuming (continue)
...

"log list" shows the available channels and categories.

Note that the "posix" channel (for POSIX_LOG_* categories) is spelled
"freebsd" or "linux", depending on your OS.



More information about the lldb-dev mailing list