brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.5 KiB · 4ce9689 Raw
125 lines · plain
1#2# The following example shows how to utilize the pre-flight config file to route the lldb gdb-remote log messages3# 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 due6# 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_command10config: {'pre_flight': <function pre_flight at 0x107042140>}11LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug12LLDB-16513Path: /Volumes/data/lldb/svn/ToT14URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk15Repository Root: https://johnny@llvm.org/svn/llvm-project16Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d817Revision: 16223118Node Kind: directory19Schedule: normal20Last Changed Author: johnny21Last Changed Rev: 16222822Last Changed Date: 2012-08-20 14:16:02 -0700 (Mon, 20 Aug 2012)23 24 25lldb.pre_flight: def pre_flight(self):26    import os27    import lldb28    import lldbtest29 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:", self32    print "with log destination:", dest33    self.runCmd("log enable -f %s gdb-remote packets process" % dest)34 35lldb.post_flight: None36 37Session logs for test failures/errors/unexpected successes will go into directory '2012-08-22-11_36_37'38Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command39compilers=['clang']40 41Configuration: arch=x86_64 compiler=clang42----------------------------------------------------------------------43Collected 2 tests44 451: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)46   Test a sequence of breakpoint command add, list, and delete. ... 47Enabling lldb logging for test case: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)48with log destination: /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt49ok502: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)51   Test a sequence of breakpoint command add, list, and delete. ... 52Enabling lldb logging for test case: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)53with log destination: /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt54ok55 56----------------------------------------------------------------------57Ran 2 tests in 7.826s58 59OK60[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.txt62-rw-r-----  1 johnny  wheel  614614 Aug 22 11:36 /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt63[11:37:09] johnny:/Volumes/data/lldb/svn/ToT/test $ 64 65#66# And this shows the log files go into the session directory.67# Note that the .lldb-loggings file is modified to get the session directory now.68#69 70[11:37:09] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command71config: {'pre_flight': <function pre_flight at 0x10ca5c1b8>}72LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug73LLDB-16574Path: /Volumes/data/lldb/svn/ToT75URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk76Repository Root: https://johnny@llvm.org/svn/llvm-project77Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d878Revision: 16223179Node Kind: directory80Schedule: normal81Last Changed Author: johnny82Last Changed Rev: 16222883Last Changed Date: 2012-08-20 14:16:02 -0700 (Mon, 20 Aug 2012)84 85 86lldb.pre_flight: def pre_flight(self):87    import os88    import lldb89    import lldbtest90 91    dname = os.path.join(os.environ["LLDB_TEST"])92    if not os.path.isdir(dname):93        os.mkdir(dname)94    dest = os.path.join(dname, "lldb_log-%s-%s-%s.txt" % (self.getArchitecture(), self.getCompiler(), self.id()))95    print "\nEnabling lldb logging for test case:", self96    print "with log destination:", dest97    self.runCmd("log enable -f %s gdb-remote packets process" % dest)98 99lldb.post_flight: None100 101Session logs for test failures/errors/unexpected successes will go into directory '2012-08-22-13_21_46'102Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command103compilers=['clang']104 105Configuration: arch=x86_64 compiler=clang106----------------------------------------------------------------------107Collected 2 tests108 1091: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)110   Test a sequence of breakpoint command add, list, and delete. ... 111Enabling lldb logging for test case: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)112with log destination: /Volumes/data/lldb/svn/ToT/test/2012-08-22-13_21_46/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt113ok1142: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)115   Test a sequence of breakpoint command add, list, and delete. ... 116Enabling lldb logging for test case: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)117with log destination: /Volumes/data/lldb/svn/ToT/test/2012-08-22-13_21_46/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt118ok119 120----------------------------------------------------------------------121Ran 2 tests in 8.575s122 123OK124[13:21:55] johnny:/Volumes/data/lldb/svn/ToT/test $ 125