Skip to content
  1. Apr 14, 2012
  2. Apr 13, 2012
    • Greg Clayton's avatar
      Added the thread ID (tid) to each packet history item and the packet history... · d451c1a8
      Greg Clayton authored
      Added the thread ID (tid) to each packet history item and the packet history now always dumps to a lldb_private::Stream.
      
      Enable logging the packet history when registers fail to read due to not getting the sequence mutex if "--verbose" is enabled on the log channel for the "gdb-remote" log category.
      
      This will help us track down some issues.
      
      llvm-svn: 154704
      d451c1a8
    • Johnny Chen's avatar
      First step to make the test suite runnable for remote platforms. · 9a27713a
      Johnny Chen authored
      For the types directory, we were running lldbtest.system() to execute the compiled program
      on the test host to collect golden output in order to compare with the output of various
      lldb debugger commands as performed later.  This won't work for the remote platform
      scenario where the architecture of the target and host platforms are different.
      
      Modify the AbstractBase class to use lldb to launch the inferior while specifying the
      output file, from which the golden output is collected and grokked.  How to bootstrap and
      to connect to the remote platform is still being worked at.
      
      llvm-svn: 154699
      9a27713a
    • Jim Ingham's avatar
      Factor out a bunch of common code in the two ThreadPlanCallFunction... · 0092c8eb
      Jim Ingham authored
      Factor out a bunch of common code in the two ThreadPlanCallFunction constructors.  Also add a sanity check - try reading the frame, and if we fail bag out.
      
      llvm-svn: 154698
      0092c8eb
    • Greg Clayton's avatar
      <rdar://problem/11193466> · de0e9d04
      Greg Clayton authored
      Fixed an error where lldb would hang when writing memory near the end of the addres space due to an unsigned overflow.
      
      llvm-svn: 154697
      de0e9d04
    • Jim Ingham's avatar
      Couple more places in SBValue where you need to take the run-lock. · cbbdaa93
      Jim Ingham authored
      llvm-svn: 154683
      cbbdaa93
    • Jim Ingham's avatar
      ThreadPlanCallFunction's destructor wasn't calling DoTakedown, so if the that... · 718583ff
      Jim Ingham authored
      ThreadPlanCallFunction's destructor wasn't calling DoTakedown, so if the that plan got discarded we weren't doing the takedown.
      
      llvm-svn: 154681
      718583ff
    • Greg Clayton's avatar
      Added a --memory option to allow dumping the matching malloc block memory with... · d84bb485
      Greg Clayton authored
      Added a --memory option to allow dumping the matching malloc block memory with a default format that makes sense, or that format can be overridden with the --format option.
      
      llvm-svn: 154671
      d84bb485
    • Greg Clayton's avatar
      <rdar://problem/11241798> · f958f348
      Greg Clayton authored
      The less locks there are, the better. I removed the thread ID mutex and now just shared the m_thread_list's mutex to make sure we don't deadlock due to lock inversion.
      
      llvm-svn: 154652
      f958f348
    • Jason Molenda's avatar
      version bump to lldb-139. · 5a9f9d32
      Jason Molenda authored
      llvm-svn: 154650
      5a9f9d32
    • Sean Callanan's avatar
      Updated llvm.zip to include a fix for a leak in · 84790aed
      Sean Callanan authored
      the MC disassembler.
      
      llvm-svn: 154649
      84790aed
    • Johnny Chen's avatar
    • Greg Clayton's avatar
      Added more complete error checking for mutexes only for "Debug" builds where... · ce7d345a
      Greg Clayton authored
      Added more complete error checking for mutexes only for "Debug" builds where we always check if a mutex is valid prior to doing stuff with it. We also track when mutexes are initialized and destroyed and keep these in sets that can very subsequent pthread_mutex_XXX API calls.
      
      llvm-svn: 154637
      ce7d345a
    • Johnny Chen's avatar
    • Johnny Chen's avatar
      Fix some test suite errors. TestForwardDecl.py errors were due to bad... · 45872c01
      Johnny Chen authored
      Fix some test suite errors.  TestForwardDecl.py errors were due to bad Makefile.rules, while TestHiddenIvars.py errors due to features only available in modern objc runtime.
      
      llvm-svn: 154635
      45872c01
    • Sean Callanan's avatar
      Added a mechanism for keeping track of where in · 60217120
      Sean Callanan authored
      the debug information individual Decls came from.
      
      We've had a metadata infrastructure for a while,
      which was intended to solve a problem we've since
      dealt with in a different way.  (It was meant to
      keep track of which definition of an Objective-C
      class was the "true" definition, but we now find
      it by searching the symbols for the class symbol.)
      The metadata is attached to the ExternalASTSource,
      which means it has a one-to-one correspondence with
      AST contexts.
      
      I've repurposed the metadata infrastructure to
      hold the object file and DIE offset for the DWARF
      information corresponding to a Decl.  There are
      methods in ClangASTContext that get and set this
      metadata, and the ClangASTImporter is capable of
      tracking down the metadata for Decls that have been
      copied out of the debug information into the
      parser's AST context without using any additional
      memory.
      
      To see the metadata, you just have to enable the
      expression log:
      -
      (lldb) log enable lldb expr
      -
      and watch the import messages.  The high 32 bits
      of the metadata indicate the index of the object
      file in its containing DWARFDebugMap; I have also
      added a log which you can use to track that mapping:
      -
      (lldb) log enable dwarf map
      -
      
      This adds 64 bits per Decl, which in my testing
      hasn't turned out to be very much (debugging Clang
      produces around 6500 Decls in my tests).  To track
      how much data is being consumed, I've also added a
      global variable g_TotalSizeOfMetadata which tracks
      the total number of Decls that have metadata in all
      active AST contexts.
      
      Right now this metadata is enormously useful for
      tracking down bugs in the debug info parser.  In the
      future I also want to use this information to provide
      more intelligent error messages instead of printing
      empty source lines wherever Clang refers to the
      location where something is defined.
      
      llvm-svn: 154634
      60217120
    • Greg Clayton's avatar
      Expose GetAddressClass() from both the SBAddress and SBInstruction so clients... · c8e0c244
      Greg Clayton authored
      Expose GetAddressClass() from both the SBAddress and SBInstruction so clients can tell the difference between ARM/Thumb opcodes when disassembling ARM.
      
      llvm-svn: 154633
      c8e0c244
    • Sean Callanan's avatar
      Fixed a problem where LLDB inserted regular C · 02eee4d4
      Sean Callanan authored
      FunctionDecls into classes if it looked up a
      method in a different DWARF context than the
      one where it found the parent class's definition.
      
      The symptom of this was, for a method A::B(),
      
      1) LLDB finds A in context 1, creating a
         CXXRecordDecl for A and marking it as needing
         completion
      
      2) LLDB looks up B in context 2, finds that its
         parent A already has a CXXRecordDecl, but can't
         find a CXXMethodDecl for B
      
      3) Not finding a CXXMethodDecl for B, LLDB doesn't
         set the flag indicating that B was resolved
      
      4) Because the flag wasn't set, LLDB's fallthrough
         code creates a FunctionDecl for B and sticks it
         in the DeclContext -- in this case, A.
      
      5) Clang crashes on finding a FunctionDecl inside a
         CXXRecordDecl.
      
      llvm-svn: 154627
      02eee4d4
  3. Apr 12, 2012
  4. Apr 11, 2012
    • Sean Callanan's avatar
      Fixed a crash in Clang when a superclass of an · 18a11e33
      Sean Callanan authored
      Objective-C class doesn't have a definition but
      Clang tries to read through its protocols anyway.
      
      llvm-svn: 154538
      18a11e33
    • Greg Clayton's avatar
      Cleaned up code that was getting SBData for an SBInstruction. · d1411e1a
      Greg Clayton authored
      llvm-svn: 154535
      d1411e1a
    • 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
    • Greg Clayton's avatar
      6a0afeb9
    • Greg Clayton's avatar
    • Greg Clayton's avatar
      No functionality changes, mostly cleanup. · 37a0a24a
      Greg Clayton authored
      Cleaned up the Mutex::Locker and the ReadWriteLock classes a bit.
      
      Also cleaned up the GDBRemoteCommunication class to not have so many packet functions. Used the "NoLock" versions of send/receive packet functions when possible for a bit of performance.
      
      llvm-svn: 154458
      37a0a24a
    • Jason Molenda's avatar
      Tweak arm variants list for valid arches settings. · 9704e829
      Jason Molenda authored
      llvm-svn: 154450
      9704e829
  5. Apr 10, 2012
Loading