Skip to content
  1. Apr 25, 2012
  2. Apr 21, 2012
  3. Apr 16, 2012
    • Johnny Chen's avatar
      Add the capability of supplying the pre/post-flight functions to the test suite such that · 44d24971
      Johnny Chen authored
      the pre-flight code gets executed during setUp() after the debugger instance is available
      and the post-flight code gets executed during tearDown() after the debugger instance has
      done killing the inferior and deleting all the target programs.
      
      Example:
      
      [11:32:48] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-pre-post-flight  functionalities/watchpoint/hello_watchpoint
      config: {'pre_flight': <function pre_flight at 0x1098541b8>, 'post_flight': <function post_flight at 0x109854230>}
      LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
      LLDB-139
      Path: /Volumes/data/lldb/svn/ToT
      URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
      Repository Root: https://johnny@llvm.org/svn/llvm-project
      Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
      Revision: 154753
      Node Kind: directory
      Schedule: normal
      Last Changed Author: gclayton
      Last Changed Rev: 154730
      Last Changed Date: 2012-04-13 18:42:46 -0700 (Fri, 13 Apr 2012)
      
      
      lldb.pre_flight: def pre_flight(test):
          __import__("lldb")
          __import__("lldbtest")
          print "\nRunning pre-flight function:"
          print "for test case:", test
      
      lldb.post_flight: def post_flight(test):
          __import__("lldb")
          __import__("lldbtest")
          print "\nRunning post-flight function:"
          print "for test case:", test
      
      
      Session logs for test failures/errors/unexpected successes will go into directory '2012-04-16-11_34_08'
      Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-pre-post-flight functionalities/watchpoint/hello_watchpoint
      compilers=['clang']
      
      Configuration: arch=x86_64 compiler=clang
      ----------------------------------------------------------------------
      Collected 2 tests
      
      1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
         Test a simple sequence of watchpoint creation and watchpoint hit. ... 
      Running pre-flight function:
      for test case: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
      
      Running post-flight function:
      for test case: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
      ok
      2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
         Test a simple sequence of watchpoint creation and watchpoint hit. ... 
      Running pre-flight function:
      for test case: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
      
      Running post-flight function:
      for test case: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
      ok
      
      ----------------------------------------------------------------------
      Ran 2 tests in 1.584s
      
      OK
      
      llvm-svn: 154847
      44d24971
  4. Apr 14, 2012
  5. Apr 13, 2012
  6. Apr 12, 2012
  7. Apr 11, 2012
    • Greg Clayton's avatar
      Cleaned up the code and we now also dump the dynamic object for the malloc... · 7fb671ba
      Greg Clayton authored
      Cleaned up the code and we now also dump the dynamic object for the malloc block. Using this on the lldb/test/lang/objc/foundation test we can see this in action:
      
      First we can load the module:
      
      (lldb) command script import /Volumes/work/gclayton/Documents/src/lldb/examples/darwin/heap_find/heap.py
      Loading "/Volumes/work/gclayton/Documents/src/lldb/examples/darwin/heap_find/libheap.dylib"...ok
      Image 0 loaded.
      "heap_ptr_refs" and "heap_cstr_refs" commands have been installed, use the "--help" options on these commands for detailed help.
      
      
      Lets take a look at the variable "my":
      
      (lldb) fr var *my
      (MyString) *my = {
        MyBase = {
          NSObject = {
            isa = MyString
          }
          propertyMovesThings = 0
        }
        str = 0x0000000100301a60
        date = 0x0000000100301e60
        _desc_pauses = NO
      }
      
      
      We can see that this contains an ivar "str" which has a pointer value of "0x0000000100301a60". Lets search the heap for this pointer and see what we find:
      
      (lldb) heap_ptr_refs 0x0000000100301a60
      found pointer 0x0000000100301a60: block = 0x103800270, size = 384, offset = 168, type = 'void *'
      found pointer 0x0000000100301a60: block = 0x100301cf0, size = 48, offset = 16, type = 'MyString *', ivar = 'str' 
      (MyString) *addr = {
        MyBase = {
          NSObject = {
            isa = MyString
          }
          propertyMovesThings = 0
        }
        str = 0x0000000100301a60
        date = 0x0000000100301e60
        _desc_pauses = NO
      }
      found pointer 0x0000000100301a60: block = 0x100820000, size = 4096, offset = 96, type = (autorelease object pool)
      found pointer 0x0000000100301a60: block = 0x100820000, size = 4096, offset = 104, type = (autorelease object pool)
      
      
      Note that it used dynamic type info to find that it was in "MyString" at offset 16 and it also found the ivar "str"!
      
      We can also look for C string values on the heap. Lets look for "a.out":
      
      (lldb) heap_cstr_refs "a.out"
      found cstr a.out: block = 0x10010ce00, size = 96, offset = 85, type = '__NSCFString *'
      found cstr a.out: block = 0x100112d90, size = 80, offset = 68, type = 'void *'
      found cstr a.out: block = 0x100114490, size = 96, offset = 85, type = '__NSCFString *'
      found cstr a.out: block = 0x100114530, size = 112, offset = 97, type = '__NSCFString *'
      found cstr a.out: block = 0x100114e40, size = 32, offset = 17, type = '__NSCFString *'
      found cstr a.out: block = 0x100114fa0, size = 32, offset = 17, type = '__NSCFString *'
      found cstr a.out: block = 0x100300780, size = 160, offset = 128, type = '__NSCFData *'
      found cstr a.out: block = 0x100301a60, size = 112, offset = 97, type = '__NSCFString *'
      found cstr a.out: block = 0x100821000, size = 4096, offset = 100, type = 'void *'
      
      We see we have some objective C classes that contain this, so lets "po" all of the results by adding the --po option:
      
      (lldb)  heap_cstr_refs a.out --po
      found cstr a.out: block = 0x10010ce00, size = 96, offset = 85, type = '__NSCFString *'
        (__NSCFString *) 0x10010ce00 /Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out
      
      found cstr a.out: block = 0x100112d90, size = 80, offset = 68, type = 'void *'
      found cstr a.out: block = 0x100114490, size = 96, offset = 85, type = '__NSCFString *'
        (__NSCFString *) 0x100114490 /Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out
      
      found cstr a.out: block = 0x100114530, size = 112, offset = 97, type = '__NSCFString *'
        (__NSCFString *) 0x100114530 Hello from '/Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out'
      
      found cstr a.out: block = 0x100114e40, size = 32, offset = 17, type = '__NSCFString *'
        (__NSCFString *) 0x100114e40 a.out.dSYM
      
      found cstr a.out: block = 0x100114fa0, size = 32, offset = 17, type = '__NSCFString *'
        (__NSCFString *) 0x100114fa0 a.out
      
      found cstr a.out: block = 0x100300780, size = 160, offset = 128, type = '__NSCFData *'
        (__NSCFData *) 0x100300780 <48656c6c 6f206672 6f6d2027 2f566f6c 756d6573 2f776f72 6b2f6763 6c617974 6f6e2f44 6f63756d 656e7473 2f737263 2f6c6c64 622f7465 73742f6c 616e672f 6f626a63 2f666f75 6e646174 696f6e2f 612e6f75 742700>
      
      found cstr a.out: block = 0x100301a60, size = 112, offset = 97, type = '__NSCFString *'
        (__NSCFString *) 0x100301a60 Hello from '/Volumes/work/gclayton/Documents/src/lldb/test/lang/objc/foundation/a.out'
      
      found cstr a.out: block = 0x100821000, size = 4096, offset = 100, type = 'void *'
      
      llvm-svn: 154519
      7fb671ba
    • Greg Clayton's avatar
      Get rid of absolute path in "process load" command. · 88529480
      Greg Clayton authored
      llvm-svn: 154506
      88529480
    • Greg Clayton's avatar
      Added a new "heap.py" module that adds a new command line command that can... · 804de01c
      Greg Clayton authored
      Added a new "heap.py" module that adds a new command line command that can find values on the heap and print out the dynamic type of the malloc block that contains the data. I will be modifying this a bit more to tweak the output and make the output more useful.
      
      llvm-svn: 154504
      804de01c
  8. Apr 10, 2012
  9. Apr 07, 2012
  10. Apr 06, 2012
    • Sean Callanan's avatar
      Removed a call to truncate() which slowed down · afc7b13e
      Sean Callanan authored
      the stress test by a LOT.
      
      llvm-svn: 154208
      afc7b13e
    • Sean Callanan's avatar
      Updated the disassembler stress tester with two · ceabd2d7
      Sean Callanan authored
      new features:
      
      (1) it outputs the instruction currently being
          tested to a log file, if a path is provided
      
      (2) if instructed, it prints the time remaining
          in the exhaustive test
      
      llvm-svn: 154205
      ceabd2d7
    • Sean Callanan's avatar
      Added a stress-tester for LLDB's disassembler. · d181730a
      Sean Callanan authored
      Right now it only works on Mac OS X, but other
      platforms would just need to add their own
      implementation of AddLLDBToSysPathOn*().
      
      The stress-tester has two modes:
      
      Used with --bytes N --random, the stress-tester
      generates random instructions of length N and
      runs them through the disassembler.  This is
      suitable for architectures like Intel where it
      is combinatorially infeasible to run through the
      entire space of possible instructions.
      
      Used with --bytes N and no arguments (or --start
      S --stride T), the stress-tester tests the
      disassembler with a monotonically increasing
      sequence of instructions.
      
      The --start and --stride arguments are intended
      for use in multiprocessing environments.  Give
      each core an ID from 0 .. T-1, pass the ID in as
      the --start, and use T as the stride, and you
      can launch one copy of the stress-tester on each
      core you have available.
      
      llvm-svn: 154143
      d181730a
  11. Apr 03, 2012
  12. Apr 02, 2012
  13. Mar 31, 2012
  14. Mar 30, 2012
  15. Mar 29, 2012
    • Enrico Granata's avatar
      Part 1 of a series of fixes meant to improve reliability and increase ease of... · d50f18b1
      Enrico Granata authored
      Part 1 of a series of fixes meant to improve reliability and increase ease of bug fixing for data formatter issues.
      We are introducing a new Logger class on the Python side. This has the same purpose, but is unrelated, to the C++ logging facility
      The Pythonic logging can be enabled by using the following scripting commands:
      (lldb) script Logger._lldb_formatters_debug_level = {0,1,2,...}
      0 = no logging
      1 = do log
      2 = flush after logging each line - slower but safer
      3 or more = each time a Logger is constructed, log the function that has created it
      more log levels may be added, each one being more log-active than the previous
      by default, the log output will come out on your screen, to direct it to a file:
      (lldb) script Logger._lldb_formatters_debug_filename = 'filename'
      that will make the output go to the file - set to None to disable the file output and get screen logging back
      Logging has been enabled for the C++ STL formatters and for Cocoa class NSData - more logging will follow
      
      
      synthetic children providers for classes list and map (both libstdcpp and libcxx) now have internal capping for safety reasons
      this will fix crashers where a malformed list or map would not ever meet our termination conditions
      
      to set the cap to a different value:
      
      (lldb) script {gnu_libstdcpp|libcxx}.{map|list}_capping_size = new_cap (by default, it is 255)
      
      you can optionally disable the loop detection algorithm for lists
      
      (lldb) script {gnu_libstdcpp|libcxx}.list_uses_loop_detector = False
      
      llvm-svn: 153676
      d50f18b1
    • Greg Clayton's avatar
      When running this from the command line, don't pass the python script file... · 6ca75a00
      Greg Clayton authored
      When running this from the command line, don't pass the python script file itself to be disassembled.
      
      llvm-svn: 153626
      6ca75a00
    • Enrico Granata's avatar
      Fixing an issue where Unicode characters in an NSString were printed as escape... · 86ea8d82
      Enrico Granata authored
      Fixing an issue where Unicode characters in an NSString were printed as escape sequences by the summary provider shipping with LLDB - Added relevant test case code. Bonus points for identifying the source of the quotes :-)
      
      llvm-svn: 153624
      86ea8d82
  16. Mar 28, 2012
  17. Mar 27, 2012
    • Enrico Granata's avatar
      adding a summary for Objective-C type 'Class' · bf70ee97
      Enrico Granata authored
      llvm-svn: 153541
      bf70ee97
    • Enrico Granata's avatar
      Synthetic values are now automatically enabled and active by default. SBValue... · c5bc412c
      Enrico Granata authored
      Synthetic values are now automatically enabled and active by default. SBValue is set up to always wrap a synthetic value when one is available.
      A new setting enable-synthetic-value is provided on the target to disable this behavior.
      There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic.
      The test suite has been changed accordingly.
      Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang
      Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching
      
      llvm-svn: 153495
      c5bc412c
  18. Mar 23, 2012
  19. Mar 20, 2012
    • Greg Clayton's avatar
      Added a fix to the crash log script that allows you to locate and load a... · 2b1bc868
      Greg Clayton authored
      Added a fix to the crash log script that allows you to locate and load a binary from any location and _then_ do the symbolication. Something like:
      
      (lldb) file /path/to/file.so
      (lldb) crashlog crash.log
      ....
      
      Then if the file.so has already been loaded it will use the one that is already in LLDB without trying to match up the paths.
      
      llvm-svn: 153075
      2b1bc868
Loading