c721ec295a04d7b2e876cdefbc75e57ff53d8e17
[lldb.git] / lldb / examples / test / usage-lldb-loggings
1 #
2 # The following example shows how to utilize the pre-flight config file to route the lldb gdb-remote log messages
3 # into individual log destinations.
4 #
5 # See also .lldb-loggings in this directory as well as the tmp dir which contains the two log files abridged due
6 # to their log sizes.
7 #
8
9 [11:31:34] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
10 config: {'pre_flight': <function pre_flight at 0x107042140>}
11 LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
12 LLDB-165
13 Path: /Volumes/data/lldb/svn/ToT
14 URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
15 Repository Root: https://johnny@llvm.org/svn/llvm-project
16 Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
17 Revision: 162231
18 Node Kind: directory
19 Schedule: normal
20 Last Changed Author: johnny
21 Last Changed Rev: 162228
22 Last Changed Date: 2012-08-20 14:16:02 -0700 (Mon, 20 Aug 2012)
23
24
25 lldb.pre_flight: def pre_flight(self):
26     import os
27     import lldb
28     import lldbtest
29
30     dest = os.path.join("/tmp", "lldb_log-%s-%s-%s.txt" % (self.getArchitecture(), self.getCompiler(), self.id()))
31     print "\nEnabling lldb logging for test case:", self
32     print "with log destination:", dest
33     self.runCmd("log enable -f %s gdb-remote packets process" % dest)
34
35 lldb.post_flight: None
36
37 Session logs for test failures/errors/unexpected successes will go into directory '2012-08-22-11_36_37'
38 Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
39 compilers=['clang']
40
41 Configuration: arch=x86_64 compiler=clang
42 ----------------------------------------------------------------------
43 Collected 2 tests
44
45 1: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
46    Test a sequence of breakpoint command add, list, and delete. ... 
47 Enabling lldb logging for test case: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
48 with log destination: /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt
49 ok
50 2: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
51    Test a sequence of breakpoint command add, list, and delete. ... 
52 Enabling lldb logging for test case: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
53 with log destination: /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt
54 ok
55
56 ----------------------------------------------------------------------
57 Ran 2 tests in 7.826s
58
59 OK
60 [11:36:44] johnny:/Volumes/data/lldb/svn/ToT/test $ ls -l /tmp/lldb_log*
61 -rw-r-----  1 johnny  wheel  614614 Aug 22 11:36 /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt
62 -rw-r-----  1 johnny  wheel  614614 Aug 22 11:36 /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt
63 [11:37:09] johnny:/Volumes/data/lldb/svn/ToT/test $