Skip to content
Snippets Groups Projects
  1. Jul 22, 2015
  2. Jul 09, 2015
  3. Jun 25, 2015
    • Greg Clayton's avatar
      Resubmitting 240466 after fixing the linux test suite failures. · 358cf1ea
      Greg Clayton authored
      A few extras were fixed
      
      - Symbol::GetAddress() now returns an Address object, not a reference. There were places where people were accessing the address of a symbol when the symbol's value wasn't an address symbol. On MacOSX, undefined symbols have a value zero and some places where using the symbol's address and getting an absolute address of zero (since an Address object with no section and an m_offset whose value isn't LLDB_INVALID_ADDRESS is considered an absolute address). So fixing this required some changes to make sure people were getting what they expected. 
      - Since some places want to access the address as a reference, I added a few new functions to symbol:
          Address &Symbol::GetAddressRef();
          const Address &Symbol::GetAddressRef() const;
      
      Linux test suite passes just fine now.
      
      <rdar://problem/21494354>
      
      llvm-svn: 240702
      358cf1ea
  4. Feb 14, 2015
  5. Jan 15, 2015
    • Vince Harron's avatar
      Moved Args::StringToXIntYZ to StringConvert::ToXIntYZ · 5275aaa0
      Vince Harron authored
      The refactor was motivated by some comments that Greg made
      http://reviews.llvm.org/D6918
      
      and also to break a dependency cascade that caused functions linking
      in string->int conversion functions to pull in most of lldb
      
      llvm-svn: 226199
      5275aaa0
    • Greg Clayton's avatar
      Modified LLDB to be able to lookup global variables by address. · 2501e5e2
      Greg Clayton authored
      This is done by adding a "Variable *" to SymbolContext and allowing SymbolFile::ResolveSymbolContext() so if an address is resolved into a symbol context, we can include the global or static variable for that address.
      
      This means you can now find global variables that are merged globals when doing a "image lookup --verbose --address 0x1230000". Previously we would resolve a symbol and show "_MergedGlobals123 + 1234". But now we can show the global variable name.
      
      The eSymbolContextEverything purposely does not include the new eSymbolContextVariable in its lookup since stack frame code does many lookups and we don't want it triggering the global variable lookups.
      
      <rdar://problem/18945678> 
      
      llvm-svn: 226084
      2501e5e2
  6. 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
  7. Apr 20, 2014
  8. Mar 03, 2014
  9. Nov 01, 2013
    • Sylvestre Ledru's avatar
      Fix the format warnings. · 779f9213
      Sylvestre Ledru authored
      In almost all cases, the misuse is about "%lu" being used instead of the correct "%zu" (even though these are compatible on 64-bit platforms in practice). There are even a couple of cases where "%ld" (ie., signed int) is used instead of "%zu", and one where "%lu" is used instead of "%" PRIu64.
      
      Fixes bug #17551.
      
      Patch by "/dev/humancontroller"
      
      llvm-svn: 193832
      779f9213
  10. Jun 12, 2013
    • Greg Clayton's avatar
      Huge performance improvements when one breakpoint contains many locations. · d8cf1a11
      Greg Clayton authored
      325,000 breakpoints for running "breakpoint set --func-regex ." on lldb itself (after hitting a breakpoint at main so that LLDB.framework is loaded) used to take up to an hour to set, now we are down under a minute. With warm file caches, we are at 40 seconds, and that is with setting 325,000 breakpoint through the GDB remote API. Linux and the native debuggers might be faster. I haven't timed what how much is debug info parsing and how much is the protocol traffic to/from GDB remote.
      
      That there were many performance issues. Most of them were due to storing breakpoints in the wrong data structures, or using the wrong iterators to traverse the lists, traversing the lists in inefficient ways, and not optimizing certain function name lookups/symbol merges correctly.
      
      Debugging after that is also now very efficient. There were issues with replacing the breakpoint opcodes in memory that was read, and those routines were also fixed.
      
      llvm-svn: 183820
      d8cf1a11
  11. May 17, 2013
    • Greg Clayton's avatar
      <rdar://problem/13217784> · ef2129d1
      Greg Clayton authored
      "source list -n <func>" can now show more than one location that matches a function name. It will unique multiple of the same source locations so they don't get displayed. It also handles inline functions correctly.
      
      llvm-svn: 182067
      ef2129d1
  12. Apr 29, 2013
    • Greg Clayton's avatar
      Cleanup logging to use the new "std::string FileSpec::GetPath()" function.... · b5ad4ec7
      Greg Clayton authored
      Cleanup logging to use the new "std::string FileSpec::GetPath()" function. Also added a similar function for modules:
      
      std::string
      Module::GetSpecificationDescription () const;
      
      This returns the module as "/usr/lib/libfoo.dylib" for normal files (calls "std::string FileSpec::GetPath()" on m_file) but it also might include the object name in case the module is for a .o file in a BSD archive ("/usr/lib/libfoo.a(bar.o)"). Cleaned up necessary logging code to use it.
      
      llvm-svn: 180717
      b5ad4ec7
  13. Apr 03, 2013
    • Greg Clayton's avatar
      <rdar://problem/13506727> · 43fe217b
      Greg Clayton authored
      Symbol table function names should support lookups like symbols with debug info. 
      
      To fix this I:
      - Gutted the way FindFunctions is used, there used to be way too much smarts only in the DWARF plug-in
      - Made it more efficient by chopping the name up once and using simpler queries so that SymbolFile and Symtab plug-ins don't need to do as much
      - Filter the results at a higher level
      - Make the lldb_private::Symtab able to chop up C++ mangled names and make as much sense out of them as possible and also be able to search by basename, fullname, method name, and selector name.
      
      llvm-svn: 178608
      43fe217b
  14. Mar 28, 2013
    • Greg Clayton's avatar
      <rdar://problem/13521159> · 5160ce5c
      Greg Clayton authored
      LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.
      
      All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.
      
      llvm-svn: 178191
      5160ce5c
  15. Feb 23, 2013
    • Greg Clayton's avatar
      <rdar://problem/13265297> · 72310355
      Greg Clayton authored
      StackFrame assumes m_sc is additive, but m_sc can lose its target. So now the SymbolContext::Clear() method takes a bool that indicates if the target should be cleared. Modified all existing code to properly set the bool argument.
      
      llvm-svn: 175953
      72310355
  16. Jan 25, 2013
    • Greg Clayton's avatar
      <rdar://problem/13069948> · c7bece56
      Greg Clayton authored
      Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary.
      
      So I defined a new "lldb::offset_t" which should be used for all file offsets.
      
      After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed.
      
      Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections.
      
      llvm-svn: 173463
      c7bece56
  17. Nov 29, 2012
  18. Aug 29, 2012
    • Greg Clayton's avatar
      <rdar://problem/11757916> · 1f746071
      Greg Clayton authored
      Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
      - Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file". 
      - modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
      - Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
      - modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()
      
      Cleaned up header includes a bit as well.
      
      llvm-svn: 162860
      1f746071
  19. Jul 14, 2012
  20. May 10, 2012
    • Greg Clayton's avatar
      <rdar://problem/11330621> · ba812f42
      Greg Clayton authored
      Fixed the DisassemblerLLVMC disassembler to parse more efficiently instead of parsing opcodes over and over. The InstructionLLVMC class now only reads the opcode in the InstructionLLVMC::Decode function. This can be done very efficiently for ARM and architectures that have fixed opcode sizes. For x64 it still calls the disassembler to get the byte size.
      
      Moved the lldb_private::Instruction::Dump(...) function up into the lldb_private::Instruction class and it now uses the function that gets the mnemonic, operandes and comments so that all disassembly is using the same code.
      
      Added StreamString::FillLastLineToColumn() to allow filling a line up to a column with a character (which is used by the lldb_private::Instruction::Dump(...) function).
      
      Modified the Opcode::GetData() fucntion to "do the right thing" for thumb instructions.
      
      llvm-svn: 156532
      ba812f42
  21. Mar 07, 2012
    • Greg Clayton's avatar
      <rdar://problem/10997402> · e7612134
      Greg Clayton authored
      This fix really needed to happen as a previous fix I had submitted for
      calculating symbol sizes made many symbols appear to have zero size since
      the function that was calculating the symbol size was calling another function
      that would cause the calculation to happen again. This resulted in some symbols
      having zero size when they shouldn't. This could then cause infinite stack
      traces and many other side affects.
      
      llvm-svn: 152244
      e7612134
  22. Mar 02, 2012
  23. Feb 26, 2012
    • Greg Clayton's avatar
      Made a ModuleSpec class in Module.h which can specify a module using one or · b9a01b39
      Greg Clayton authored
      more of the local path, platform path, associated symbol file, UUID, arch,
      object name and object offset. This allows many of the calls that were
      GetSharedModule to reduce the number of arguments that were used in a call
      to these functions. It also allows a module to be created with a ModuleSpec
      which allows many things to be specified prior to any accessors being called
      on the Module class itself. 
      
      I was running into problems when adding support for "target symbol add"
      where you can specify a stand alone debug info file after debugging has started
      where I needed to specify the associated symbol file path and if I waited until
      after construction, the wrong  symbol file had already been located. By using
      the ModuleSpec it allows us to construct a module with as little or as much
      information as needed and not have to change the parameter list.
      
      llvm-svn: 151476
      b9a01b39
  24. Feb 06, 2012
    • Greg Clayton's avatar
      Removed all of the "#ifndef SWIG" from the SB header files since we are using · 5569e64e
      Greg Clayton authored
      interface (.i) files for each class.
      
      Changed the FindFunction class from:
      
      uint32_t
      SBTarget::FindFunctions (const char *name, 
                               uint32_t name_type_mask, 
                               bool append, 
                               lldb::SBSymbolContextList& sc_list)
      
      uint32_t
      SBModule::FindFunctions (const char *name, 
                               uint32_t name_type_mask, 
                               bool append, 
                               lldb::SBSymbolContextList& sc_list)
      
      To:
      
      lldb::SBSymbolContextList
      SBTarget::FindFunctions (const char *name, 
                               uint32_t name_type_mask = lldb::eFunctionNameTypeAny);
      
      lldb::SBSymbolContextList
      SBModule::FindFunctions (const char *name,
                               uint32_t name_type_mask = lldb::eFunctionNameTypeAny);
      
      This makes the API easier to use from python. Also added the ability to
      append a SBSymbolContext or a SBSymbolContextList to a SBSymbolContextList.
      
      Exposed properties for lldb.SBSymbolContextList in python:
      
      lldb.SBSymbolContextList.modules => list() or all lldb.SBModule objects in the list
      lldb.SBSymbolContextList.compile_units => list() or all lldb.SBCompileUnits objects in the list
      lldb.SBSymbolContextList.functions => list() or all lldb.SBFunction objects in the list
      lldb.SBSymbolContextList.blocks => list() or all lldb.SBBlock objects in the list
      lldb.SBSymbolContextList.line_entries => list() or all lldb.SBLineEntry objects in the list
      lldb.SBSymbolContextList.symbols => list() or all lldb.SBSymbol objects in the list
      
      This allows a call to the SBTarget::FindFunctions(...) and SBModule::FindFunctions(...)
      and then the result can be used to extract the desired information:
      
      sc_list = lldb.target.FindFunctions("erase")
      
      for function in sc_list.functions:
          print function
      for symbol in sc_list.symbols:
          print symbol
      
      Exposed properties for the lldb.SBSymbolContext objects in python:
      
      lldb.SBSymbolContext.module => lldb.SBModule
      lldb.SBSymbolContext.compile_unit => lldb.SBCompileUnit
      lldb.SBSymbolContext.function => lldb.SBFunction
      lldb.SBSymbolContext.block => lldb.SBBlock
      lldb.SBSymbolContext.line_entry => lldb.SBLineEntry
      lldb.SBSymbolContext.symbol => lldb.SBSymbol
      
      
      Exposed properties for the lldb.SBBlock objects in python:
      
      lldb.SBBlock.parent => lldb.SBBlock for the parent block that contains
      lldb.SBBlock.sibling => lldb.SBBlock for the sibling block to the current block
      lldb.SBBlock.first_child => lldb.SBBlock for the first child block to the current block
      lldb.SBBlock.call_site => for inline functions, return a lldb.declaration object that gives the call site file, line and column
      lldb.SBBlock.name => for inline functions this is the name of the inline function that this block represents
      lldb.SBBlock.inlined_block => returns the inlined function block that contains this block (might return itself if the current block is an inlined block)
      lldb.SBBlock.range[int] => access the address ranges for a block by index, a list() with start and end address is returned
      lldb.SBBlock.ranges => an array or all address ranges for this block
      lldb.SBBlock.num_ranges => the number of address ranges for this blcok
      
      SBFunction objects can now get the SBType and the SBBlock that represents the
      top scope of the function.
      
      SBBlock objects can now get the variable list from the current block. The value
      list returned allows varaibles to be viewed prior with no process if code
      wants to check the variables in a function. There are two ways to get a variable
      list from a SBBlock:
      
      lldb::SBValueList
      SBBlock::GetVariables (lldb::SBFrame& frame,
                             bool arguments,
                             bool locals,
                             bool statics,
                             lldb::DynamicValueType use_dynamic);
      
      lldb::SBValueList
      SBBlock::GetVariables (lldb::SBTarget& target,
                             bool arguments,
                             bool locals,
                             bool statics);
      
      When a SBFrame is used, the values returned will be locked down to the frame
      and the values will be evaluated in the context of that frame.
      
      When a SBTarget is used, global an static variables can be viewed without a
      running process.
      
      llvm-svn: 149853
      5569e64e
  25. Jan 05, 2012
    • Greg Clayton's avatar
      Added code in the Host layer that can report system log messages · e38a5edd
      Greg Clayton authored
      so that we don't have "fprintf (stderr, ...)" calls sprinkled everywhere.
      Changed all needed locations over to using this.
      
      For non-darwin, we log to stderr only. On darwin, we log to stderr _and_
      to ASL (Apple System Log facility). This will allow GUI apps to have a place
      for these error and warning messages to go, and also allows the command line
      apps to log directly to the terminal.
      
      llvm-svn: 147596
      e38a5edd
  26. Oct 19, 2011
    • Greg Clayton's avatar
      Moved lldb::user_id_t values to be 64 bit. This was going to be needed for · 81c22f61
      Greg Clayton authored
      process IDs, and thread IDs, but was mainly needed for for the UserID's for
      Types so that DWARF with debug map can work flawlessly. With DWARF in .o files
      the type ID was the DIE offset in the DWARF for the .o file which is not
      unique across all .o files, so now the SymbolFileDWARFDebugMap class will
      make the .o file index part (the high 32 bits) of the unique type identifier
      so it can uniquely identify the types.
      
      llvm-svn: 142534
      81c22f61
  27. Oct 14, 2011
    • Sean Callanan's avatar
      Cleaned up a few functions that never get used. · c6bba3e4
      Sean Callanan authored
      Specifically, the expression parser used to use
      functions attached to SymbolContext to do lookups,
      but nowadays it searches a ModuleList or Module
      directly instead.  These functions had no
      remaining clients so I removed them to prevent
      bit rot.
      
      I also removed a stray callback function from
      ClangExpressionDeclMap.
      
      llvm-svn: 141899
      c6bba3e4
  28. Oct 13, 2011
  29. Oct 12, 2011
  30. Oct 08, 2011
  31. Oct 07, 2011
  32. Oct 05, 2011
  33. Oct 01, 2011
    • Greg Clayton's avatar
      Cleaned up the the code that figures out the inlined stack frames given a · 1ed54f50
      Greg Clayton authored
      symbol context that represents an inlined function. This function has been
      renamed internally to:
      
      bool
      SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, 
                                              SymbolContext &next_frame_sc, 
                                              Address &next_frame_pc) const;
                                              
      And externally to:
      
      SBSymbolContext
      SBSymbolContext::GetParentOfInlinedScope (const SBAddress &curr_frame_pc, 
                                                SBAddress &parent_frame_addr) const;
      
      The correct blocks are now correctly calculated.
      
      Switched the stack backtracing engine (in StackFrameList) and the address
      context printing over to using the internal SymbolContext::GetParentOfInlinedScope(...) 
      so all inlined callstacks will match exactly.
      
      llvm-svn: 140910
      1ed54f50
  34. Sep 29, 2011
  35. Sep 28, 2011
  36. Sep 27, 2011
Loading