Skip to content
  1. Jan 13, 2015
    • Jason Molenda's avatar
      Change the x86 assembly instruction unwind parser to · 34549b8f
      Jason Molenda authored
      step through the complete function looking for any epilogue
      instructions.  If we find an epilogue sequence, re-instate
      the correct unwind instructions if there is more code past
      that epilogue -- this will correctly handle an x86 function
      with multiple epilogues in it.
      
      NB there is still a bug with the "eh_frame augmented" 
      UnwindPlans and mid-function epilogues.  Looking at that next.
      
      <rdar://problem/18863406> 
      
      llvm-svn: 225770
      34549b8f
  2. Dec 29, 2014
  3. Dec 22, 2014
  4. Dec 21, 2014
    • Jason Molenda's avatar
      Various unwinder work. · 5c45c541
      Jason Molenda authored
      Most of the changes are to the FuncUnwinders class -- as we've added
      more types of unwind information, the way this class was written was
      making it a mess to maintain.  Instead of trying to keep one
      "non-call site" unwind plan and one "call site" unwind plan, track
      all the different types of unwind plans we can possibly retrieve for
      each function and have the call-site/non-call-site accessor methods
      retrieve those.
      
      Add a real "fast unwind plan" for x86_64 / i386 -- when doing an
      unwind through a function, this only has to read the first 4 bytes 
      to tell if the function has a standard prologue sequence.  If so, 
      we can use the architecture default unwind plan to backtrace 
      through this function.  If we try to retrieve the save location for
      other registers later on, a real unwind plan will be used.  This
      one is just for doing fast backtraces.
      
      Change the compact unwind plan importer to fill in the valid address
      range it is valid for. 
      
      Compact unwind, in theory, may have multiple entries for a single
      function.  The FuncUnwinders rewrite includes the start of supporting
      this correctly.  In practice compact unwind encodings are used for
      the entire range of the function today -- in fact, sometimes the same
      encoding is used for multiple functions that have the same unwind
      rules.  But I want to handle a single function that has multiple
      different compact unwind UnwindPlans eventually.
      
      llvm-svn: 224689
      5c45c541
  5. Dec 20, 2014
    • Jason Molenda's avatar
      Re-enable compact unwind use on Mac platforms. · b12a136c
      Jason Molenda authored
      When lldb has a binary with protected section contents,
      don't use the on-disk representation of that compact 
      uwnind -- read it only out of live memory where it has
      been decrypted.
      
      llvm-svn: 224670
      b12a136c
  6. Dec 16, 2014
  7. Dec 08, 2014
  8. Dec 06, 2014
  9. Dec 05, 2014
    • Sean Callanan's avatar
      This is the meat of the code to add Clang modules · 9998acd0
      Sean Callanan authored
      support to LLDB.  It includes the following:
      
      - Changed DeclVendor to TypeVendor.
      - Made the ObjCLanguageRuntime provide a DeclVendor
        rather than a TypeVendor.
      - Changed the consumers of TypeVendors to use
        DeclVendors instead.
      - Provided a few convenience functions on
        ClangASTContext to make that easier.
      
      llvm-svn: 223433
      9998acd0
  10. Nov 18, 2014
    • Jason Molenda's avatar
      Fix up the code in the FuncUnwinders class that · ae3e40dd
      Jason Molenda authored
      retrieves the personality routine addr and the
      LSDA addr.  Don't bother checking with the
      "non-call site" unwind plan - this kind of
      information is only going to come from the 
      call site unwind plan.
      
      llvm-svn: 222226
      ae3e40dd
    • Jason Molenda's avatar
      Read the LSDA and Personality Routine function address out of the · e9c7ecf6
      Jason Molenda authored
      eh_frame data.  These two pieces of information are used in the
      process of exception handler unwinding on SysV ABI systems.
      
      This patch reads the data from the eh_frame section 
      (DWARFCallFrameInfo.cpp), allows for it to be saved & read out
      of a given UnwindPlan (UnwindPlan.h, UnwindPlan.cpp) - as well
      as printing the information in the UnwindPlan::Dump method - and
      adds methods to the FuncUnwinders object so that higher levels
      can query if a given function has an LSDA / personality routine
      defined.
      
      It's only lightly tested, but seems to be working correctly as long
      as your have this information in eh_frame.  Does not address getting
      this information from compact unwind yet on Darwin systems.
      
      <rdar://problem/18742797> 
      
      llvm-svn: 222214
      e9c7ecf6
  11. Nov 17, 2014
    • Greg Clayton's avatar
      Fixed more fallout from running the test suite remotely on iOS devices. · 8012cadb
      Greg Clayton authored
      Fixed include:
      - Change Platform::ResolveExecutable(...) to take a ModuleSpec instead of a FileSpec + ArchSpec to help resolve executables correctly when we have just a path + UUID (no arch).
      - Add the ability to set the listener in SBLaunchInfo and SBAttachInfo in case you don't want to use the debugger as the default listener. 
      - Modified all places that use the SBLaunchInfo/SBAttachInfo and the internal ProcessLaunchInfo/ProcessAttachInfo to not take a listener as a parameter since it is in the launch/attach info now
      - Load a module's sections by default when removing a module from a target. Since we create JIT modules for expressions and helper functions, we could end up with stale data in the section load list if a module was removed from the target as the section load list would still have entries for the unloaded module. Target now has the following functions to help unload all sections a single or multiple modules:
      
          size_t
          Target::UnloadModuleSections (const ModuleList &module_list);
      
          size_t
          Target::UnloadModuleSections (const lldb::ModuleSP &module_sp);
      
      llvm-svn: 222167
      8012cadb
  12. Nov 15, 2014
    • Jim Ingham's avatar
      For some reason, sometimes the directory paths that clang emits have internal · 96a1596a
      Jim Ingham authored
      relative paths, like:
      
      /whatever/llvm/lib/Sema/../../include/llvm/Sema/
      
      That causes problems with our type uniquing, since we use the declaration file
      and line as one component of the uniquing, and different ways of getting to the
      same file will have different directory spellings, though they are functionally
      equivalent.  We end up with two copies of the exact same type because of this, 
      and that makes the expression parser give "duplicate type" errors.
      
      I added a method to resolve paths with ../ in them and used that in the FileSpec::Equals,
      for comparing Declarations and for doing Breakpoint compares as well, since they also
      suffer from this if you specify breakpoints by full path (since nobody knows what
      ../'s to insert...)
      
      <rdar://problem/18765814>
      
      llvm-svn: 222075
      96a1596a
  13. Nov 12, 2014
    • Justin Hibbits's avatar
      Add an alternative CFA type. · 43bcdbde
      Justin Hibbits authored
      Summary:
      PowerPC handles the stack chain with the current stack pointer being a pointer
      to the backchain (CFA).  LLDB currently has no way of handling this, so this
      adds a "CFA is dereferenced from a register" type.
      
      Discussed with Jason Molenda, who also provided the initial patch for this.
      
      Reviewers: jasonmolenda
      
      Reviewed By: jasonmolenda
      
      Subscribers: emaste, lldb-commits
      
      Differential Revision: http://reviews.llvm.org/D6182
      
      llvm-svn: 221788
      43bcdbde
  14. Nov 04, 2014
  15. Nov 01, 2014
  16. Oct 30, 2014
  17. Oct 28, 2014
  18. Oct 17, 2014
  19. Oct 16, 2014
  20. Oct 15, 2014
  21. Oct 11, 2014
    • Jason Molenda's avatar
      Add a new disassembly-format specification so that the disassembler · aff1b357
      Jason Molenda authored
      output style can be customized.  Change the built-in default to be
      more similar to gdb's disassembly formatting.
      
      The disassembly-format for a gdb-like output is
      
      ${addr-file-or-load} <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>: 
      
      The disassembly-format for the lldb style output is
      
      {${function.initial-function}{${module.file.basename}`}{${function.name-without-args}}:\n}{${function.changed}\n{${module.file.basename}`}{${function.name-without-args}}:\n}{${current-pc-arrow} }{${addr-file-or-load}}: 
      
      The two backticks in the lldb style formatter triggers the sub-expression evaluation in
      CommandInterpreter::PreprocessCommand() so you can't use that one as-is ... changing to
      use ' characters instead of ` would work around that.
      
      <rdar://problem/9885398> 
      
      llvm-svn: 219544
      aff1b357
  22. Sep 29, 2014
  23. Sep 19, 2014
    • Enrico Granata's avatar
      Extend the member function discovery APIs to also support Objective-C as well as C++ · 47caf9a9
      Enrico Granata authored
      For the Objective-C case, we do not have a "function type" notion, so we actually end up wrapping the clang ObjCMethodDecl in the Impl object, and ask function-y questions of it
      In general, you can always ask for return type, number of arguments, and type of each argument using the TypeMemberFunction layer - but in the C++ case, you can also acquire a Type object for the function itself, which instead you can't do in the Objective-C case
      
      llvm-svn: 218132
      47caf9a9
  24. Sep 16, 2014
  25. Sep 15, 2014
  26. Sep 12, 2014
  27. Aug 26, 2014
  28. Aug 25, 2014
    • Todd Fiala's avatar
      Add 64-bit eh_frame section CFI support. · 1767e115
      Todd Fiala authored
      In practice, 64bit eh_frame is not used even for x86_64 binaries. The main reason is in eh_frame we almost always use pc-relative addressing, so addresses are within 32bits and gcc just sticks to 32bit eh_frame.
      
      I generated 64bit eh_frame for Android Java runtime and unwind successfully in gdb, and in lldb with this patch.
      
      Patch by Tong Shen.
      
      llvm-svn: 216409
      1767e115
    • Todd Fiala's avatar
      On x86 & x86_64, try to use eh_frame for frame 0. · 0562524b
      Todd Fiala authored
      We decided to use assmbly profiler instead of eh_frame for frame 0 because for compiler generated code, eh_frame is usually synchronous(a.k.a. only valid at call site); and we have no way to tell if it's asynchronous or not.
      But for x86 & x86_64 compiler generated code:
      1. clang & GCC describes all prologue instructions in eh_frame;
      2. mid-function stack pointer altering instructions can be easily detected.
      So we can grab eh_frame, and use assembly profiler to augment it into asynchronous unwind table.
      This change also benefits hand-written assembly; eh_frame for hand-written assembly is often asynchronous,so we have a much better chance to successfully unwind through them.
      
      Change by Tong Shen.
      
      llvm-svn: 216406
      0562524b
  29. Aug 22, 2014
    • Jason Molenda's avatar
      When adding a dSYM to an existing ObjectFile, we can have a situation · 05a09c67
      Jason Molenda authored
      with binaries in the dyld shared cache (esp on iOS) where the file
      address for the executable binary (maybe from memory, maybe from
      an expanded copy of the dyld shared cache) is different from the
      file address in the dSYM.  In that case, ObjectFileMachO replaces
      the file addresses from the original binary with the dSYM file
      addresses (usually 0-based) -- lldb doesn't have a notion of two
      file addresses for a given module so they need to agree.
      
      There was a cache of file addresses over in the Symtab so I added
      a method to the Module and the objects within to clear any file address
      caches if they exist, and added an implementation in the Symtab
      module to do that.
      <rdar://problem/16929569> 
      
      llvm-svn: 216258
      05a09c67
  30. Aug 19, 2014
    • Enrico Granata's avatar
      This is a fairly bulky patch, but a lot of it involves rearranging existing code · 5d84a697
      Enrico Granata authored
      What it does:
      
      - it introduces a concept of EncodingToType to the ObjCLanguageRuntime
        The ObjC runtime has a "type encoding" feature that describes types as strings
        The EncodingToType is a decoder for that format, making types out of type encoding strings
      This feature already existed in some shape as we were using it to create method signatures out of the runtime, but this checkin extends the parser to support the full syntax, and moves things so that more parts of LLDB have access to this decoder
      
      - it splits the ClassDescriptorV2 object to its own file, it was starting to grow too large
      
      - it adds to the ClassDescriptor mechanism a notion of ivar storage; the ObjC runtime vends ivar information as well as method information
      While ivar information is not ready for prime type (i.e. we don't want to add it to the runtime generated types for expression evaluator usage), there are potentially useful scenarios in which realizing ivar types could be useful. For now, the ClassDescriptor is going to hold ivar information directly. Existing code already allows describing ivars, this patch hooks those moving parts up so that one can actually ask a ClassDescriptor about ivars for the class it represents
      
      and as a couple minor niceties:
      - it makes it possible to retrieve the LLDB ClangASTContext that is associated to a clang::ASTContext
      - it extends the ValueObject-to-ClassDescriptor API in the language runtime to deal correctly with base-class hierarchies
      
      llvm-svn: 216026
      5d84a697
  31. Aug 16, 2014
Loading