summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF
Commit message (Collapse)AuthorAgeFilesLines
* DWARF64 FixesTodd Fiala2014-09-1110-65/+145
| | | | | | | | | | | | | | | | 1. DW_FORM_strp and DW_FORM_sec_offset are 64bits for DWARF64 / 32bits for DWARF32 They are different from DW_FORM_addr, whose size is specified in .debug_info 2. Bump DWARF version support form [2,3] to [2,4] in DWARFDebugLine.cpp 3. Fix DWARFDebugLine to support DWARF64 See http://reviews.llvm.org/D5307 for more details. Reviewed by Greg Clayton and Jason Molenda. Change by Tong Shen. llvm-svn: 217607
* Remove the hostname part from compilation directories, if supplied by Matthew Gardiner2014-08-261-0/+40
| | | | | | DWARF2/3 compliant producers. llvm-svn: 216440
* Patch to enable LLDB to extract value bytes from DWARF block forms and ↵Enrico Granata2014-08-111-2/+22
| | | | | | udata/sdata forms. By Greg Clayton llvm-svn: 215379
* Cleanup the iOS simulator code.Greg Clayton2014-07-101-1/+7
| | | | | | | | | | | Fixes include: - Don't say that "<arch>-apple-ios" is compatible with "<arch>-apple-macosx" - Fixed DynamicLoaderMacOSXDYLD so specify an architecture that was converted solely from a cputype and subtype, just specify the file + UUID. - Fixed PlatformiOSSimulator::GetSupportedArchitectureAtIndex() so it returns the correct archs - Fixed SymbolFileDWARFDebugMap to load .o files correctly by just specifying the architecture without the vendor and OS now that "<arch>-apple-ios" is not compatible with "<arch>-apple-macosx" so we can load .o files correctly for DWARF with debug map - Fixed the coded in TargetList::CreateTarget() so it does the right thing with an underspecified triple where just the arch is specified. llvm-svn: 212783
* Fix typos.Bruce Mitchener2014-07-089-15/+15
| | | | llvm-svn: 212553
* Fix typos.Bruce Mitchener2014-07-013-11/+11
| | | | llvm-svn: 212132
* Minumum -> Minimum.Bruce Mitchener2014-07-011-3/+3
| | | | llvm-svn: 212129
* Fix Windows warnings.Todd Fiala2014-05-281-3/+3
| | | | | | | | | | This fixes a number of trivial warnings in the Windows build. This is part of a larger effort to make the Windows build warning-free. See http://reviews.llvm.org/D3914 for more details. Change by Zachary Turner llvm-svn: 209749
* Remove > 1 check against a boolean.Hafiz Abid Qadeer2014-04-151-1/+1
| | | | | | | I saw a complain about this code on the LLVM channel. It looks wrong to me as has_tag is a boolean. I am committing it as obvious. llvm-svn: 206270
* Accept DWARF version 2 and 3 in debug_line tablesEd Maste2014-04-081-2/+2
| | | | | | | Issue reported by Matthew Gardiner. Further work is necessary to synchronize LLDB's DWARF classes with the derivatives now in LLVM. llvm-svn: 205771
* Xcode 5 crashes if lldb stops at breakpoint if long c++ template lists are ↵Greg Clayton2014-04-043-45/+37
| | | | | | | | | | | | | | | present. This fix reduces the stack size of SymbolFileDWARF::ParseType(). It seems that clang is not very good at sharing locations on the stack with local variables in large functions that have many blocks and each variable gets unique locations. The reduction in size was done by: 1 - removing some large locals that were default constructed by not used 2 - Placing some larger local variables into std::unique_ptr<> to make them on the heap 3 - removing local variables there were large and being populated but not being used 4 - reducing the size of some typedefs to llvm::SmallVector<T, N> so that N wasn’t excessively large <rdar://problem/16431645> llvm-svn: 205640
* Don’t crash when we get an invalid .debug_aranges set, just ignore it. ↵Greg Clayton2014-04-041-29/+65
| | | | | | | | Also print out warning messages if LLDB_CONFIGURATION_DEBUG is defined. <rdar://problem/16516343> llvm-svn: 205634
* sweep up -Wformat warnings from gccSaleem Abdulrasool2014-04-044-200/+198
| | | | | | | This is a purely mechanical change explicitly casting any parameters for printf style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux. llvm-svn: 205607
* sanitise sign comparisonsSaleem Abdulrasool2014-04-021-1/+1
| | | | | | | | This is a mechanical change addressing the various sign comparison warnings that are identified by both clang and gcc. This helps cleanup some of the warning spew that occurs during builds. llvm-svn: 205390
* JITed functions can now have debug info and be debugged with debug and ↵Greg Clayton2014-03-241-0/+1
| | | | | | | | | | | | | | | | | | | source info: (lldb) b puts (lldb) expr -g -i0 -- (int)puts("hello") First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression. Main features: - New ObjectFileJIT class that can be easily created for JIT functions - debug info can now be enabled when parsing expressions - source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit - "expr -g --" allows you to single step through your expression function with source code <rdar://problem/16382881> llvm-svn: 204682
* Add support for dumping DW_LNE_set_discriminator line table extended entries.Greg Clayton2014-03-201-1/+7
| | | | llvm-svn: 204369
* cleanup unreferenced functionsSaleem Abdulrasool2014-03-201-50/+0
| | | | | | | | | | | | | This is a mechanical cleanup of unused functions. In the case where the functions are referenced (in comment form), I've simply commented out the functions. A second pass to clean that up is warranted. The functions which are otherwise unused have been removed. Some of these were introduced in the initial commit and not in use prior to that point! NFC llvm-svn: 204310
* Parse DW_AT_ranges for compile units on Darwin when .debug_aranges is not ↵Greg Clayton2014-03-146-15/+77
| | | | | | | | available for the current compile unit. <rdar://problem/16321434> llvm-svn: 203985
* If DWARF debug info and verbose mode is enabled ("log enable dwarf info ↵Greg Clayton2014-03-121-4/+8
| | | | | | verbose"), then dump all DIEs for a compile unit after all DIEs have been parsed for a compile unit. llvm-svn: 203692
* Allow verbose logging in the "dwarf" log channel.Greg Clayton2014-03-121-0/+2
| | | | llvm-svn: 203684
* Remove unused code.Greg Clayton2014-03-072-103/+0
| | | | llvm-svn: 203292
* 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-251-28/+28
| | | | 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
OpenPOWER on IntegriCloud