1061da546Spatrick#
2061da546Spatrick# The following example shows how to utilize the pre-flight config file to route the lldb gdb-remote log messages
3061da546Spatrick# into individual log destinations.
4061da546Spatrick#
5061da546Spatrick# See also .lldb-loggings in this directory as well as the tmp dir which contains the two log files abridged due
6061da546Spatrick# to their log sizes.
7061da546Spatrick#
8061da546Spatrick
9061da546Spatrick[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
10061da546Spatrickconfig: {'pre_flight': <function pre_flight at 0x107042140>}
11061da546SpatrickLLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
12061da546SpatrickLLDB-165
13061da546SpatrickPath: /Volumes/data/lldb/svn/ToT
14061da546SpatrickURL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
15061da546SpatrickRepository Root: https://johnny@llvm.org/svn/llvm-project
16061da546SpatrickRepository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
17061da546SpatrickRevision: 162231
18061da546SpatrickNode Kind: directory
19061da546SpatrickSchedule: normal
20061da546SpatrickLast Changed Author: johnny
21061da546SpatrickLast Changed Rev: 162228
22061da546SpatrickLast Changed Date: 2012-08-20 14:16:02 -0700 (Mon, 20 Aug 2012)
23061da546Spatrick
24061da546Spatrick
25061da546Spatricklldb.pre_flight: def pre_flight(self):
26061da546Spatrick    import os
27061da546Spatrick    import lldb
28061da546Spatrick    import lldbtest
29061da546Spatrick
30061da546Spatrick    dest = os.path.join("/tmp", "lldb_log-%s-%s-%s.txt" % (self.getArchitecture(), self.getCompiler(), self.id()))
31061da546Spatrick    print "\nEnabling lldb logging for test case:", self
32061da546Spatrick    print "with log destination:", dest
33061da546Spatrick    self.runCmd("log enable -f %s gdb-remote packets process" % dest)
34061da546Spatrick
35061da546Spatricklldb.post_flight: None
36061da546Spatrick
37061da546SpatrickSession logs for test failures/errors/unexpected successes will go into directory '2012-08-22-11_36_37'
38061da546SpatrickCommand invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
39061da546Spatrickcompilers=['clang']
40061da546Spatrick
41061da546SpatrickConfiguration: arch=x86_64 compiler=clang
42061da546Spatrick----------------------------------------------------------------------
43061da546SpatrickCollected 2 tests
44061da546Spatrick
45061da546Spatrick1: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
46061da546Spatrick   Test a sequence of breakpoint command add, list, and delete. ...
47061da546SpatrickEnabling lldb logging for test case: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
48061da546Spatrickwith log destination: /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt
49061da546Spatrickok
50061da546Spatrick2: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
51061da546Spatrick   Test a sequence of breakpoint command add, list, and delete. ...
52061da546SpatrickEnabling lldb logging for test case: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
53061da546Spatrickwith log destination: /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt
54061da546Spatrickok
55061da546Spatrick
56061da546Spatrick----------------------------------------------------------------------
57061da546SpatrickRan 2 tests in 7.826s
58061da546Spatrick
59061da546SpatrickOK
60061da546Spatrick[11:36:44] johnny:/Volumes/data/lldb/svn/ToT/test $ ls -l /tmp/lldb_log*
61061da546Spatrick-rw-r-----  1 johnny  wheel  614614 Aug 22 11:36 /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt
62061da546Spatrick-rw-r-----  1 johnny  wheel  614614 Aug 22 11:36 /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt
63061da546Spatrick[11:37:09] johnny:/Volumes/data/lldb/svn/ToT/test $
64061da546Spatrick
65061da546Spatrick#
66061da546Spatrick# And this shows the log files go into the session directory.
67061da546Spatrick# Note that the .lldb-loggings file is modified to get the session directory now.
68061da546Spatrick#
69061da546Spatrick
70061da546Spatrick[11:37:09] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
71061da546Spatrickconfig: {'pre_flight': <function pre_flight at 0x10ca5c1b8>}
72061da546SpatrickLLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
73061da546SpatrickLLDB-165
74061da546SpatrickPath: /Volumes/data/lldb/svn/ToT
75061da546SpatrickURL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
76061da546SpatrickRepository Root: https://johnny@llvm.org/svn/llvm-project
77061da546SpatrickRepository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
78061da546SpatrickRevision: 162231
79061da546SpatrickNode Kind: directory
80061da546SpatrickSchedule: normal
81061da546SpatrickLast Changed Author: johnny
82061da546SpatrickLast Changed Rev: 162228
83061da546SpatrickLast Changed Date: 2012-08-20 14:16:02 -0700 (Mon, 20 Aug 2012)
84061da546Spatrick
85061da546Spatrick
86061da546Spatricklldb.pre_flight: def pre_flight(self):
87061da546Spatrick    import os
88061da546Spatrick    import lldb
89061da546Spatrick    import lldbtest
90061da546Spatrick
91*be691f3bSpatrick    dname = os.path.join(os.environ["LLDB_TEST"])
92061da546Spatrick    if not os.path.isdir(dname):
93061da546Spatrick        os.mkdir(dname)
94061da546Spatrick    dest = os.path.join(dname, "lldb_log-%s-%s-%s.txt" % (self.getArchitecture(), self.getCompiler(), self.id()))
95061da546Spatrick    print "\nEnabling lldb logging for test case:", self
96061da546Spatrick    print "with log destination:", dest
97061da546Spatrick    self.runCmd("log enable -f %s gdb-remote packets process" % dest)
98061da546Spatrick
99061da546Spatricklldb.post_flight: None
100061da546Spatrick
101061da546SpatrickSession logs for test failures/errors/unexpected successes will go into directory '2012-08-22-13_21_46'
102061da546SpatrickCommand invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
103061da546Spatrickcompilers=['clang']
104061da546Spatrick
105061da546SpatrickConfiguration: arch=x86_64 compiler=clang
106061da546Spatrick----------------------------------------------------------------------
107061da546SpatrickCollected 2 tests
108061da546Spatrick
109061da546Spatrick1: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
110061da546Spatrick   Test a sequence of breakpoint command add, list, and delete. ...
111061da546SpatrickEnabling lldb logging for test case: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
112061da546Spatrickwith log destination: /Volumes/data/lldb/svn/ToT/test/2012-08-22-13_21_46/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt
113061da546Spatrickok
114061da546Spatrick2: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
115061da546Spatrick   Test a sequence of breakpoint command add, list, and delete. ...
116061da546SpatrickEnabling lldb logging for test case: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
117061da546Spatrickwith log destination: /Volumes/data/lldb/svn/ToT/test/2012-08-22-13_21_46/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt
118061da546Spatrickok
119061da546Spatrick
120061da546Spatrick----------------------------------------------------------------------
121061da546SpatrickRan 2 tests in 8.575s
122061da546Spatrick
123061da546SpatrickOK
124061da546Spatrick[13:21:55] johnny:/Volumes/data/lldb/svn/ToT/test $
125