Skip to content
  1. Nov 08, 2010
  2. Nov 07, 2010
    • Greg Clayton's avatar
      Modified the DWARF parser for both the single DWARF file and for the case · 2ccf8cfc
      Greg Clayton authored
      where the DWARF is in the .o files so they can track down the actual type for
      a forward declaration. This was working before for just DWARF files, but not
      for DWARF in .o files where the actual definition was in another .o file.
      
      Modified the main thread name in the driver to be more consistent with the
      other LLDB thread names.
      
      llvm-svn: 118383
      2ccf8cfc
  3. Nov 01, 2010
  4. Oct 30, 2010
  5. Oct 29, 2010
  6. Oct 28, 2010
  7. Oct 27, 2010
    • Greg Clayton's avatar
      Updated the lldb_private::Flags class to have better method names and made · 73b472d4
      Greg Clayton authored
      all of the calls inlined in the header file for better performance.
      
      Fixed the summary for C string types (array of chars (with any combo if
      modifiers), and pointers to chars) work in all cases.
      
      Fixed an issue where a forward declaration to a clang type could cause itself
      to resolve itself more than once if, during the resolving of the type itself
      it caused something to try and resolve itself again. We now remove the clang
      type from the forward declaration map in the DWARF parser when we start to 
      resolve it and avoid this additional call. This should stop any duplicate
      members from appearing and throwing all the alignment of structs, unions and
      classes.
      
      llvm-svn: 117437
      73b472d4
  8. Oct 20, 2010
    • Greg Clayton's avatar
      Fixed an issue where we were resolving paths when we should have been. · 274060b6
      Greg Clayton authored
      So the issue here was that we have lldb_private::FileSpec that by default was 
      always resolving a path when using the:
      
      FileSpec::FileSpec (const char *path);
      
      and in the:
      
      void FileSpec::SetFile(const char *pathname, bool resolve = true);
      
      This isn't what we want in many many cases. One example is you have "/tmp" on
      your file system which is really "/private/tmp". You compile code in that
      directory and end up with debug info that mentions "/tmp/file.c". Then you 
      type:
      
      (lldb) breakpoint set --file file.c --line 5
      
      If your current working directory is "/tmp", then "file.c" would be turned 
      into "/private/tmp/file.c" which won't match anything in the debug info.
      Also, it should have been just a FileSpec with no directory and a filename
      of "file.c" which could (and should) potentially match any instances of "file.c"
      in the debug info.
      
      So I removed the constructor that just takes a path:
      
      FileSpec::FileSpec (const char *path); // REMOVED
      
      You must now use the other constructor that has a "bool resolve" parameter that you must always supply:
      
      FileSpec::FileSpec (const char *path, bool resolve);
      
      I also removed the default parameter to SetFile():
      
      void FileSpec::SetFile(const char *pathname, bool resolve);
      
      And fixed all of the code to use the right settings.
      
      llvm-svn: 116944
      274060b6
  9. Oct 15, 2010
    • Greg Clayton's avatar
      Did a bit of parameter renaming. · 9476d957
      Greg Clayton authored
      llvm-svn: 116562
      9476d957
    • Greg Clayton's avatar
      Separated the DWARF index for types from that the index of the namespaces · 69b0488d
      Greg Clayton authored
      since we can't parse DW_TAG_namespace DIEs as types. They are only decls in
      clang. All of the types we handle right now have both clang "XXXType" classes
      to go with the "XXXDecl" classes which means they can be used within the 
      lldb_private::Type class. I need to check to see which other decls that don't
      have associated type objects need to float around the debugger and possibly
      make a lldb_private::Decl class to manage them.
      
      llvm-svn: 116558
      69b0488d
  10. Oct 13, 2010
    • Greg Clayton's avatar
      Fixed C++ class clang type creation and display by making sure we omit · 24739923
      Greg Clayton authored
      artifical members (like the vtable pointer member that shows up in the DWARF).
      We were adding this to each class which was making all member variables be off
      by a pointer size.
      
      Added a test case so we can track this with "test/forward".
      
      Fixed the type name index in DWARF to include all the types after finding
      some types were being omitted due to the DW_AT_specification having the
      DW_AT_declaration attribute which was being read into the real type instances
      when there were forward declarations in the DWARF, causing the type to be
      omitted. We now check to make sure any DW_AT_declaration values are only
      respected when parsing types if the attribute is from the current DIE.
      
      After fixing the missing types, we ran into some issues with the expression
      parser finding duplicate entries for __va_list_tag since they are built in
      types and would result in a "duplicate __va_list_tag definition" error. We
      are now just ignoring this name during lookup, but we will need to see if
      we can get the name lookup function to not get called in these cases.
      
      Fixed an issue that would cause an assertion where DW_TAG_subroutine_types
      that had no children, would not properly make a clang function type of:
      "void (*) (void)".
      
      llvm-svn: 116392
      24739923
  11. Oct 12, 2010
  12. Oct 01, 2010
  13. Sep 30, 2010
    • Greg Clayton's avatar
      Cleaned up a unused member variable in Debugger. · 4957bf69
      Greg Clayton authored
      Added the start of Host specific launch services, though it currently isn't
      hookup up to anything. We want to be able to launch a process and use the
      native launch services to launch an app like it would be launched by the
      user double clicking on the app. We also eventually want to be able to run
      a command line app in a newly spawned terminal to avoid terminal sharing.
      
      Fixed an issue with the new DWARF forward type declaration stuff. A crasher
      was found that was happening when trying to properly expand the forward
      declarations.
      
      llvm-svn: 115213
      4957bf69
  14. Sep 29, 2010
    • Greg Clayton's avatar
      Fixed an LLVM/Clang assertion that would happen for C++ and ObjC methods if... · 6d01ad92
      Greg Clayton authored
      Fixed an LLVM/Clang assertion that would happen for C++ and ObjC methods if the DWARF doesn't specify the accessibility for the method. Currently gcc 4.2 and clang++ do not set the accessibility correctly on methods. We currently shouldn't default to private since public methods don't have the accessibility specified. 
      
      Bottom line: we currently default to public for both C++ and ObjC if the accessibility isn't set.
      
      llvm-svn: 115016
      6d01ad92
    • Greg Clayton's avatar
      Fixed the forward declaration issue that was present in the DWARF parser after · 1be10fca
      Greg Clayton authored
      adding methods to C++ and objective C classes. In order to make methods, we
      need the function prototype which means we need the arguments. Parsing these
      could cause a circular reference that caused an  assertion.
      
      Added a new typedef for the clang opaque types which are just void pointers:
      lldb::clang_type_t. This appears in lldb-types.h.
      
      This was fixed by enabling struct, union, class, and enum types to only get
      a forward declaration when we make the clang opaque qual type for these
      types. When they need to actually be resolved, lldb_private::Type will call
      a new function in the SymbolFile protocol to resolve a clang type when it is
      not fully defined (clang::TagDecl::getDefinition() returns NULL). This allows
      us to be a lot more lazy when parsing clang types and keeps down the amount
      of data that gets parsed into the ASTContext for each module. 
      
      Getting the clang type from a "lldb_private::Type" object now takes a boolean
      that indicates if a forward declaration is ok:
      
          clang_type_t lldb_private::Type::GetClangType (bool forward_decl_is_ok);
          
      So function prototypes that define parameters that are "const T&" can now just
      parse the forward declaration for type 'T' and we avoid circular references in
      the type system.
      
      llvm-svn: 115012
      1be10fca
  15. Sep 28, 2010
  16. Sep 27, 2010
  17. Sep 24, 2010
    • Greg Clayton's avatar
      Added the ability to create an objective C method for an objective C · 0fffff58
      Greg Clayton authored
      interface in ClangASTContext. Also added two bool returning functions that
      indicated if an opaque clang qual type is a CXX class type, and if it is an
      ObjC class type.
      
      Objective C classes now will get their methods added lazily as they are
      encountered. The reason for this is currently, unlike C++, the 
      DW_TAG_structure_type and owns the ivars, doesn't not also contain the
      member functions. This means when we parse the objective C class interface
      we either need to find all functions whose names start with "+[CLASS_NAME"
      or "-[CLASS_NAME" and add them all to the class, or when we parse each objective
      C function, we slowly add it to the class interface definition. Since objective
      C's class doesn't change internal bits according to whether it has certain types
      of member functions (like C++ does if it has virtual functions, or if it has
      user ctors/dtors), I currently chose to lazily populate the class when each
      functions is parsed. Another issue we run into with ObjC method declarations
      is the "self" and "_cmd" implicit args are not marked as artificial in the
      DWARF (DW_AT_artifical), so we currently have to look for the parameters by
      name if we are trying to omit artificial function args if the language of the
      compile unit is ObjC or ObjC++.
      
      llvm-svn: 114722
      0fffff58
  18. Sep 23, 2010
  19. Sep 18, 2010
    • Greg Clayton's avatar
      General command line help cleanup: · ed8a705c
      Greg Clayton authored
      - All single character options will now be printed together
      - Changed all options that contains underscores to contain '-' instead
      - Made the help come out a little flatter by showing the long and short
        option on the same line.
      - Modified the short character for "--ignore-count" options to "-i"
      
      llvm-svn: 114265
      ed8a705c
  20. Sep 16, 2010
  21. Sep 15, 2010
    • Greg Clayton's avatar
      15-20% speed improvement when parsing DWARF. I used instruments to · d88d759a
      Greg Clayton authored
      find the hotspots in our code when indexing the DWARF. A combination of
      using SmallVector to avoid collection allocations, using fixed form
      sizes when possible, and optimizing the hot loops contributed to the
      speedup.
      
      llvm-svn: 113961
      d88d759a
    • Greg Clayton's avatar
      Fixed a missing newline when dumping mixed disassembly. · 6dbd3983
      Greg Clayton authored
      Added a "bool show_fullpaths" to many more objects that were
      previously always dumping full paths.
      
      Fixed a few places where the DWARF was not indexed when we
      we needed it to be when making queries. Also fixed an issue
      where the DWARF in .o files wasn't searching all .o files
      for the types.
      
      Fixed an issue with the output from "image lookup --type <TYPENAME>"
      where the name and byte size might not be resolved and might not
      display. We now call the accessors so we end up seeing all of the
      type info.
      
      llvm-svn: 113951
      6dbd3983
    • Greg Clayton's avatar
      So we can't use .debug_pubtypes as it, as designed, does not tell us about · c685f8e5
      Greg Clayton authored
      all types in all compile units. I added a new kind of accelerator table to
      the DWARF that allows us to index the DWARF compile units and DIEs in a way
      that doesn't require the data to stay loaded. Currently when indexing the
      DWARF we check if the compile unit had parsed its DIEs and if it hasn't we
      index the data and free all of the DIEs so we can reparse later when we need
      to after using one of our complete accelerator tables to determine we need
      to reparse some DWARF. If the DIEs had already been parsed we leave them 
      loaded. The new accelerator table uses the "const char *" pointers from our
      ConstString class as the keys, and NameToDIE::Info as the value. This info
      contains the compile unit index and the DIE index which means we are pointed
      right to the DIE we need unlike the other DWARF accelerator tables that often
      just point us to the compile unit we would find our answer in. 
      
      llvm-svn: 113933
      c685f8e5
  22. Sep 14, 2010
    • Greg Clayton's avatar
      Looking at some of the test suite failures in DWARF in .o files with the · 016a95eb
      Greg Clayton authored
      debug map showed that the location lists in the .o files needed some 
      refactoring in order to work. The case that was failing was where a function
      that was in the "__TEXT.__textcoal_nt" in the .o file, and in the 
      "__TEXT.__text" section in the main executable. This made symbol lookup fail
      due to the way we were finding a real address in the debug map which was
      by finding the section that the function was in in the .o file and trying to
      find this in the main executable. Now the section list supports finding a
      linked address in a section or any child sections. After fixing this, we ran
      into issue that were due to DWARF and how it represents locations lists. 
      DWARF makes a list of address ranges and expressions that go along with those
      address ranges. The location addresses are expressed in terms of a compile
      unit address + offset. This works fine as long as nothing moves around. When
      stuff moves around and offsets change between the remapped compile unit base
      address and the new function address, then we can run into trouble. To deal
      with this, we now store supply a location list slide amount to any location
      list expressions that will allow us to make the location list addresses into
      zero based offsets from the object that owns the location list (always a
      function in our case). 
      
      With these fixes we can now re-link random address ranges inside the debugger
      for use with our DWARF + debug map, incremental linking, and more.
      
      Another issue that arose when doing the DWARF in the .o files was that GCC
      4.2 emits a ".debug_aranges" that only mentions functions that are externally
      visible. This makes .debug_aranges useless to us and we now generate a real
      address range lookup table in the DWARF parser at the same time as we index
      the name tables (that are needed because .debug_pubnames is just as useless).
      llvm-gcc doesn't generate a .debug_aranges section, though this could be 
      fixed, we aren't going to rely upon it.
      
      Renamed a bunch of "UINT_MAX" to "UINT32_MAX".
      
      llvm-svn: 113829
      016a95eb
  23. Sep 13, 2010
    • Greg Clayton's avatar
      Added a work in the DWARF parser when we parse an array that ends up having · a134cc1b
      Greg Clayton authored
      no elements so that they at least have 1 element. 
      
      Added the ability to show the declaration location of variables to the 
      "frame variables" with the "--show-declaration" option ("-c" for short).
      
      Changed the "frame variables" command over to use the value object code
      so that we use the same code path as the public API does when accessing and
      displaying variable values.
      
      llvm-svn: 113733
      a134cc1b
    • Greg Clayton's avatar
      Fixed a crash that would happen when using "frame variables" on any struct, · 83ff3898
      Greg Clayton authored
      union, or class that contained an enumeration type. When I was creating
      the clang enumeration decl, I wasn't calling "EnumDecl::setIntegerType (QualType)" 
      which means that if the enum decl was ever asked to figure out it's bit width
      (getTypeInfo()) it would crash. We didn't run into this with enum types that 
      weren't inside classes because the DWARF already told us how big the type was
      and when we printed an enum we would never need to calculate the size, we
      would use the pre-cached byte size we got from the DWARF. When the enum was 
      in a struct/union/class and we tried to layout the struct, the layout code
      would attempt to get the type info and segfault.
      
      llvm-svn: 113729
      83ff3898
  24. Sep 11, 2010
    • Greg Clayton's avatar
      Remove the eSymbolTypeFunction, eSymbolTypeGlobal, and eSymbolTypeStatic. · bcf2cfbd
      Greg Clayton authored
      They will now be represented as:
      eSymbolTypeFunction: eSymbolTypeCode with IsDebug() == true
        eSymbolTypeGlobal: eSymbolTypeData with IsDebug() == true and IsExternal() == true
        eSymbolTypeStatic: eSymbolTypeData with IsDebug() == true and IsExternal() == false
      
      This simplifies the logic when dealing with symbols and allows for symbols
      to be coalesced into a single symbol most of the time.
      
      Enabled the minimal symbol table for mach-o again after working out all the
      kinks. We now get nice concise symbol tables and debugging with DWARF in the
      .o files with a debug map in the binary works well again. There were issues
      where the SymbolFileDWARFDebugMap symbol file parser was using symbol IDs and
      symbol indexes interchangeably. Now that all those issues are resolved 
      debugging is working nicely.
      
      llvm-svn: 113678
      bcf2cfbd
  25. Sep 04, 2010
  26. Aug 21, 2010
    • Greg Clayton's avatar
      Modified the host process monitor callback function Host::StartMonitoringChildProcess · 0b76a2c2
      Greg Clayton authored
      to spawn a thread for each process that is being monitored. Previously
      LLDB would spawn a single thread that would wait for any child process which
      isn't ok to do as a shared library (LLDB.framework on Mac OSX, or lldb.so on
      linux). The old single thread used to call wait4() with a pid of -1 which 
      could cause it to reap child processes that it shouldn't have.
      
      Re-wrote the way Function blocks are handles. Previously I attempted to keep
      all blocks in a single memory allocation (in a std::vector). This made the
      code somewhat efficient, but hard to work with. I got rid of the old BlockList
      class, and went to a straight parent with children relationship. This new 
      approach will allow for partial parsing of the blocks within a function.
      
      llvm-svn: 111706
      0b76a2c2
  27. Aug 20, 2010
  28. Aug 18, 2010
Loading