summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix build break due to signature change on ASTContext' setExternalSource ↵Todd Fiala2014-02-272-2/+2
| | | | | | | | | parameter. This change converts points to clang::ExternalASTSource from llvm::OwningPtr<> to llvm::IntrusiveRefCntPtr<>. llvm-svn: 202411
* LLDB now handles DW_TAG_unspecified_parameters nested inside function ↵Greg Clayton2014-02-242-0/+7
| | | | | | | | prototypes and we now mark the function prototypes as being variadic. <rdar://problem/16149526> llvm-svn: 202061
* Fix a bug where we will crash if we have a class "B" that is contained ↵Greg Clayton2014-02-071-0/+5
| | | | | | | | | inside a class "A" in the DWARF where "A" is a forward declaration. <rdar://problem/14673945> <rdar://problem/15682781> llvm-svn: 200985
* Fix gcc warnings about casting away constnessSteve Pucci2014-01-171-1/+1
| | | | llvm-svn: 199506
* LLDB can crash if given DWARF debug info for a class that has a base class ↵Greg Clayton2013-12-121-0/+31
| | | | | | | | | | which isn't a complete definition. <rdar://problem/15594781> We need to not crash at any cost. We currently detect if any base classes are forward declarations, emit an error string that directs the use to file a compiler bug, and continues by completing the class with no contents. This avoids a clang crash that would usually follow when we call setBase(). llvm-svn: 197108
* Fixed parsing the DW_TAG_member children for structs, unions and classes to ↵Greg Clayton2013-12-111-37/+47
| | | | | | | | not alway treat every member as a bitfield. The previous fix for bitfields made us always search for anonymous bitfields regardless of the member (bitfield or normal field). llvm-svn: 197088
* Ensure parsed debug arange data is sortedEd Maste2013-12-021-0/+1
| | | | | | llvm.org/pr18114 llvm-svn: 196146
* Migrate DWARFDebugLine to DWARFDataExtractor 64-bit DWARF supportEd Maste2013-10-313-27/+9
| | | | llvm-svn: 193794
* Remove unused DWARFDebugLine length functionsEd Maste2013-10-311-4/+0
| | | | llvm-svn: 193792
* Update DWARFDebugPubnamesSet 64-bit DWARF to use new DWARFDataExtractorEd Maste2013-10-251-15/+4
| | | | llvm-svn: 193407
* Introduce DWARFDataExtractor for 64-Bit DWARF parsingEd Maste2013-10-2438-169/+230
| | | | | Review: http://llvm-reviews.chandlerc.com/D2007 llvm-svn: 193368
* 64-Bit DWARF support for .debug_aranges and .debug_pubnamesEd Maste2013-10-232-4/+26
| | | | llvm-svn: 193250
* Initial DWARF64 support for .debug_lineEd Maste2013-10-232-7/+31
| | | | | | | | | | | Some versions of the GNU MIPS toolchain generate 64-Bit DWARF (even though it isn't really necessary). This change adds support for the 64-Bit DWARF format, but is not actually tested with >4GB of debug data. Similar changes are in progress for llvm's version of DWARFDebugLine, in review D1988. llvm-svn: 193242
* Added support for reading thread-local storage variables, as defined using ↵Richard Mitton2013-10-172-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the __thread modifier. To make this work this patch extends LLDB to: - Explicitly track the link_map address for each module. This is effectively the module handle, not sure why it wasn't already being stored off anywhere. As an extension later, it would be nice if someone were to add support for printing this as part of the modules list. - Allow reading the per-thread data pointer via ptrace. I have added support for Linux here. I'll be happy to add support for FreeBSD once this is reviewed. OS X does not appear to have __thread variables, so maybe we don't need it there. Windows support should eventually be workable along the same lines. - Make DWARF expressions track which module they originated from. - Add support for the DW_OP_GNU_push_tls_address DWARF opcode, as generated by gcc and recent versions of clang. Earlier versions of clang (such as 3.2, which is default on Ubuntu right now) do not generate TLS debug info correctly so can not be supported here. - Understand the format of the pthread DTV block. This is where it gets tricky. We have three basic options here: 1) Call "dlinfo" or "__tls_get_addr" on the inferior and ask it directly. However this won't work on core dumps, and generally speaking it's not a good idea for the debugger to call functions itself, as it has the potential to not work depending on the state of the target. 2) Use libthread_db. This is what GDB does. However this option requires having a version of libthread_db on the host cross-compiled for each potential target. This places a large burden on the user, and would make it very hard to cross-debug from Windows to Linux, for example. Trying to build a library intended exclusively for one OS on a different one is not pleasant. GDB sidesteps the problem and asks the user to figure it out. 3) Parse the DTV structure ourselves. On initial inspection this seems to be a bad option, as the DTV structure (the format used by the runtime to manage TLS data) is not in fact a kernel data structure, it is implemented entirely in useerland in libc. Therefore the layout of it's fields are version and OS dependent, and are not standardized. However, it turns out not to be such a problem. All OSes use basically the same algorithm (a per-module lookup table) as detailed in Ulrich Drepper's TLS ELF ABI document, so we can easily write code to decode it ourselves. The only question therefore is the exact field layouts required. Happily, the implementors of libpthread expose the structure of the DTV via metadata exported as symbols from the .so itself, designed exactly for this kind of thing. So this patch simply reads that metadata in, and re-implements libthread_db's algorithm itself. We thereby get cross-platform TLS lookup without either requiring third-party libraries, while still being independent of the version of libpthread being used. Test case included. llvm-svn: 192922
* Fix building with ENABLE_DEBUG_PRINTFEd Maste2013-10-171-5/+4
| | | | | | | Clang tells me that "token pasting of ',' and __VA_ARGS__ is a GNU extension". Also catch up with changes in function args. llvm-svn: 192920
* Whitespace: replace 4-space-tabs with spacesEd Maste2013-10-171-11/+11
| | | | llvm-svn: 192918
* Correct log message typo: ended ad -> ended atEd Maste2013-10-171-2/+2
| | | | llvm-svn: 192897
* Remove unused DWARFCompileUnit::Extract variantEd Maste2013-10-172-25/+0
| | | | llvm-svn: 192893
* Made all other "operator bool"s explicit and ensuredSean Callanan2013-10-042-3/+3
| | | | | | | | | | that all clients use them explicitly. This will hopefully prevent any future confusion where things get cast to types we don't expect. <rdar://problem/15146458> llvm-svn: 191984
* Changed the bool conversion operator on ConstStringSean Callanan2013-10-032-2/+2
| | | | | | | | | | | | | | | to be explicit, to prevent horrid things like std::string a = ConstString("foo") from taking the path ConstString -> bool -> char -> std::string. This fixes, among other things, ClangFunction. <rdar://problem/15137989> llvm-svn: 191934
* Convert ClangASTType::GetTypeName over to return a ConstString to be ↵Jim Ingham2013-09-271-5/+4
| | | | | | | | consistent with the other "Get*TypeName" functions. llvm-svn: 191556
* Convert to UNIX line endings.Joerg Sonnenberger2013-09-253-35/+35
| | | | llvm-svn: 191367
* Made SymbolFileDWARF not crash if a function doesn'tSean Callanan2013-09-181-10/+18
| | | | | | have a type. It does warn, though. llvm-svn: 190968
* Visual Studio 2013 compilation support: added some #ifdef _MSC_VER for ↵Virgile Bello2013-09-181-2/+2
| | | | | | unsupported code in MSVC. llvm-svn: 190924
* <rdar://problem/15001220>Greg Clayton2013-09-161-2/+7
| | | | | | | | | | Fixed an issue with the lldb/test/lang/cpp/virtual test case had a virtual class that had a DW_TAG_inheritance child that was virtual and had a DW_AT_data_member_location of: DW_AT_data_member_location( DW_OP_dup, DW_OP_deref, DW_OP_constu(0x00000018), DW_OP_minus, DW_OP_deref, DW_OP_plus ) We failed to evaluate this and then we were passing the incorrect offset back to clang and clang would crash. The AST external source has a function named LayoutRecordType which allows us to supply the virtual base class offsets, but that really doesn't make sense to do as clang will lay them out correctly. So we must ignore virtual base classes when doing layout. llvm-svn: 190811
* <rdar://problem/14944683>Greg Clayton2013-09-121-2/+2
| | | | | | LLDB now handles explicit alignment for inherited classes. llvm-svn: 190616
* Fixed parsing of the .debug_aranges section so that LLDB will still work ↵Richard Mitton2013-09-092-14/+32
| | | | | | correctly even if arange data is not available for every object file in the program. llvm-svn: 190365
* Apply Linux C++ global/anonymous function call workound to FreeBSD as wellEd Maste2013-09-091-2/+3
| | | | | | The workaround was introduced in SVN r181613, for http://llvm.org/pr15854 llvm-svn: 190319
* Fix a bunch of compile time warnings and a build failure on ubuntu.Eric Christopher2013-08-302-5/+5
| | | | llvm-svn: 189683
* Cleanup/rearrange includes:Virgile Bello2013-08-281-1/+0
| | | | | | | - factorize unistd.h and stdbool.h in lldb-types.h. - Add <functional> and <string> where required. llvm-svn: 189477
* Fixed a case where GCC was emitting a DW_TAG_class_type that has a ↵Greg Clayton2013-08-101-0/+24
| | | | | | DW_AT_declaration set to true, yet the class actually contains a definition for the class in that DIE. llvm-svn: 188124
* Updates the DW_AT_data_member_location handlers for the LLDB DWARF pluginAshok Thirumurthi2013-07-301-3/+22
| | | | | | | | | to handle the case of an integer constant (DWARF 3 and later). - Fixes tests that assert in RecordLayoutBuilder::updateExternalFieldOffset because LLDB was providing an external AST source with missing member offsets. llvm-svn: 187423
* Add explicit braces to quiet the "avoid dangling else" warning from clang.Greg Clayton2013-07-251-0/+2
| | | | llvm-svn: 187137
* Fixes LLDB address ranges with gcc 4.8Ashok Thirumurthi2013-07-252-10/+91
| | | | | | - Modifies the DWARF parser for DWARF 4 specification of hi_pc as an offset-from-low-pc. llvm-svn: 187125
* Fix issues with GCC debugging. GCC emits DWARF in unique ways that LLDB ↵Greg Clayton2013-07-152-0/+18
| | | | | | | | | | | wasn't handling. This fix will fix cases where classes are forward declared using DW_TAG_structure_type and then actually defined using DW_TAG_class_type. LLDB, when it finds a forward declaration, would try and find and parse the complete type. It does this by: 1 - looking up the type basename in the type index 2 - iterate through all matches and look for decl contexts (namespace/class hierarchy) that match The issue was the decl context matching wasn't watching for DW_TAG_class_type/DW_TAG_structure_type mismatches, and it wasn't also getting the name for DIE's that didn't have a DW_AT_name, but did have a DW_AT_specification that had a name. llvm-svn: 186347
* Fix the linux gcc 4.6.3 buildbot failures that happened after my recent ↵Greg Clayton2013-07-121-1/+3
| | | | | | types checkin. llvm-svn: 186195
* Huge change to clean up types.Greg Clayton2013-07-116-197/+165
| | | | | | | | A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error. This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness. llvm-svn: 186130
* Cleanup on the unified section list changes. Main changes are:Greg Clayton2013-07-103-43/+49
| | | | | | | | | | | | | | | - ObjectFile::GetSymtab() and ObjectFile::ClearSymtab() no longer takes any flags - Module coordinates with the object files and contain a unified section list so that object file and symbol file can share sections when they need to, yet contain their own sections. Other cleanups: - Fixed Symbol::GetByteSize() to not have the symbol table compute the byte sizes on the fly - Modified the ObjectFileMachO class to compute symbol sizes all at once efficiently - Modified the Symtab class to store a file address lookup table for more efficient lookups - Removed Section::Finalize() and SectionList::Finalize() as they did nothing - Improved performance of the detection of symbol files that have debug maps by excluding stripped files and core files, debug files, object files and stubs - Added the ability to tell if an ObjectFile has been stripped with ObjectFile::IsStripped() (used this for the above performance improvement) llvm-svn: 185990
* Workaround for infinite recursion in InitOSO->GetByteSize->GetSymbolVendor.Jim Ingham2013-07-031-1/+7
| | | | llvm-svn: 185491
* Recognize "decltype(nullptr)" as a valid DW_AT_name for ↵Greg Clayton2013-07-011-1/+2
| | | | | | DW_TAG_unspecified_type tags as meaning the C++11 null pointer type. llvm-svn: 185382
* Split symbol support for ELF and Linux.Michael Sartain2013-07-013-16/+17
| | | | llvm-svn: 185366
* Adding support for extracting line table information from .o files that do ↵Enrico Granata2013-06-273-10/+52
| | | | | | not have aranges llvm-svn: 185055
* Unique types a bit more using the clang type to make sure we don't get ↵Greg Clayton2013-06-201-2/+8
| | | | | | multiple copies of the same type due to the debug info having multiple types that get uniqued. llvm-svn: 184388
* Added the ability to get a list of types from a SBModule or SBCompileUnit. ↵Greg Clayton2013-06-189-6/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sebastien Metrot wanted this, and sent a hollowed out patch. I filled in the blanks and did the low level implementation. The new functions are: //------------------------------------------------------------------ /// Get all types matching \a type_mask from debug info in this /// module. /// /// @param[in] type_mask /// A bitfield that consists of one or more bits logically OR'ed /// together from the lldb::TypeClass enumeration. This allows /// you to request only structure types, or only class, struct /// and union types. Passing in lldb::eTypeClassAny will return /// all types found in the debug information for this module. /// /// @return /// A list of types in this module that match \a type_mask //------------------------------------------------------------------ lldb::SBTypeList SBModule::GetTypes (uint32_t type_mask) //------------------------------------------------------------------ /// Get all types matching \a type_mask from debug info in this /// compile unit. /// /// @param[in] type_mask /// A bitfield that consists of one or more bits logically OR'ed /// together from the lldb::TypeClass enumeration. This allows /// you to request only structure types, or only class, struct /// and union types. Passing in lldb::eTypeClassAny will return /// all types found in the debug information for this compile /// unit. /// /// @return /// A list of types in this compile unit that match \a type_mask //------------------------------------------------------------------ lldb::SBTypeList SBCompileUnit::GetTypes (uint32_t type_mask = lldb::eTypeClassAny); This lets you request types by filling out a mask that contains one or more bits from the lldb::TypeClass enumerations, so you can only get the types you really want. llvm-svn: 184251
* <rdar://problem/13455021>Greg Clayton2013-05-221-0/+2
| | | | | | Another fix to make sure that if we aren't able to extract an object file for any reason, we don't crash when trying to parse the debug map info. llvm-svn: 182441
* <rdar://problem/13893094>Greg Clayton2013-05-171-137/+134
| | | | | | Show variables that were in the debug info but optimized out. Also display a good error message when one of these variables get used in an expression. llvm-svn: 182066
* strncmp was checked incorrectly in the Linux symbol lookup fix.Matt Kopec2013-05-141-2/+2
| | | | llvm-svn: 181818
* Use mangled and demangled names when checking for a function in a namespace ↵Matt Kopec2013-05-101-3/+4
| | | | | | and a function in an anonymous namespace, respectively. llvm-svn: 181645
* <rdar://problem/13854277>Greg Clayton2013-05-108-68/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <rdar://problem/13594769> Main changes in this patch include: - cleanup plug-in interface and use ConstStrings for plug-in names - Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp - Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging The plug-in interface changes: Modified the lldb_private::PluginInterface class that all plug-ins inherit from: Changed: virtual const char * GetPluginName() = 0; To: virtual ConstString GetPluginName() = 0; Removed: virtual const char * GetShortPluginName() = 0; - Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names. - Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc. llvm-svn: 181631
* Add temporary fix for calling c++ global/anonymous functions on Linux.Matt Kopec2013-05-101-0/+30
| | | | llvm-svn: 181613
OpenPOWER on IntegriCloud