History log of /external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0b864ee64c72ea578f7351a9d6284ed5d712b9f0 30-Jul-2013 Ashok Thirumurthi <ashok.thirumurthi@intel.com> Updates the DW_AT_data_member_location handlers for the LLDB DWARF plugin
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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@187423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
13a63b92b2c94d587071e9078cab3350b52094b1 12-Jul-2013 Greg Clayton <gclayton@apple.com> Fix the linux gcc 4.6.3 buildbot failures that happened after my recent types checkin.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
52f792329be5db8e38961350589e97e8f2823acd 12-Jul-2013 Greg Clayton <gclayton@apple.com> Huge change to clean up types.

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
7940069905bee0b2e5f0661bf37c9f906ddf8603 10-Jul-2013 Greg Clayton <gclayton@apple.com> Cleanup on the unified section list changes. Main changes are:
- 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)



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
49409a5f463bd7dca9d8c400b9271b1534bcfcfb 01-Jul-2013 Greg Clayton <gclayton@apple.com> Recognize "decltype(nullptr)" as a valid DW_AT_name for DW_TAG_unspecified_type tags as meaning the C++11 null pointer type.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a807ceef5dad2b24e5bae5c5a193ff03aa7ec8d9 01-Jul-2013 Michael Sartain <mikesart@valvesoftware.com> Split symbol support for ELF and Linux.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
bc46e29ae3579c8585c5df4643a018a9db36b7a6 20-Jun-2013 Greg Clayton <gclayton@apple.com> Unique types a bit more using the clang type to make sure we don't get multiple copies of the same type due to the debug info having multiple types that get uniqued.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@184388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a8b56238ce138e70433a0ce0b4218c9257beae38 19-Jun-2013 Greg Clayton <gclayton@apple.com> Added the ability to get a list of types from a SBModule or SBCompileUnit. 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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@184251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
668010966e95642360fd12094b28755e5dda5343 17-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13893094>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
fb1b8e2dc46be9253116727afc61796abc9c4ccf 14-May-2013 Matt Kopec <Matt.Kopec@intel.com> strncmp was checked incorrectly in the Linux symbol lookup fix.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
cfc053eb46e8d1b5709ad9b1d29786d70420c78d 11-May-2013 Matt Kopec <Matt.Kopec@intel.com> Use mangled and demangled names when checking for a function in a namespace and a function in an anonymous namespace, respectively.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
0e191607adcb0ea8ebd06c278be648a7f5c0097f 10-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13854277>
<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.






git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
96641d89f901d4f7a1b601d56facf4149ba0b381 10-May-2013 Matt Kopec <Matt.Kopec@intel.com> Add temporary fix for calling c++ global/anonymous functions on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9d3587012e5077ab416ecb8e688fd6fbcab71bca 10-May-2013 Sean Callanan <scallanan@apple.com> Don't completely drop methods we don't want to put
into a CXXRecordDecl on the ground; rather, put
them into the translation unit as functions.

<rdar://problem/13834404>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181560 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
97a19b21dacd9063bb5475812df7781777262198 29-Apr-2013 Greg Clayton <gclayton@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
764bca576e78c9bbfb01894cc4d96e96830c77f1 24-Apr-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13298695>

Fixed LLDB to be able to correctly parse template parameters that have no name and no type. This can be triggered by the following LLVM/Clang code:

template <typename T, typename = void>
class SmallVectorTemplateCommon : public SmallVectorBase {

The “typename = void” was emitting DWARF with an empty DW_AT_name and no DW_AT_type. We now correctly infer that no DW_AT_type means “void” and that an empty name is ok.

This means you can now call functions on things that inherit from SmallVectorTemplateCommon.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
102b2c2681c9a830afe25bfea35557421905e42c 19-Apr-2013 Greg Clayton <gclayton@apple.com> After discussing with Chris Lattner, we require C++11, so lets get rid of the macros and just use C++11.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
81a96aa6242f7b559770f5dc62316253cb8cb0d4 18-Apr-2013 Greg Clayton <gclayton@apple.com> Since we use C++11, we should switch over to using std::unique_ptr when C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++.

Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
3525576f2cddc2a7b82b2bec3fd885ef6b1b5a52 11-Apr-2013 Greg Clayton <gclayton@apple.com> Static variables inside classes were not being added to the RecordDecl, now they are. This gets us closer to being able to display static variables in classes.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e9b48f056e241bee683fd87c8eeab08b6f73a722 10-Apr-2013 Sean Callanan <scallanan@apple.com> Don't erroneously put FunctionDecls into CXXRecordDecls
if we didn't want to put in a CXXConstructorDecl. This
prevents malformed classes (i.e., classes with regular C
functions as members) from being generated from type
information (and fixes a crash in the test suite).

<rdar://problem/13550765>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f95fc9e09fa0a32de0a3904a1517266df37e8bff 06-Apr-2013 Greg Clayton <gclayton@apple.com> Added support "__attribute__((__vector_size__(B)))" and "__attribute__((ext_vector_type(N)))".

Now we can:
1 - see the return value for functions that return types that use the "ext_vector_size"
2 - dump values that use the vector attributes ("expr $ymm0")
3 - modified the DWARF parser to correctly parse GNU vector types from the DWARF by turning them into clang::Type::ExtVector types instead of just standard arrays



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e3125ac8e16a1ec1697147ce0404fdb6837465c0 04-Apr-2013 Greg Clayton <gclayton@apple.com> More support for version 4 of DWARF.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
296b06d325413723f5aac5988eed977b278a7807 03-Apr-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13506727>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
952e9dc874944fcdbbb224f3ec4fc2c859376f64 28-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13521159>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
017c16aa483e6edabdbbee1bdcd1ce3f8e8a12d1 27-Mar-2013 Greg Clayton <gclayton@apple.com> Don't use a "uintptr_t" for the metadata key, use a "void *". This removes all of the casts that were being used and cleans the code up a bit. Also added the ability to dump the metadata.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
fe6dc6e241c52822710380cec0931351a1d7b2d3 14-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13421412>

Many "byte size" members and variables were using a mixture of uint32_t and size_t. Switching over to using uint64_t everywhere.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
be38b451f26afc304618f4330d936298ed904ea9 08-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13374267>

Fixed error where objective C methods with selectors names starting with ".cxx_" where causing errors for ARC built binaries.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176683 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9c09181404cc35f65d5353231246959135fb7684 08-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13119621>

Make dynamic type detection faster by using the AST metadata to help out and allow us not to complete types when we don't need to.

After running "purge" on a MacOSX system, the Xcode variables view now populates more than 3x faster with this fix.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e2f06c36775360a53013fdbc94c3fd8da5b874f5 07-Mar-2013 Jason Molenda <jmolenda@apple.com> Typeo in warning message.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d8d97f556ab58fae76d5c677d43a2d621bf039be 06-Mar-2013 Greg Clayton <gclayton@apple.com> Fixed enum printing for negative enums. There previously was no testing to validate that enum values were being displayed correctly.

Also added C++11 enum test cases to cover enums as int8_t, int16_t int32_t, int64_t, uint8_t, uint16_t, uint32_t, and uint64_t both for DWARF and dSYM cases. The DWARF being emitted by clang is missing the enum integer type, but the code is now ready to accept and deal with the integral type if it is supplied.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d5e48bd4029b47cd298fd065429bb3a350a08324 06-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13341472>

LLDB wasn't printing the names for negative enums. Fixed the signed extraction of enumerators and how they were registered with clang's type system.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
464a5063bc59755cb6ec063d0b2491097302d2ab 04-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13338643>

DWARF with .o files now uses 40-60% less memory!

Big fixes include:
- Change line table internal representation to contain "file addresses". Since each line table is owned by a compile unit that is owned by a module, it makes address translation into lldb_private::Address easy to do when needed.
- Removed linked address members/methods from lldb_private::Section and lldb_private::Address
- lldb_private::LineTable can now relink itself using a FileRangeMap to make it easier to re-link line tables in the future
- Added ObjectFile::ClearSymtab() so that we can get rid of the object file symbol tables after we parse them once since they are not needed and kept memory allocated for no reason
- Moved the m_sections_ap (std::auto_ptr to section list) and m_symtab_ap (std::auto_ptr to the lldb_private::Symtab) out of each of the ObjectFile subclasses and put it into lldb_private::ObjectFile.
- Changed how the debug map is parsed and stored to be able to:
- Lazily parse the debug map for each object file
- not require the address map for a .o file until debug information is linked for a .o file



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
17a0b5687dff1714d03f16521ff1b9ea3cb8e1a5 27-Feb-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13287629>

Fixed an issue with clang 500's new way to represent static class variables where it emits a DW_TAG_member with a DW_AT_external(0x01) attribute and no DW_AT_data_member_location.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
89a86ef06d0f72468111344aa84d364fe7b32f10 26-Feb-2013 Greg Clayton <gclayton@apple.com> A quick variable rename Sean and I had discussed earlier to make things a bit clearer.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d3beda617568982a0295481551d23f9b42df801d 26-Feb-2013 Sean Callanan <scallanan@apple.com> Fixed several problems with class uniq'ing in the
SymbolFileDWARF code:

- If a class is being uniqued to another copy of itself
and the method lists don't match exactly, take a slow
path and at least unique the methods that they have
in common.

- Sort name_to_die maps before querying them. This
would otherwise result in uniquing failures because
looking up a name in a map that contains it would
often fail.

- Tolerate classes in other symbol files in the case
of debugging with .o files rather than with a
.dSYM. We used to assume that the classes being
uniqued were in the same symbol file, causing
unpredictable results.

This will dramatically reduce the number of cases where
a function does not have a valid DeclContext.

<rdar://problem/12153915>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a7e864cb0a450c7ef65b6f9f6c9bae839c405906 23-Feb-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13265297>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
0ac1f0c2df5d5003b53489a52022e3ba1c88dc95 13-Feb-2013 Andrew Kaylor <andrew.kaylor@intel.com> Improved handling for DW_AT_const_value

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
732579b63a2624512812c8e33cc110a1437e49b6 07-Feb-2013 Greg Clayton <gclayton@apple.com> Be ready for fully qualified hash names in the __apples_types tables.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
4a58456ee1ac2b38f7e11dc04760f86afd2d80ca 07-Feb-2013 Sean Callanan <scallanan@apple.com> Fixed a problem that would cause LLDB to crash
if it encountered bad debug information. This
debug information had an Objective-C method whose
selector disagreed with the true number of arguments
to that method.

<rdar://problem/12992864>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
6ac5bf19c54fee205ee746b38f5f1e7ec98a9b40 01-Feb-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13130975>

Class global variables were not being linked correctly when debugging with DWARF in .o files.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f892c42725ed36c97e8ce10e758170cf6f1aff83 30-Jan-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/9141269>

Cleaned up the objective C name parsing code to use a class.

Now breakpoints that are set by name that are objective C methods without the leading '+' or '-' will resolve. We do this by expanding all the objective C names for a given string. For example:

(lldb) b [MyString cStringUsingEncoding:]

Will set a breakpoint with multiple possible names:
-[MyString cStringUsingEncoding:]
+[MyString cStringUsingEncoding:]

Also if you have a category, it will strip the category and set a breakpoint in all variants:

(lldb) [MyString(my_category) cStringUsingEncoding:]

Will resolve to the following names:

-[MyString(my_category) cStringUsingEncoding:]
+[MyString(my_category) cStringUsingEncoding:]
-[MyString cStringUsingEncoding:]
+[MyString cStringUsingEncoding:]

Likewise when we have:

(lldb) b -[MyString(my_category) cStringUsingEncoding:]

It will resolve to two names:
-[MyString(my_category) cStringUsingEncoding:]
-[MyString cStringUsingEncoding:]





git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
36da2aa6dc5ad9994b638ed09eb81c44cc05540b 25-Jan-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13069948>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
924910ce9f0b85e54a5c5c75cdaebc7607ffe117 04-Jan-2013 Andrew Kaylor <andrew.kaylor@intel.com> Handle the case of unordered sequences in a DWARF line table.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@171548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
aadc7f7df57ab1883ca7aa0da792c57611f2f49f 03-Jan-2013 Sean Callanan <scallanan@apple.com> Clang sometimes emits "objc_object*" rather than "id"
for id types with protocols on them. We detect this
and report "id" instead.

Also added a testcase.

<rdar://problem/12595644>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@171431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
48562000534f7464c1db74cd373e48f09fb0a349 14-Dec-2012 Greg Clayton <gclayton@apple.com> Remove unused variable.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
467be718130d433042637a572fd28f96622740a2 14-Dec-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12878674>

Remove debug asserts.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
23e2b6d3b518ea0166d1031888ed16a567b973ef 14-Dec-2012 Sean Callanan <scallanan@apple.com> Some incorrect debug information caused LLDB
to report a structure with an array of size 1
at the end without accounting for that array
when reporting the struct's total size to Clang.

LLDB now coerces such an array to size 0.

<rdar://problem/12822204>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
be754e641cfee70cf7ab0c6d160e94a085416f26 12-Dec-2012 Greg Clayton <gclayton@apple.com> Allow LLDB to work with dSYM files that have a DWARF compile unit with nothing else to support clang's new -gline-tables-only mode of compiling.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
6f3a711edcfaeca1efbb998cdea5d0a0782ddfa3 08-Dec-2012 Greg Clayton <gclayton@apple.com> Make sure to check for DW_AT_linkage_name to get the mangled name in the DWARF along with the older DW_AT_MIPS_linkage_name attribute.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b912457e1eb6f97d3ee3adc74d1e0f6393e35d3c 06-Dec-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12560257>

Fixed zero sized arrays to work correctly. This will only happen once we get a clang that emits correct debug info for zero sized arrays. For now I have marked the TestStructTypes.py as an expected failure.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
48f833c33b8c2713e99139941ce3b3885883c4f0 06-Dec-2012 Sean Callanan <scallanan@apple.com> Rewrote the bitfield logic. Major changes include:

- Removed the BitfieldMap class because it is unnecessary.
We now just track the most recently added field.

- Moved the code that calculates bitfield widths so it
can also be used to determine whether it's necessary
to insert anonymous fields.

- Simplified the anonymous field calculation code into
three cases (two of which are resolved identically).

- Beefed up the bitfield testcase.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a7eb2484d2be5a517b96fa04a76ac03db16712d6 05-Dec-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12560257>

Fixed arrays with a size of 1 to correctly have 1 member when DW_AT_upper_bound was set to zero and no other attributes were set.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
5f35a4be95aed0e5b2cb36f7d785bcbfc67284ae 29-Nov-2012 Daniel Malea <daniel.malea@intel.com> Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types

Patch from Matt Kopec!



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
14fe7f1de593ba562787481ecdc455e46fe8c3c9 27-Nov-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12636970>

Detect the new fixed clang that properly supports bitfields in objc classes.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b5bdf6a7e0b9f73de880d9b12d55ab4aeed8634f 15-Nov-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11782181>

Fixed an issue where lldb was setting breakpoints on too many methods when a partial function name with namespaces or class qualifiers was used. For example setting a breakpoint of "Foo::dealloc" was accidentally settings breakpoints on all objective C functions whose selector was "dealloc"...



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e727b87cb85f75ff1a6d56010c4390ccaa8152a9 12-Nov-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12153915>

When uniquing classes against one another we can't depend on any or all of the artificial functions (default ctor, dtor, copy ctor, move ctor, etc) being in each definition. Now we treat those separately and handle those to the best of our ability.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d94bf681a699e45edf1013d97664fcb2a7e4b302 12-Nov-2012 Daniel Malea <daniel.malea@intel.com> Fix libstdc++ build
- Add missing operator= definition for DelayedAddObjCClassProperty
- needed to be compatible with libstdc++ vector implementation



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b3ac5bfe5ce6cc584ea958a56416e179ba5e6b66 08-Nov-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12645617>
<rdar://problem/12153915> (partial fix)

Remove an assert and place an error message instead so we don't crash when we run into a type tag that we don't recognize. We will now emit a warning so that hopefully we can get a bug report that has example code that shows what we are missing.

Also fixed a case when trying to unique one type to another where we would confuse concrete instances of methods with their definitions and end up not correctly registering the types.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c2ed5cc36a2aac7be58de8ce6b02707b28015cb9 06-Nov-2012 Greg Clayton <gclayton@apple.com> Added unnamed bitfields to our bitfield test.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167473 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f270fa9682d748c1be1aea1993fd8d2408639f4c 06-Nov-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12582031>

Unnamed bitfields cause struct layout problems

Synthesize unnamed bitfields when required. Most compilers don't mention unnamed bitfields in the DWARF, so we need to create them to keep clang happy with the types we create from the DWARF. We currently can't do this for ObjC since the DW_AT_bit_offset value for any direct ivars of ObjC classes as the values for these attributes are bogus. A bug has been filed on Clang to fix this, and another bug has been filed on LLDB to make sure we fix the DWARF parser once the clang fix is in by looking the the DW_AT_producer in the compile unit attributes and finding the compiler version and only enabling it for newer versions of clang.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
88db4597c7567be050b7a729f7306832f28428bb 02-Nov-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12585314>

LLDB now provides base class offsets (virtual and non virtual) to Clang's record layout. We previously were told this wasn't necessary, but it is when pragma pack gets involved.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
8d6d0f265c529a85335388aaa88a05d761ee77bf 01-Nov-2012 Greg Clayton <gclayton@apple.com> Avoid a crash when trying to parse a line table in the DWARF parser.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c71397b43f3d6d7af5a5dc59813fe57e04c2f505 31-Oct-2012 Sean Callanan <scallanan@apple.com> Fixed a crash when we couldn't create a
CXXMethodDecl but tried to manipulate it
anyway.

<rdar://problem/12601996>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
8fda922ca66c79c4a373f1cd6092cdd0cd6ee295 31-Oct-2012 Jim Ingham <jingham@apple.com> Change a couple of raw printf's to expression log output.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
4756b6747228a7905719c48a47bb1191504b7e53 30-Oct-2012 Greg Clayton <gclayton@apple.com> Use the "data()" accessor on the std::vector<clang_type_t> in case it is empty.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a32c5a5aa1fec0f9bc2a5b123f07ff6b8c979999 27-Oct-2012 Jim Ingham <jingham@apple.com> This is the first phase of supporting the DW_AT_object_pointer tag. I expanded the decl metadata
so it could hold this information, and then used it to look up unfound names in the object pointer
if it exists. This gets "frame var" to work for unqualified references to ivars captured in blocks.
But the expression parser is ignoring this information still.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@166860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b8183d463ca7b2ba106f000d69cb99a50dbb20f8 23-Oct-2012 Sean Callanan <scallanan@apple.com> Added support for zero-length arrays at the end
of structures, and added a testcase.

<rdar://problem/12551591>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@166450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c7e570897429c442bb835becdb6cfac48de38694 19-Oct-2012 Sean Callanan <scallanan@apple.com> Fixed a bug where empty C structs were given size
1 by the expression parser. We now correctly
report that they are of size 0. (C++ structs
are mandated to have nonzero size, and Clang marks
them as being 1 byte in size.)

<rdar://problem/12380800>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@166256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
6f01c93497df194b6f2194630a81e87d806ce0e0 12-Oct-2012 Jim Ingham <jingham@apple.com> Bunch of cleanups for warnings found by the llvm static analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b4ba18e32369ea22ea57b9dac454684fcab266f3 05-Oct-2012 Sean Callanan <scallanan@apple.com> Fixed an assertion in the SymbolFile resulting
from a NULL ObjCInterfaceDecl.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
06dc17f8eb821d7256fd42e56f85c2779a29f689 25-Sep-2012 Sean Callanan <scallanan@apple.com> Brought LLDB top-of-tree into sync with LLVM/Clang
top-of-tree. Removed all local patches and llvm.zip.

The intent is that fron now on top-of-tree will
always build against LLVM/Clang top-of-tree, and
that problems building will be resolved as they
occur. Stable release branches of LLDB can be
constructed as needed and linked to specific release
branches of LLVM/Clang.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@164563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
851e30ec6a1b1d2c154bb7d69ed0d05b5fd14705 18-Sep-2012 Greg Clayton <gclayton@apple.com> Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. Some platforms don't support this modification.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@164148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
49ce8969d3154e1560106cfe530444c09410f217 29-Aug-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11757916>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
caddaf4c03dfe49a8245820a2f0a362239ce5d06 11-Aug-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11791234>

Remember to copy the address byte size and the byte order when copying data into a DWARF location object, or things will go wrong.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9885ef319f61c6c2a15e6a358a1ef8e8de55aab5 11-Aug-2012 Greg Clayton <gclayton@apple.com> Revert changes where we copied the expression locations back to using the reference into the debug info until test suite failures are resolved.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161720 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9880efacdd3a5e855b405d89433a01170422a889 11-Aug-2012 Jim Ingham <jingham@apple.com> Add explicit casts to bool in "shared pointer is valid" constructs that return bool.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
4fa86fef917b43f9573e5adfee4a4d005059dcae 11-Aug-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11791234>

Fixed an issue that could cause references the shared data for an object file to stay around longer than intended and could cause memory bloat when debugging multiple times.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b386d82334b65fb984348f2027b1cb7714de993f 09-Aug-2012 Sean Callanan <scallanan@apple.com> Removed explicit NULL checks for shared pointers
and instead made us use implicit casts to bool.
This generated a warning in C++11.

<rdar://problem/11930775>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c02400422d5e644a2a486bce5517d46d435a3f02 19-Jul-2012 Greg Clayton <gclayton@apple.com> Cleaned up the lldb_private::Mangled class to get rid of the tokenizing code that has bit rotted and isn't being used. Also cleaned up the API to the "lldb_private::Mangled" to always take "const ConstString &" arguments instead of both "const ConstString &" and "const char *".



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
4e725034c8381787804dc1858095e9b452edb55b 18-Jul-2012 Sean Callanan <scallanan@apple.com> Removed a hack that gives zero-length arrays a
single element. Also modified our struct test
case to test this.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
4a379b1194f3e6b308cd6e80b45d6ca5dd0aafd7 17-Jul-2012 Greg Clayton <gclayton@apple.com> Ran the static analyzer on the codebase and found a few things.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e6eff65713b2427b510c3ddd5820e8ee95bb2ca2 07-Jul-2012 Sean Callanan <scallanan@apple.com> Fixed a crash in the class uniq'ing code where we
didn't check if the two classes had the same number
of members.

<rdar://problem/11678873>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@159880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a23b44181b98ccaf5125cd7213e8c3624fb71eac 05-Jun-2012 Sean Callanan <scallanan@apple.com> Fixed handling of Objective-C properties to ensure
that automatically generated setters/getters only
get added to a class after explicitly declared (or
synthesized) getters/setters had the chance to be
added. This eliminates conflicts creating errors
of the form:

error: instance method '...' has incompatible result
types in different translation units ('X *' vs. 'id')


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
246294891b6d2e1772ff535187e876067f492f53 01-Jun-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11548378>

Fixed an issue with the current type being set to DIE_IS_BEING_PARSED in the m_die_to_type map by making sure the type pointer is valid.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9a23becdf4f275a7a4da9e5a0319c1b4501673ae 23-May-2012 Filipe Cabecinhas <me@filcab.net> Small fixes: actually return a boolean and remove semi-colons.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
57e0ff42f10d1245f9e8d5b3418d5066aea6ea05 22-May-2012 Sean Callanan <scallanan@apple.com> Added support for rvalue references in debug information
(actually, mainly just hooked up support that was already
there). Added a test case, although it's expected to fail
right now unless you're using top-of-tree LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9d1fa2ac90008546b4077238726ea659f34e8b8d 18-May-2012 Greg Clayton <gclayton@apple.com> Warn when we detect a valid dSYM file that is empty. This can happen when a dSYM file is created from a binary with no debug info, that has been stripped, or when the .o files are not available when the dSYM is created.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
82b147fd9a5cb8e2144211192b06f4dec22150a7 17-May-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11439755>

Make sure we can fail to create a compile unit without asserting. We now emit a warning.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
bd5c23ddf5bacc78548bbe348c8c5d98c372aedc 15-May-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11240464>

Correctly unique a class' methods when we detect that a class has been uniqued to another.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9e8865ee73f1c3decad554809368e8779b8c3e98 26-Apr-2012 Greg Clayton <gclayton@apple.com> Save more memory by not parsing the symbol table for stand alone DWARF files. We currently have SymbolFile plug-ins which all get the chance to say what they can parse in a symbol file. Prior to this fix we would ask the SymbolFileDWARF plug-in what abilities it had, and it would answer with "everything", and then we would check the SymbolFileSymtab plug-in what abilities it had, in case it had more abilities. The checking that SymbolFileSymtab does is a bit expensive as it pulls in the entire symbol table just to see if it can offer a few scraps of debug information. This causes all stand along DWARF files to pull in their symbol tables even though those symbols will never be used. This fix will check all SymbolFile plug-ins for their abilities and if any plug-in responds with "everything", then we stop the search.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
49749a79b8f5299bbe4b727ea6399001ddd9bb2d 25-Apr-2012 Sean Callanan <scallanan@apple.com> Recognize Objective-C classes with runtime class
ObjCPlusPlus as Objective-C classes. Really the
compiler should say they have Objective-C runtime
class, but we should be a little more resilient
(we were refusing to find ivars in those classes
before).

Also added a test case.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
cbff0fb344c17ef0699c1375f6ddeb5bcd1bdbe2 24-Apr-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11291668>

Fixed an issue that would happen when using debug map with DWARF in the .o files where we wouldn't ever track down the actual definition for a type when things were in namespaces. We now serialize the decl context information into an intermediate format which allows us to track down the correct definition for a type regardless of which DWARF symbol file it comes from. We do this by creating a "DWARFDeclContext" object that contains the DW_TAG + name for each item in a decl context which we can then use to veto potential accelerator table matches. For example, the accelerator tables store the basename of the type, so if you have "std::vector<int>", we would end up with an accelerator table entry for the type that contained "vector<int>", which we would then search for using a DWARFDeclContext object that contained:

[0] DW_TAG_class_type "vector<int>"
[1] DW_TAG_namespace "std"

This is currently used to track down forward declarations for things like "class a::b::Foo;".


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
73a35715708b65b1d96c1c8f439548bb0990df08 24-Apr-2012 Greg Clayton <gclayton@apple.com> Added the ability to log a message with a backtrace when verbose logging is enabled to the Module class. Used this new function in the DWARF parser.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e7cf9c43ee41ba062710e6ee6eb8604cc5ab5665 20-Apr-2012 Greg Clayton <gclayton@apple.com> Added logging so we can see when we are trying to complete a forward type and pull in the world. This is due to a compiler bug we are tracking (<rdar://problem/11291658>) where forward decls to classes and types are not properly scoped in namespaces, which results in the current LLDB looking for a type it will find many times in the accelerator tables, but never match. For example, when debugging with clang we get a forward decl like:

class AnalysisResolver;

And we will look for it everywhere and find many many matches, but the decl context of those matching DIEs is "clang::AnalysisResolver", so we never match anything, yet we pull in waaayyy too much DWARF in the process.

To enable this logging enable the "lookups" category in the "dwarf" log channel:

(lldb) log enable dwarf lookups



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155233 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a4974db9b26cc4f33e16c990304b51f4a1d38611 18-Apr-2012 Sean Callanan <scallanan@apple.com> We now record metadata for Objective-C interfaces,
Objective-C methods, and Objective-C properties.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
fafffe000eb4a3902ecefc82446d11e6838167c6 13-Apr-2012 Sean Callanan <scallanan@apple.com> Added a mechanism for keeping track of where in
the debug information individual Decls came from.

We've had a metadata infrastructure for a while,
which was intended to solve a problem we've since
dealt with in a different way. (It was meant to
keep track of which definition of an Objective-C
class was the "true" definition, but we now find
it by searching the symbols for the class symbol.)
The metadata is attached to the ExternalASTSource,
which means it has a one-to-one correspondence with
AST contexts.

I've repurposed the metadata infrastructure to
hold the object file and DIE offset for the DWARF
information corresponding to a Decl. There are
methods in ClangASTContext that get and set this
metadata, and the ClangASTImporter is capable of
tracking down the metadata for Decls that have been
copied out of the debug information into the
parser's AST context without using any additional
memory.

To see the metadata, you just have to enable the
expression log:
-
(lldb) log enable lldb expr
-
and watch the import messages. The high 32 bits
of the metadata indicate the index of the object
file in its containing DWARFDebugMap; I have also
added a log which you can use to track that mapping:
-
(lldb) log enable dwarf map
-

This adds 64 bits per Decl, which in my testing
hasn't turned out to be very much (debugging Clang
produces around 6500 Decls in my tests). To track
how much data is being consumed, I've also added a
global variable g_TotalSizeOfMetadata which tracks
the total number of Decls that have metadata in all
active AST contexts.

Right now this metadata is enormously useful for
tracking down bugs in the debug info parser. In the
future I also want to use this information to provide
more intelligent error messages instead of printing
empty source lines wherever Clang refers to the
location where something is defined.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
8f14b3f7b98ebc014c6e23c1b77932e25d1b4a12 13-Apr-2012 Sean Callanan <scallanan@apple.com> Fixed a problem where LLDB inserted regular C
FunctionDecls into classes if it looked up a
method in a different DWARF context than the
one where it found the parent class's definition.

The symptom of this was, for a method A::B(),

1) LLDB finds A in context 1, creating a
CXXRecordDecl for A and marking it as needing
completion

2) LLDB looks up B in context 2, finds that its
parent A already has a CXXRecordDecl, but can't
find a CXXMethodDecl for B

3) Not finding a CXXMethodDecl for B, LLDB doesn't
set the flag indicating that B was resolved

4) Because the flag wasn't set, LLDB's fallthrough
code creates a FunctionDecl for B and sticks it
in the DeclContext -- in this case, A.

5) Clang crashes on finding a FunctionDecl inside a
CXXRecordDecl.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
7c2d140366f64229b17fe6703cf58cd197e56518 10-Apr-2012 Greg Clayton <gclayton@apple.com> Fixed an issue that could occur when looking up functions inside of a namespace where if the NamespaceDecl hadn't been parsed yet, we would say a function wasn't in a namespace.

Also improved the logging that happens with "log enable dwarf lookups" is enabled to show when we find matches.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
8d6115615f55ae38ff141f0a6859d59750da8d02 05-Apr-2012 Sean Callanan <scallanan@apple.com> Fixed a problem where we did not read properties
correctly if the setter/getter were not present
in the debug information. The fixes are as follows:

- We not only look for the method by its full name,
but also look for automatically-generated methods
when searching for a selector in an Objective-C
interface. This is necessary to find accessors.

- Extract the getter and setter name from the
DW_TAG_APPLE_Property declaration in the DWARF
if they are present; generate them if not.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b20eb3ce04e2dd98fd8a02da23c26a6922b507e1 03-Apr-2012 Bill Wendling <isanbard@gmail.com> Possibly too soon for this commit.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
2e916960258c55ff8b42d5dba972ef82880163e5 03-Apr-2012 Bill Wendling <isanbard@gmail.com> Spell 'DW_TAG_APPLE_property' with the correct capitalization.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
0be1edd34ff46e017b1b973c5a57e3de9f613baf 03-Apr-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11160171>

Fixed an issue where there were more than one way to get a CompileUnitSP created when using SymbolFileDWARF with SymbolFileDWARFDebugMap. This led to an assertion that would fire under certain conditions. Now there is only one way to create the compile unit and it will "do the right thing".



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
86b391bd742589c2b243e7c4beb5fa522ee0c481 31-Mar-2012 Greg Clayton <gclayton@apple.com> Added the ability to log when things get completed in DWARF. This can be enabled using:

(lldb) log enable --verbose lldb completion

This will print out backtraces for all type completion calls which will help us verify that we don't ever complete a type when we don't need to.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
3356d4f89e85301e5ddec2301c75b0626d50703f 30-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11082392>

Fixed an issue that could cause circular type parsing that will assert and kill LLDB.

Prior to this fix the DWARF parser would always create class types and not start their definitions (for both C++ and ObjC classes) until we were asked to complete the class later. When we had cases like:

class A
{
class B
{
};
};

We would alway try to complete A before specifying "A" as the decl context for B. Turns out we can just start the definition and still not complete the class since we can check the TagDecl::isCompleteDefinition() function. This only works for C++ types. This means we will not be pulling in the full definition of parent classes all the time and should help with our memory consumption and also reduce the amount of debug info we have to parse.

I also reduced redundant code that was checking in a lldb::clang_type_t was a possible C++ dynamic type since it was still completing the type, just to see if it was dynamic. This was fixed in another function that was checking for a type being dynamic as an ObjC or a C++ type, but there was dedicated fucntion for C++ that we missed.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d4f16c8903d99057a0db2c5b73071261f534ec1c 29-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10103468>

Symbol files (dSYM files on darwin) can now be specified during program execution:

(lldb) target symbols add /path/to/symfile/a.out.dSYM/Contents/Resources/DWARF/a.out

This command can be used when you have a debug session in progress and want to add symbols to get better debug info fidelity.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153693 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1ec8f8fc244b7714a7847525cb9474ebcd85487a 29-Mar-2012 Sean Callanan <scallanan@apple.com> Added support for the DW_AT_APPLE_Property tag
for unbacked properties. We support two variants:
one in which the getter/setter are provided by
selector ("mySetter:") and one in which the
getter/setter are provided by signature
("-[MyClass mySetter:]").


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
23d90aea32663f114ffee323775b02dad09f2f18 27-Mar-2012 Greg Clayton <gclayton@apple.com> Fixed a few things in the ELF object file:
1 - sections only get a valid VM size if they have SHF_ALLOC in the section flags
2 - symbol names are marked as mangled if they start with "_Z"

Also fixed the DWARF parser to correctly use the section file size when extracting the DWARF.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
dc0a38c5a727cae5362b218a3180d0f4265a619d 27-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11113279>

Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not).

This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method.

This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9ff34285e9658d948711077e9c265883b1425880 25-Mar-2012 Eric Christopher <echristo@apple.com> Use GetClangDeclContextForDIE, it'll find the cached one
if it's there and we may not have a cached die yet. This
fixes a bunch of false positives on "die has no decl".


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
2418fddf2e200c827da5bc6c855f3d4971b2d867 19-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11072382>

Fixed a case where the source path remappings on the module were too expensive to
use when we try to verify (stat the file system) that the remapped path points to
a valid file. Now we will use the lldb_private::Module path remappings (if any) when
parsing the debug info without verifying that the paths exist so we don't slow down
line table parsing speeds.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
964deba8853eb794e59263322b59b09b43669618 15-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/8196933>

Use the metadata in the dSYM bundle Info.plist to remap source paths when they keys are available.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
39994c64a21bb520f81466c4235d9cf936a22ab6 14-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11049371>
http://llvm.org/bugs/show_bug.cgi?id=12232

Fixed a case where a missing "break" in a switch statement could cause an assertion to fire and kill the debug session.

The fix was derived from the findings of Andrea Bigagli, thanks Andrea.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
0c31d3d3a4a1d00d53346d8a23b0519f47e55d1f 07-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10997402>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b962cbc33382341189298150c11b2d51c86a283a 02-Mar-2012 Jim Ingham <jingham@apple.com> Make sure breakpoint partial name matches occur on namespace boundaries.
<rdar://problem/10720345> "break set -n" name matching should only match at namespace boundaries


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
3552ed0afbb58f377a4677ae5253e59b3ed80954 02-Mar-2012 Sean Callanan <scallanan@apple.com> Improved the type's handling of anonymous structs,
so that the expression parser can look up members
of anonymous structs correctly. This meant creating
all the proper IndirectFieldDecls in each Record
after it has been completely populated with members.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c613a8923ce0a457e34e830daf90eb517a655dac 02-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10967107>

Don't try and unique anonymous struct/union/class types.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
493050c2b497ce9a7c71db8d4ee451a8f4dcb597 27-Feb-2012 Sean Callanan <scallanan@apple.com> Moved byte-size computation out of a
startDefinition() ... endDefinition() block,
preventing crashes where the byte size of a
not-yet-complete type was being computed.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
3508c387c3f0c9ecc439d98048fd7694d41bab1b 24-Feb-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10103468>

I started work on being able to add symbol files after a debug session
had started with a new "target symfile add" command and quickly ran into
problems with stale Address objects in breakpoint locations that had
lldb_private::Section pointers into modules that had been removed or
replaced. This also let to grabbing stale modules from those sections.
So I needed to thread harded the Address, Section and related objects.

To do this I modified the ModuleChild class to now require a ModuleSP
on initialization so that a weak reference can created. I also changed
all places that were handing out "Section *" to have them hand out SectionSP.
All ObjectFile, SymbolFile and SymbolVendors were inheriting from ModuleChild
so all of the find plug-in, static creation function and constructors now
require ModuleSP references instead of Module *.

Address objects now have weak references to their sections which can
safely go stale when a module gets destructed.

This checkin doesn't complete the "target symfile add" command, but it
does get us a lot clioser to being able to do such things without a high
risk of crashing or memory corruption.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
931acecd4e3af534028936431dc0f75a9fd6eb02 23-Feb-2012 Sean Callanan <scallanan@apple.com> Added support for looking up the complete type for
Objective-C classes. This allows LLDB to find
ivars declared in class extensions in modules other
than where the debugger is currently stopped (we
already supported this when the debugger was
stopped in the same module as the definition).

This involved the following main changes:

- The ObjCLanguageRuntime now knows how to hunt
for the authoritative version of an Objective-C
type. It looks for the symbol indicating a
definition, and then gets the type from the
module containing that symbol.

- ValueObjects now report their type with a
potential override, and the override is set if
the type of the ValueObject is an Objective-C
class or pointer type that is defined somewhere
other than the original reported type. This
means that "frame variable" will always use the
complete type if one is available.

- The ClangASTSource now looks for the complete
type when looking for ivars. This means that
"expr" will always use the complete type if one
is available.

- I added a testcase that verifies that both
"frame variable" and "expr" work.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f4cbc323e33dd6f3f4379d174c953c7f05baadb9 13-Feb-2012 Sean Callanan <scallanan@apple.com> Tightened up type uniq'ing so we don't uniq two
anonymous types to each other unless they have
the same byte_size.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
302d78c71902398ce1f422bd09216dd53a6abb88 10-Feb-2012 Sean Callanan <scallanan@apple.com> Extended function lookup to allow the user to
indicate whether inline functions are desired.
This allows the expression parser, for instance,
to filter out inlined functions when looking for
functions it can call.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
caffddc39bf640bb1fce58b0cc5791d6c42dce28 09-Feb-2012 Sean Callanan <scallanan@apple.com> Caching the DIE for the DeclContext as reported
by GetClangDeclContextContainingDIE, for better
debuggability.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e7a8e4621a0b74997ad564a9288800f752208dab 09-Feb-2012 Greg Clayton <gclayton@apple.com> Added a logging helper class for SymbolFileDWARF::ParseType() that will
enable us to track the depth of parsing and what is being parsed. This
helps when trying to track down difficult type parsing issues and is only
enabled in non-production builds.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
361c0f849dfdd66ea5b5cbf3010d95a0882f269e 07-Feb-2012 Sean Callanan <scallanan@apple.com> Made SymbolFileDWARF be less strict when looking
for types that can be uniqued to the given type.
This is especially helpful when types are missing
file and line information.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
97b675ecde7a3b7ebb4161fbecb122fb22c2b6ea 06-Feb-2012 Sean Callanan <scallanan@apple.com> I left some stray debugging messages in the source
code. Removing these.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b7fad95031b51dde040dc8b3de7bd8db2d14f613 06-Feb-2012 Greg Clayton <gclayton@apple.com> Almost have templatized functions working (templatized classes are already
working, but not functions). I need to check on a few things to make sure
I am registering everything correctly in the right order and in the right
contexts.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
7dd5c51fbab8384b18f20ecc125f9a1bb3c9bcb2 06-Feb-2012 Greg Clayton <gclayton@apple.com> Removed all of the "#ifndef SWIG" from the SB header files since we are using
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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
2e4ea184f2b0cb8ede4e9cd89d2bbc7d2ed24ea0 05-Feb-2012 Greg Clayton <gclayton@apple.com> Made a fix that would affect anything in the anonymous namespace when looking
for types and comparing decl context matches.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
eac62c0514a516436a4be51bf7cdd829b00f25cc 05-Feb-2012 Greg Clayton <gclayton@apple.com> Added some extra comments for the declaration context comparison function
in the DWARF plug-in.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149811 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b5a8f1498e1ddaeed5187a878d57ea0b74af9c26 05-Feb-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10560053>

Fixed "target modules list" (aliased to "image list") to output more information
by default. Modified the "target modules list" to have a few new options:

"--header" or "-h" => show the image header address
"--offset" or "-o" => show the image header address offset from the address in the file (the slide applied to the shared library)

Removed the "--symfile-basename" or "-S" option, and repurposed it to
"--symfile-unique" "-S" which will show the symbol file if it differs from
the executable file.

ObjectFile's can now be loaded from memory for cases where we don't have the
files cached locally in an SDK or net mounted root. ObjectFileMachO can now
read mach files from memory.

Moved the section data reading code into the ObjectFile so that the object
file can get the section data from Process memory if the file is only in
memory.

lldb_private::Module can now load its object file in a target with a rigid
slide (very common operation for most dynamic linkers) by using:

bool
Module::SetLoadAddress (Target &target, lldb::addr_t offset, bool &changed)

lldb::SBModule() now has a new constructor in the public interface:

SBModule::SBModule (lldb::SBProcess &process, lldb::addr_t header_addr);

This will find an appropriate ObjectFile plug-in to load an image from memory
where the object file header is at "header_addr".




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
8f2e392e8937aaf66f91201dc5f4190d61902c67 04-Feb-2012 Sean Callanan <scallanan@apple.com> I have brought LLDB up-to-date with top of tree
LLVM/Clang. This brings in several fixes, including:

- Improvements in the Just-In-Time compiler's
allocation of memory: the JIT now allocates
memory in chunks of sections, improving its
ability to generate relocations. I have
revamped the RecordingMemoryManager to reflect
these changes, as well as to get the memory
allocation and data copying out fo the
ClangExpressionParser code. Jim Grosbach wrote
the updates to the JIT on the LLVM side.

- A new ExternalASTSource interface to allow LLDB to
report accurate structure layout information to
Clang. Previously we could only report the sizes
of fields, not their offsets. This meant that if
data structures included field alignment
directives, we could not communicate the necessary
alignment to Clang and accesses to the data would
fail. Now we can (and I have update the relevant
test case). Thanks to Doug Gregor for implementing
the Clang side of this fix.

- The way Objective-C interfaces are completed by
Clang has been made consistent with RecordDecls;
with help from Doug Gregor and Greg Clayton I have
ensured that this still works.

- I have eliminated all local LLVM and Clang patches,
committing the ones that are still relevant to LLVM
and Clang as needed.

I have tested the changes extensively locally, but
please let me know if they cause any trouble for you.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
efa4e22f9e02b77918edc42ad3ec3fad65520970 02-Feb-2012 Greg Clayton <gclayton@apple.com> Fixed a build breakage when trying to assign a shared pointer using a raw pointer.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b88575efac471db9156c731c3e28ad7e6d14b5ef 02-Feb-2012 Greg Clayton <gclayton@apple.com> Fixed an issue where we might accept the wrong type when completing
a type when we have a forward declaration. We always have found a
type by basename, but now we also compare the decl context of the
die we are trying to complete with the matches we find from the accelerator
tables to ensure we get the right one.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
13d24fb1817faa7ccc4cfd799113ba1a2b8968eb 29-Jan-2012 Greg Clayton <gclayton@apple.com> Switching back to using std::tr1::shared_ptr. We originally switched away
due to RTTI worries since llvm and clang don't use RTTI, but I was able to
switch back with no issues as far as I can tell. Once the RTTI issue wasn't
an issue, we were looking for a way to properly track weak pointers to objects
to solve some of the threading issues we have been running into which naturally
led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared
pointer from just a pointer, which is also easily solved using the
std::tr1::enable_shared_from_this class.

The main reason for this move back is so we can start properly having weak
references to objects. Currently a lldb_private::Thread class has a refrence
to its parent lldb_private::Process. This doesn't work well when we now hand
out a SBThread object that contains a shared pointer to a lldb_private::Thread
as this SBThread can be held onto by external clients and if they end up
using one of these objects we can easily crash.

So the next task is to start adopting std::tr1::weak_ptr where ever it makes
sense which we can do with lldb_private::Debugger, lldb_private::Target,
lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and
many more objects now that they are no longer using intrusive ref counted
pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive
pointers).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a792abe6350b7e3241bfc7121eba74dbea5eca55 28-Jan-2012 Greg Clayton <gclayton@apple.com> Added logging so we can see the field names and offsets of any structures
for when we enable the assisted layout.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
3fc0c4f12b19f1e2bd276d2b6eb0fdd096a01414 28-Jan-2012 Greg Clayton <gclayton@apple.com> Adding the DWARF parser side for assited layout where the AST context
will ask ExternalASTSource objects to help laying out a type. This is needed
because the DWARF typically doesn't contain alignement or packing attribute
values, and we need to be able to match up types that the compiler uses
in expressions.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
662e56733faaeee932eba120d756257682f1bf04 19-Jan-2012 Greg Clayton <gclayton@apple.com> Fixed an issue with the Instruction subclasses where the strings might
be fetched too many times and the DisassemblerLLVM was appending to strings
when the opcode, mnemonic and comment accessors were called multiple times
and if any of the strings were empty.

Also fixed the test suite failures from recent Objective C modifications.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@148460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e0028b827759c5ad2cbc45947371c362193a63bc 19-Jan-2012 Sean Callanan <scallanan@apple.com> Fixed a problem where maintaining the ObjCInterfaceMap
for each ObjCInterfaceDecl was imposing performance
penalties for Objective-C apps. Instead, we now use
the normal function query mechanisms, which use the
relevant accelerator tables.

This fix also includes some modifications to the
SymbolFile which allow us to find Objective-C methods
and report their Clang Decls correctly.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@148457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e14d3d3209f4260acc6e84d656460d5bdeade2c2 19-Jan-2012 Greg Clayton <gclayton@apple.com> Added an extra way to chop up an objective C prototype and use it where necessary.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@148445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
445c086e19b9d8e26f3bc0eae1cd475d9d7ec5b1 19-Jan-2012 Greg Clayton <gclayton@apple.com> Be sure to use the one and only trusted source for chopping up
objective C class names when extracting the class name, selector and
name without category for objective C full class and instance method
names.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@148435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
cc63936a21c8cf41e6fffe88daec21c1412cab69 18-Jan-2012 Greg Clayton <gclayton@apple.com> Fixed an issue where we might not find the one true ObjC definition. Now we do things
much smarter by extracting search results more efficiently and by properly obeying the
must_be_implementation bool in the SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE()
function.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@148413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e6b976d3f1c42f18c85c87cb179954af7df5a542 12-Jan-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10681814>

Fix DWARF parsing issue we can run into when using llvm-gcc based dSYM files.

Also fix the parsing of objective C built-in types (Class, id and SEL) so
they don't parse more information that is not needed due to the way they
are represented in DWARF.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@148016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1c6b461051a996cac19489d6123868ada0589558 11-Jan-2012 Jim Ingham <jingham@apple.com> Don't assert but report & return a NULL type if we end up parsing a type we are in the middle of parsing.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c80dca73893e5b24f4d16c092da75532715b405e 06-Jan-2012 Greg Clayton <gclayton@apple.com> We finalized on the new .apple_types accelerator table format where we don't
emit fully qualified names, so now we make sure the DW_TAG values match and
still lookup using the basename.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
df6dc88322f103b263092d752db4490e628a1cbd 05-Jan-2012 Greg Clayton <gclayton@apple.com> Added code in the Host layer that can report system log messages
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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
2f28ece553d2ef0d7b3e8d1419020591ec3818f9 04-Jan-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10507811>

Be better at detecting when DWARF changes and handle this more
gracefully than asserting and exiting.

Also fixed up a bunch of system calls that weren't properly checking
for EINTR.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e367aa81e7b6da12d57ceec96bd34c5df51d0468 13-Dec-2011 Greg Clayton <gclayton@apple.com> Use forward declarations more of the time to save on things that we need to
parse.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146473 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
bcb0adc2d1d32baa111c0a11eded0e2b4fbef383 12-Dec-2011 Greg Clayton <gclayton@apple.com> Use forward types where possible to avoid having to parse extra DWARF when
it is not required.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c5d14e6146ccacd8e00f1c247e21cd86ebfac21d 10-Dec-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/9958446>
<rdar://problem/10561406>

Stopped the SymbolFileDWARF::FindFunctions (...) from always calculating
the line table entry for all functions that were found. This can slow down
the expression parser if it ends up finding a bunch of matches. Fixed the
places that were relying on the line table entry being filled in.

Discovered a recursive stack blowout that happened when "main" didn't have
line info for it and there was no line information for "main"



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d7fc5b8d107b3df44acfcc694f26875e06c1b4e0 10-Dec-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10559329>

An assertion was firing when parsing types due to trying to complete parent
class decl contenxt types too often.

Also, relax where "dsymutil" binary can come from in the Makefile.rules.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146310 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b5c023af6df0f4f9eddd14284ca986f578c6bee2 09-Dec-2011 Greg Clayton <gclayton@apple.com> Tested a theory on the where when we lookup things in the accelerator tables
that if we prefer the current compile unit, followed by any compile units that
already had their DIEs parsed, followed by the rest of the matches, that we
might save some memory. This turned out not to help much. The code is commented
out, but I want to check it in so I don't lose the code in case it could help
later.

Added the ability to efficiently find the objective C class implementation
when using the new .apple_types acclerator tables with the type flags. If the
type flags are not available, we default back to what we were doing before.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b2027ec7cc8c15dfdc7c945dc6aed4b5d684321e 09-Dec-2011 Sean Callanan <scallanan@apple.com> If the expression parser is unable to complete a TagDecl
in the context in which it was originally found, the
expression parser now goes hunting for it in all modules
(in the appropriate namespace, if applicable). This means
that forward-declared types that exist in another shared
library will now be resolved correctly.

Added a test case to cover this. The test case also tests
"frame variable," which does not have this functionality
yet.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146204 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d7088cf9454164ce3a54e345a2c0a07bc1015335 08-Dec-2011 Greg Clayton <gclayton@apple.com> Fixed an issue where we are asking to get the decl context for a function
that is in a class from the expression parser, and it was causing an
assertion. There is now a function that will correctly resolve a type
even if it is in a class.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
37bb8ddd443da172f42bb8657f15ec856a525c84 08-Dec-2011 Greg Clayton <gclayton@apple.com> Added a new class called lldb_private::SymbolFileType which is designed to
take a SymbolFile reference and a lldb::user_id_t and be used in objects
which represent things in debug symbols that have types where we don't need
to know the true type yet, such as in lldb_private::Variable objects. This
allows us to defer resolving the type until something is used. More specifically
this allows us to get 1000 local variables from the current function, and if
the user types "frame variable argc", we end up _only_ resolving the type for
"argc" and not for the 999 other local variables. We can expand the use of this
as needed in the future.

Modified the DWARFMappedHash class to be able to read the HashData that has
more than just the DIE offset. It currently will read the atoms in the header
definition and read the data correctly. Currently only the DIE offset and
type flags are supported. This is needed for adding type flags to the
.apple_types hash accelerator tables.

Fixed a assertion crash that would happen if we have a variable that had a
DW_AT_const_value instead of a location where "location.LocationContains_DW_OP_addr()"
would end up asserting when it tried to parse the variable location as a
DWARF opcode list.

Decreased the amount of memory that LLDB would use when evaluating an expression
by 3x - 4x for clang. There was a place in the namespace lookup code that was
parsing all namespaces with a certain name in a DWARF file instead of stopping
when it found the first match. This was causing all of the compile units with
a matching namespace to get parsed into memory and causing unnecessary memory
bloat.

Improved "Target::EvaluateExpression(...)" to not try and find a variable
when the expression contains characters that would certainly cause an expression
to need to be evaluated by the debugger.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
77917228890a15d40ec6dd28c5865dd1b7895053 03-Dec-2011 Greg Clayton <gclayton@apple.com> Added code to make sure we don't recursively try to find an objective C
class. The thing with Objective C classes is the debug info might have a
definition that isn't just a forward decl, but it is incomplete. So we need to
look and see if we can find the complete definition and avoid recursing a lot
due to the fact that our accelerator tables will have many versions of the
type, but only one complete one. We might not also have the complete type
and we need to deal with this correctly.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d0b7cfa22722fdaf4111a61d6eeb02a587710e16 03-Dec-2011 Sean Callanan <scallanan@apple.com> Testcase fixes with the new symbol lookup code for
Objective-C, making symbol lookups for various raw
Objective-C symbols work correctly. The IR interpreter
makes these lookups because Clang has emitted raw
symbol references for ivars and classes.

Also improved performance in SymbolFiles, caching the
result of asking for SymbolFile abilities.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a32dc70b583a0d4ea0e95967763606ef28f55d18 03-Dec-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10522194>

Fixed an issue where if we have the DWARF equivalent of:

struct foo;

class foo { ... };

Or vice versa, we wouldn't be able to find the complete type. Since many
compilers allow forward declarations to have struct and definitions to have
class, we need to be able to deal with both cases. This commit fixes this in
the DWARF parser.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d37ffd975faf5ac305dbf176e2a171b1b0f1600f 30-Nov-2011 Greg Clayton <gclayton@apple.com> Add a work around to deal with incorrect forward class definitions in
objective C DWARF emitted by clang.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f332c536533a9663bd7f0c2f43203b750b511f39 30-Nov-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10500242>

Find the one true objective C type definition if there is one within a module.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
da52c495c58cbc070a6ed1bfd7421e2b99e7ba30 28-Nov-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10413589>

Fixed a potential crasher where we weren't checking we got a valid DIE in
a compile unit.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
75d8c2591f6c56a09338bf4967a41510165a907e 28-Nov-2011 Greg Clayton <gclayton@apple.com> CommandObjectProcess was recently changed to automatically use the platform
to launch a process for debugging. Since this isn't supported on all platforms,
we need to do what we used to do if this isn't supported. I added:

bool
Platform::CanDebugProcess ();

This will get checked before trying to launch a process for debugging and then
fall back to launching the process through the current host debugger. This
should solve the issue for linux and keep the platform code clean.

Centralized logging code for logging errors, warnings and logs when reporting
things for modules or symbol files. Both lldb_private::Module and
lldb_private::SymbolFile now have the following member functions:

void
LogMessage (Log *log, const char *format, ...);

void
ReportWarning (const char *format, ...);

void
ReportError (const char *format, ...);

These will all output the module name and object (if any) such as:

"error: lldb.so ...."
"warning: my_archive.a(foo.o) ...."

This will keep the output consistent and stop a lot of logging calls from
having to try and output all of the information that uniquely identifies
a module or symbol file. Many places in the code were grabbing the path to the
object file manually and if the module represented a .o file in an archive, we
would see log messages like:

error: foo.a - some error happened



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a1b9a90b7aef446302de9b845dc4f3b0e1473aa7 13-Nov-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10338439>

This is the actual fix for the above radar where global variables that weren't
initialized were not being shown correctly when leaving the DWARF in the .o
files. Global variables that aren't intialized have symbols in the .o files
that specify they are undefined and external to the .o file, yet document the
size of the variable. This allows the compiler to emit a single copy, but makes
it harder for our DWARF in .o files with the executable having a debug map
because the symbol for the global in the .o file doesn't exist in a section
that we can assign a fixed up linked address to, and also the DWARF contains
an invalid address in the "DW_OP_addr" location (always zero). This means that
the DWARF is incorrect and actually maps all such global varaibles to the
first file address in the .o file which is usually the first function. So we
can fix this in either of two ways: make a new fake section in the .o file
so that we have a file address in the .o file that we can relink, or fix the
the variable as it is created in the .o file DWARF parser and actually give it
the file address from the executable. Each variable contains a
SymbolContextScope, or a single pointer that helps us to recreate where the
variables came from (which module, file, function, etc). This context helps
us to resolve any file addresses that might be in the location description of
the variable by pointing us to which file the file address comes from, so we
can just replace the SymbolContextScope and also fix up the location, which we
would have had to do for the other case as well, and update the file address.
Now globals display correctly.

The above changes made it possible to determine if a variable is a global
or static variable when parsing DWARF. The DWARF emits a DW_TAG_variable tag
for each variable (local, global, or static), yet DWARF provides no way for
us to classify these variables into these categories. We can now detect when
a variable has a simple address expressions as its location and this will help
us classify these correctly.

While making the above changes I also noticed that we had two symbol types:
eSymbolTypeExtern and eSymbolTypeUndefined which mean essentially the same
thing: the symbol is not defined in the current object file. Symbol objects
also have a bit that specifies if a symbol is externally visible, so I got
rid of the eSymbolTypeExtern symbol type and moved all code locations that
used it to use the eSymbolTypeUndefined type.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
2546fd2a7adb2081e77ce6779e25646c0e3498a9 12-Nov-2011 Jim Ingham <jingham@apple.com> Add code that reads the APPLE_property debug info, and makes up properties from them.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
bc50070587fb4fceecbc6692a09ee05e0a59e157 11-Nov-2011 Greg Clayton <gclayton@apple.com> Added report errors for when the .apple_XXXX hashed name table lookups contain
invalid information. This will help us perfect the tables that are emitted by
clang.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
668a6c7050fb29a25d63ffeaad5b5fc3a0e0a142 10-Nov-2011 Greg Clayton <gclayton@apple.com> Made the Host::SetCrashDescription(const char *) function copy the incoming
string to avoid possible later crashes.

Modified the locations that do set the crash description to NULL out the
string when they are done doing their tasks.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
2581dbf7292c6272bb771fe396ab30921385d669 02-Nov-2011 Sean Callanan <scallanan@apple.com> Sometimes the debug information includes artifically-
generated special member functions (constructors,
destructors, etc.) for classes that don't really have
them. We needed to mark these as artificial to reflect
the debug information; this bug does that for
constructors and destructors.

The "etc." case (certain assignment operators, mostly)
remains to be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
716e3f07f6c41436b2845b172975fd45b456c8f0 01-Nov-2011 Sean Callanan <scallanan@apple.com> Added the capability (turned off for now) to mark a
method as __attribute__ ((used)) when adding it to a
class. This functionality is useful when stopped in
anonymous namespaces: expressions attached to classes
in anonymous namespaces are typically elided by Clang's
CodeGen because they have no namespaces are intended
not to be externally visible. __attribute__ ((used))
forces CodeGen to emit the function.

Right now, __attribute__ ((used)) causes the JIT not to
emit the function, so we're not enabling it until we
fix that.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b51693999473f5dc7cb9681bbbc4a65028eea35b 01-Nov-2011 Greg Clayton <gclayton@apple.com> Fixed some warnings after enabling some stricter warnings in the Xcode project
settings.

Also fixed an issue where we weren't creating anonymous namepaces correctly:
<rdar://problem/10371295>




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143403 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
18fedd7f4d22cf46d34698c1094ebc544a6f8bd8 28-Oct-2011 Greg Clayton <gclayton@apple.com> Added support for the C++Ox "nullptr_t" type.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
24a6bd9835ed1655984397b0cdf35127e47681e9 27-Oct-2011 Greg Clayton <gclayton@apple.com> Added support for the new ".apple_objc" accelerator tables. These tables are
in the same hashed format as the ".apple_names", but they map objective C
class names to all of the methods and class functions. We need to do this
because in the DWARF the methods for Objective C are never contained in the
class definition, they are scattered about at the translation unit level and
they don't even have attributes that say the are contained within the class
itself.

Added 3 new formats which can be used to display data:

eFormatAddressInfo
eFormatHexFloat
eFormatInstruction

eFormatAddressInfo describes an address such as function+offset and file+line,
or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants).
The format character for this is "A", the long format is "address".

eFormatHexFloat will print out the hex float format that compilers tend to use.
The format character for this is "X", the long format is "hex float".

eFormatInstruction will print out disassembly with bytes and it will use the
current target's architecture. The format character for this is "i" (which
used to be being used for the integer format, but the integer format also has
"d", so we gave the "i" format to disassembly), the long format is
"instruction".

Mate the lldb::FormatterChoiceCriterion enumeration private as it should have
been from the start. It is very specialized and doesn't belong in the public
API.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
5e8eb5c428e91b99f3884b53fc5deea0ecb001cd 26-Oct-2011 Greg Clayton <gclayton@apple.com> Fixed an issue where a class that resides inside another class wasn't getting
an access specifier set on it, causing an assertion to fire when building
with a Debug+Asserts build of clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
66756c2e6de990359f3e6f306bd16205b981dba7 25-Oct-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10335756>

Fixed an issue where bad DWARF from clang would get recycled from DWARF back
into types and cause clang to assert and die, killing the lldb binary, when
it tried to used the type in an expression.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f6a5bd78aaef0e4d477208289ace03cfa7f60649 22-Oct-2011 Greg Clayton <gclayton@apple.com> Added template support when parsing DWARF into types. We can now use STL
classes in the expression parser.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
bbe39167c881ac025cdc4f383ee8895cfd5b1148 21-Oct-2011 Greg Clayton <gclayton@apple.com> Fixed some issues where we might not have one of the new apple accelerator
tables (like the .apple_namespaces) and it would cause us to index DWARF that
didn't need to be indexed.

Updated the MappedHash.h (generic Apple accelerator table) and the DWARF
specific one (HashedNameToDIE.h) to be up to date with the latest and
greatest hash table format.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
444e35b5fdf15a25a427285650f06f1390e62c75 19-Oct-2011 Greg Clayton <gclayton@apple.com> Moved lldb::user_id_t values to be 64 bit. This was going to be needed for
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
4c8353bd5be6e5abcab8fe27965d477aace75cf2 19-Oct-2011 Greg Clayton <gclayton@apple.com> Changed lldb_private::Type over to use the intrusive ref counted pointers
so we don't have to lookup types in a type list by ID.

Changed the DWARF parser to remove the "can externally complete myself" bits
from the type when we are in the process of completing the type itself to
avoid an onslaught of external visible decl requests from the
clang::ExternalASTSource.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
5f24c5053d9fa99bd20e6b1e5b8c659c68d57be7 15-Oct-2011 Greg Clayton <gclayton@apple.com> Add function decls to their parent decl context.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
6364304894596829a96c8cd3b07b4ea5e00029da 14-Oct-2011 Greg Clayton <gclayton@apple.com> Make sure we create only unique one namespace per AST when parsing the DWARF.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
03fd0d013cbd82ddcb3053a5add8f1f9891eeec5 14-Oct-2011 Greg Clayton <gclayton@apple.com> Modified the DWARF parser to take care of a 1 clang::DeclContext to many
DIEs. Prior to this fix, there was a 1 to 1 mapping.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9f54ab7b1fb850e31c82c53d7e6967be8547e7ab 14-Oct-2011 Greg Clayton <gclayton@apple.com> Fixed a case where we might end up trying to parse a type in the DWARF parser for a method whose class isn't currently in the process of completing itself. Currently, methods of a class, must be parsed when the class type that contains the method is asked to complete itself through the clang::ExternalASTSource virtual functions. Now we "do the right thing" by checking if the class is being defined, and if so we parse it, else we tell the class to complete itself so everything happens correctly.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c839adc5a17c6736617ff3a2441857bf6c25f183 13-Oct-2011 Sean Callanan <scallanan@apple.com> Enabled the namespace-specific search functionality,
which had previously been commented out while I tested
it. It's not fully working yet, but it doesn't break
our testsuite and it's an important piece of
functionality.

Also added some logging to SymbolFileDWARF to help
diagnose entities that are found in a symbol file,
but do not reside in the expected namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a75970673121eb7cb4c947625235b8c201940fe2 13-Oct-2011 Sean Callanan <scallanan@apple.com> Moved the list of found namespaces into the search
context object. Having it populated and registered
within a single FindExternalVisibleDecls call worked
fine when there was only one call (i.e., when we were
just looking in the global namespace).

However, now FindExternalVisibleDecls is called for
nested namespaces as well, which means that it is
called not once but many times (once per module in
which the parent namespace appears). This means that
the namespace mapping is built up across many calls
to the inferior FindExternalVisibleDecls, so I moved
it into a data structure (the search context) that is
shared by all calls.

I also added some logging to make it easier to see
what is happening during a namespace search, and
cleaned up some existing logging.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
0fcec13c6639ab49216fa9447b25888b7bc9ff59 13-Oct-2011 Sean Callanan <scallanan@apple.com> Completed the glue that passes a ClangNamespaceDecl *
down through Module and SymbolVendor into SymbolFile.
Added checks to SymbolFileDWARF that restrict symbol
searches when a namespace is passed in.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
7a1e5da2bcea7ec37dff72591892015da1f9e125 13-Oct-2011 Greg Clayton <gclayton@apple.com> Add a version of ResolveFunction that takes a "const DWARFDebugInfoEntry *"
and a "DWARFCompileUnit *" to avoid doing a DIE lookup twice and to prepare
for using namespaces in the lookups.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
db29bba117a0ea75b89c1280722225a3197b4313 13-Oct-2011 Greg Clayton <gclayton@apple.com> Added a function to test if a ClangNamespaceDecl matches the current symbol
file. This will help us to minimize lookups that can't possibly match anything
in the current symbol file.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
82770e0df481f30c46fb7e905e99b45c1e6d31c8 13-Oct-2011 Greg Clayton <gclayton@apple.com> Added the ability to see if a DIE is contained in a namespace.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
7340919414ed3756f293e793f37c116072c6f69e 11-Oct-2011 Jim Ingham <jingham@apple.com> Remove a debugging printf...

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
52f794a7c9f148393297c8f50c3a10398041feb8 11-Oct-2011 Jim Ingham <jingham@apple.com> Fix a couple of places in FindFunctions where I was using the passed in name_type_mask
rather than the computed effective_name_type_mask.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
bc36a861b8e0b2f2dde34f27c9fa9629a357d598 08-Oct-2011 Greg Clayton <gclayton@apple.com> Added more functionality to Range template classes in RangeMap.h and converted remaining DWARF areas that were using ranges over to this class. Also converted lldb_private::Block to use it.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
8b7b2276132c7353cabd22000287b42badc26613 08-Oct-2011 Jim Ingham <jingham@apple.com> Move the responsibility for translating the various eFunctionNameType lookups to the
SymbolFIle (it was done mostly in the BreakpointResolverName resolver before.) Then
tailor our searches to the way the indexed maps are laid out. This removes a bunch
of test case failures using indexed dSYM's.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c7bbd271fba425130f82dfa028d68c92282e4fdc 06-Oct-2011 Greg Clayton <gclayton@apple.com> Added a new logging channel to the DWARF called "lookups":

(lldb) log enable dwarf lookups

This allows us to see when lookups are being done on functions, addresses,
and types by both name and regular expresssion.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b523031335a9c1c6c23c0789b5c6522a6a2e2ca1 06-Oct-2011 Greg Clayton <gclayton@apple.com> Stop spurious "DW_AT_specification(0x%8.8x) has no decl" warnings that were due to not parsing the function types when the function blocks are made and parsed.

Cached the Function object's m_type value after it has been calculated.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
00db215522a0cf31082d26d7ab30d2aa30965acf 05-Oct-2011 Greg Clayton <gclayton@apple.com> Enable all the new accelerator tables if they are present and don't manually
index the DWARF. Also fixed an issue with memory accelerator tables with a
size of 1 where we would loop infinitely.

Added support for parsing the new .apple_namespaces section which gives us a
memory hash table for looking up namespaces.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1913306529630b4b237370411f6ada49bfcb3347 01-Oct-2011 Greg Clayton <gclayton@apple.com> Print object names in case we have a .o file in a static archive when logging
DWARF errors and warnings.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f92d0dd8184d6e8f59bce1607c5cd448fcf318c6 30-Sep-2011 Greg Clayton <gclayton@apple.com> Removed some commented out code from the DWARF parser.

Also reduce the size of the lldb_private::Symbol objects by removing the
lldb_private::Function pointer that was in each symbol. Running Instruments
has shown that when debugging large applications with DWARF in .o files that
lldb_private::Symbol objects are one of the highest users of memory. No one
was using the Symbol::GetFunction() call anyway.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
6c19c8a7da08b89ee153d7091aa8641348e0482c 30-Sep-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10212450>

Don't parse function types all the time, only parse them lazily.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
ed11c1ebc344458c2bc83aa5b0bf6b3d0e2ef987 30-Sep-2011 Greg Clayton <gclayton@apple.com> Fixed an issue where a lexical block or inlined function might have bad debug
information generated for it. Say we have a concrete function "foo" which
has inlined function "a" which calls another inlined function "b":

foo
1 {
2 {
a ()
3 {
b ()
4 {

}
}
}
}

Sometimes we see the compiler generate an address range in the DWARF for "foo"
(block 1 above) as say [0x1000-0x1100). Then the range for "a" is something
like [0x1050-0x1060) (note that it is correctly scoped within the "foo"
address range). And then we get "b" which is a child of "a", yet the debug
info says it has a range of [0x1060-0x1080) (not contained within "a"). We now
detect this issue when making our blocks and add an extra range to "a".

Also added a new "lldb" logging category named "symbol" where we can find out
about symbol file errors and warnings.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
90b207927e95187f36afb32caf90867d56fc0a03 30-Sep-2011 Jim Ingham <jingham@apple.com> Centralize the warning reporting and use ReportWarning & ReportError everywhere we were using fprintf(stderr directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9a93fcd1c343560eb33770c2e73eb3bd431535d6 29-Sep-2011 Greg Clayton <gclayton@apple.com> If the new .apple_names and .apple_types DWARF accelerator tables
are available, we currently will still index the DWARF ourselves
and assert if the name lookups differ. This will help us transition
to the new accelerator tables and make sure they are workng before
we switch over entirely.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f6e3de2d877dc94120c72624a79e488c9bea5c35 28-Sep-2011 Greg Clayton <gclayton@apple.com> Convert over to the latest and greatest on disc accelerator
hash tables. Renamed the DWARF sections to ".apple_names" and
".apple_types" until we get more buy in from other vendors.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d6d47976b71187907c1cdeea86fabf7d5534314f 23-Sep-2011 Jim Ingham <jingham@apple.com> Added the ability to restrict breakpoints by function name, function regexp, selector
etc to specific source files.
Added SB API's to specify these source files & also more than one module.
Added an "exact" option to CompileUnit's FindLineEntry API.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
02e210cad27e36108bef493b798c2c1eb3b04cb8 17-Sep-2011 Greg Clayton <gclayton@apple.com> Removed the function:

ModuleSP
Module::GetSP();

Since we are now using intrusive ref counts, we can easily turn any
pointer to a module into a shared pointer just by assigning it.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
144188bc458a35997d2f2e52206ab69747439073 13-Sep-2011 Greg Clayton <gclayton@apple.com> Huge memory and performance improvements in the DWARF parser.

Address ranges are now split up into two different tables:
- one in DWARFDebugInfo that is compile unit specific
- one in each DWARFCompileUnit that has exact function DIE offsets

This helps keep the size of the aranges down since the main table will get
uniqued and sorted and have consecutive ranges merged. We then only parse the
compile unit one on demand once we have determined that a compile unit contains
the address in question. We also now use the .debug_aranges section if there
is one instead of always indexing the DWARF manually.

NameToDIE now uses a UniqueCStringMap<dw_offset> map instead of a std::map.
std::map is very bulky as each node has 3 pointers and the key and value types.
This gets our NameToDIE entry down to 12 bytes each instead of 48 which saves
us a lot of memory when we have very large DWARF.

DWARFDebugAranges now has a smaller footprint for each range it contains to
save on memory.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
fdf24efe672bf3fa041cdbebd2d7f406b11882bd 09-Sep-2011 Jim Ingham <jingham@apple.com> Move the SourceManager from the Debugger to the Target. That way it can store the per-Target default Source File & Line.
Set the default Source File & line to main (if it can be found.) at startup. Selecting the current thread & or frame resets
the current source file & line, and "source list" as well as the breakpoint command "break set -l <NUM>" will use the
current source file.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d74270e83908066c946d150faec9516349e1118b 02-Sep-2011 Greg Clayton <gclayton@apple.com> Added alpha .debug_names and .debug_types support in the DWARF parser.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c8cf5e234be554d4acb6ae644a8269c303c4f56e 02-Sep-2011 Greg Clayton <gclayton@apple.com> Added support for accessing and loading our new .debug_names and .debug_types
DWARF accelerator table sections to the DWARF parser. These sections are similar
to the .debug_pubnames and .debug_pubtypes, but they are designed to be hash tables
that are saved to disc in a way that the sections can just be loaded into memory
and used without any work on the debugger side. The .debug_pubnames and .debug_pubtypes
sections are not ordered, contain a copy of the name in the section itself which
makes these sections quite large, they only include publicly exported names (so no
static functions, no types defined inside functions), many compilers put different
information in them making them very unreliable so most debugger ignore these sections
and parse the DWARF on their own. The tables must also be parsed and sorted in order
to be used effectively. The new sections can be quickly loaded and very efficiently be used
to do name to DIE lookups with very little up front work. The format of these new
sections will be changing while we work out the bugs, but we hope to have really
fast name to DIE lookups soon.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
169c5fbc8cac8a0bd724bd18fd9d816ca3d6486a 27-Aug-2011 Jim Ingham <jingham@apple.com> Fix a bunch of places where we were passing Stream *'s but were
never checking them for NULL. Pass a reference instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
545489247a7b520dd603c9e5b0f0ef05a77ba9e3 26-Aug-2011 Jim Ingham <jingham@apple.com> Move DIE location reporting into the DWARFDebugInfo class, use it from there in SymbolFileDWARF::ParseType (and eventually in other interesting places as well.)

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9ecdaac6b0b2d3c6f9ec498fb94cbdeeee153ee7 26-Aug-2011 Jim Ingham <jingham@apple.com> Add logging to SymbolFileDWARF::ParseType so that we can tell the type/comp_unit/obj_file were being processed when something goes wrong...

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
24429c073cfabf6ce11e68f9b4f079e262c85bef 25-Aug-2011 Jim Ingham <jingham@apple.com> The Compilation Unit language was being stored in a variable called "class_language"... Changed that to "cu_language".

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
6c3e4af0a2ac87382d4c9dfffc12960a1456754c 16-Aug-2011 Greg Clayton <gclayton@apple.com> Fixed an issue where we could end up creating multiple
C++ methods for a function depending on how the DWARF was
created. Now we parse the class type from the definition,
and all methods that use DW_AT_specification or DW_AT_abstract_origin
attributes to point to the definition, now won't create
duplicate entries. This is in response to how clang++ creates
much different DWARF than gcc.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
35bcafbbe4a66ccbdadb6f3a387329d53ab7ab99 12-Aug-2011 Enrico Granata <granata.enrico@gmail.com> Taking care of an issue relating to mapping DeclContext's to DIE's

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
2e45b0c3f6a6021aa7c064f715144599a2a712a0 12-Aug-2011 Greg Clayton <gclayton@apple.com> Fixed the issue of a DW_TAG_subprogram in a DW_TAG_subprogram correctly this
time after recently backing out another fix.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
11afe6aa45a4a08e470d237578fab379b3af6cfd 12-Aug-2011 Greg Clayton <gclayton@apple.com> Backout previous fix that was designed to allow functions within functions
as this function is what parses the blocks for a function...



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
690f5e3cf31d3c47766a76c7f6b5df3d57fe3d49 12-Aug-2011 Greg Clayton <gclayton@apple.com> Fixed an assertion issue that can arise when a function
is contained inside a function.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c5dca6c656ffc94d2f958c56d7bc9076eac90783 12-Aug-2011 Greg Clayton <gclayton@apple.com> Fixed some issues with parsing C++ methods where our detection
was failing if the DWARF was laid out in a certain way. The way
we detect C++ classes is now more robust so that a class method
can be defined outside of the class and refer to a definition inside
the class with a DW_AT_specification or DW_AT_abstract_origin attribute.

Fixed a case in Thread.cpp where we were looking up info in the frame
when we didn't need to. This was from some changes to support external
editors. Now the info is only looked up if needed.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c617a4cb4a451be9d7e97d7af6e165d282b5390f 06-Aug-2011 Sean Callanan <scallanan@apple.com> This is an overhaul of the expression parser code
that detects what context the current expression is
meant to execute in. LLDB now properly consults
the method declaration in the debug information
rather than trying to hunt down the "this" or "self"
pointer by name, which can be misleading.

Other fixes include:

- LLDB now properly detects that it is inside
an inlined C++ member function.

- LLDB now allows access to non-const members when
in const code.

- The functions in SymbolFile that locate the
DeclContext containing a DIE have been renamed
to reflect what they actually do. I have added
new functions that find the DeclContext for the
DIE itself.

I have also introduced testcases for C++ and
Objective-C.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a83f8779ac614263d92959d2338e6e9f08d8f9fb 04-Aug-2011 Greg Clayton <gclayton@apple.com> Make sure we track CXX and objc method decls.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
99309909259eacf4693458bfe44f913c316a09c6 03-Aug-2011 Sean Callanan <scallanan@apple.com> Fixed a bug in which the DWARF reader did not distinguish
appropriately between C++ static methods and non-static
methods. This bug made it impossible to call most static
methods, either because Clang did not recognize that a
method could be called without providing a "this"
parameter, or because Clang did not properly mangle the
name of the method when searching for it in the target.

Also added a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9b6898f3ec1dedbe1dfc8bd7cd1d82a5b10e1bb0 30-Jul-2011 Sean Callanan <scallanan@apple.com> This change brings in the latest LLVM/Clang, and
completes the support in the LLDB expression parser
for incomplete types. Clang now imports types
lazily, and we complete those types as necessary.

Changes include:

- ClangASTSource now supports three APIs which it
passes to ClangExpressionDeclMap. CompleteType
completes a TagDecl or an ObjCInterfaceDecl when
needed; FindExternalVisibleDecls finds named
entities that are visible in the expression's
scope; and FindExternalLexicalDecls performs a
(potentially restricted) search for entities
inside a lexical scope like a namespace. These
changes mean that entities in namespaces should
work normally.

- The SymbolFileDWARF code for searching a context
for a specific name is now more general, and can
search arbitrary contexts.

- We are continuing to adapt our calls into LLVM
from interfaces that take start and end iterators
when accepting multiple items to interfaces that
use ArrayRef.

- I have cleaned up some code, especially our use
of namespaces.

This change is neutral for our testsuite and greatly
improves correctness for large programs (like Clang)
with complicated type systems. It should also lay
the groundwork for improving the expression parser's
performance as we are lazier and lazier about
providing type information.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
7dd98df0d69447d3f42b8044b7cda2c089aea653 12-Jul-2011 Greg Clayton <gclayton@apple.com> Added the ability to _not_ skip the prologue when settings breakpoints
by name by adding an extra parameter to the lldb_private::Target breakpoint
setting functions.

Added a function in the DWARF symbol file plug-in that can dump errors
and prints out which DWARF file the error is happening in so we can track
down what used to be assertions easily.

Fixed the MacOSX kernel plug-in to properly read the kext images and set
the kext breakpoint to watch for kexts as they are loaded.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
3f2e1b9a4a30cbb01721041da84ede822d2734aa 07-Jul-2011 Greg Clayton <gclayton@apple.com> Stop the lldb_private::RegularExpression class from implicitly
constructing itself and causing unexpected things to happen
in LLDB.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
801417e453f8531ac176cd952200587bf15d9ccf 07-Jul-2011 Greg Clayton <gclayton@apple.com> Added "target variable" command that allows introspection of global
variables prior to running your binary. Zero filled sections now get
section data correctly filled with zeroes when Target::ReadMemory
reads from the object file section data.

Added new option groups and option values for file lists. I still need
to hook up all of the options to "target variable" to allow more complete
introspection by file and shlib.

Added the ability for ValueObjectVariable objects to be created with
only the target as the execution context. This allows them to be read
from the object files through Target::ReadMemory(...).

Added a "virtual Module * GetModule()" function to the ValueObject
class. By default it will look to the parent variable object and
return its module. The module is needed when we have global variables
that have file addresses (virtual addresses that are specific to
module object files) and in turn allows global variables to be displayed
prior to running.

Removed all of the unused proxy object support that bit rotted in
lldb_private::Value.

Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code
with the more efficient "FileSpec::Equal (lhs, rhs)".

Improved logging in GDB remote plug-in.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b302b2f50e079b11a12ebafc29104c198f4f15e4 30-Jun-2011 Greg Clayton <gclayton@apple.com> Centralize all of the type name code so that we always strip the leading
"struct ", "class ", and "union " from the start of any type names that are
extracted from clang QualType objects. I had to fix test suite cases that
were expecting the struct/union/class prefix to be there.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e6d72ca9a6b22cd062136bbff039c3d8217f798a 25-Jun-2011 Greg Clayton <gclayton@apple.com> This commit adds broad architectural support for hierarchical
inspection of namespaces in the expression parser.

ClangExpressionDeclMap hitherto reported that namespaces had
been completely imported, even though the namespaces are
returned empty. To deal with this situation, ClangASTSource
was recently extended with an API to complete incomplete type
definitions, and, for greater efficiency, to complete these
definitions partially, returning only those objects that have
a given name.

This commit supports these APIs on LLDB's side, and uses it
to provide information on types resident in namespaces.
Namespaces are now imported as they were -- that is to say,
empty -- but with minimal import mode on. This means that
Clang will come back and request their contents by name as
needed. We now respond with information on the contained
types; this will be followed soon by information on functions
and variables.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1bd2b2feb7694e06b9a971063c283f9c490479d2 18-Jun-2011 Greg Clayton <gclayton@apple.com> Fixed variable parsing to not parse block variables over and over due to an
issue in the way block variables are marked as parsed. In the DWARF parser we
always parse all blocks for a function at once, so we can mark all blocks as
having all variables parsed and avoid recursive function calls to try and
reparse things that have already been handled.

Fixed an issue with how variables get scoped into blocks. The DWARF parser can
now handle abtract class definitions that contain concrete static variables.
When the concrete instance of the class functions get instantiated, they will
track down the concrete block for the abtract block and add the variable to
each block.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133302 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
63afdb07641f04aa7b60d895120b056124d3469b 17-Jun-2011 Greg Clayton <gclayton@apple.com> Improved the packet throughput when debugging with GDB remote by over 3x on
darwin (not sure about other platforms).

Modified the communication and connection classes to not require the
BytesAvailable function. Now the "Read(...)" function has a timeout in
microseconds.

Fixed a lot of assertions that were firing off in certain cases and replaced
them with error output and code that can deal with the assertion case.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
82f0746880b4a6b18bcf8666670140f5b4a56791 30-May-2011 Greg Clayton <gclayton@apple.com> lldb-59.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@132304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
87a58ce764030f37ed674577cbb900f42c677824 16-Apr-2011 Jim Ingham <jingham@apple.com> Work around a llvm gcc bug where the name of a reference doesn't include the "&".

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f1b73af504369d6f6eb113b98d77b06a3c8527d5 15-Mar-2011 Greg Clayton <gclayton@apple.com> Added a fix that should help incorrect type uniquing. There was an issue
for templatized types that could cause parts of a std::vector (and I am sure
other STL types) to be incorrectly uniqued to each other wreaking havoc on
variable display for types within the same executable module.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e4b9c1fb338ee1ada72e6a3c198afb342d68c5c1 08-Mar-2011 Greg Clayton <gclayton@apple.com> LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provide
an interface to a local or remote debugging platform. By default each host OS
that supports LLDB should be registering a "default" platform that will be
used unless a new platform is selected. Platforms are responsible for things
such as:
- getting process information by name or by processs ID
- finding platform files. This is useful for remote debugging where there is
an SDK with files that might already or need to be cached for debug access.
- getting a list of platform supported architectures in the exact order they
should be selected. This helps the native x86 platform on MacOSX select the
correct x86_64/i386 slice from universal binaries.
- Connect to remote platforms for remote debugging
- Resolving an executable including finding an executable inside platform
specific bundles (macosx uses .app bundles that contain files) and also
selecting the appropriate slice of universal files for a given platform.

So by default there is always a local platform, but remote platforms can be
connected to. I will soon be adding a new "platform" command that will support
the following commands:
(lldb) platform connect --name machine1 macosx connect://host:port
Connected to "machine1" platform.
(lldb) platform disconnect macosx

This allows LLDB to be well setup to do remote debugging and also once
connected process listing and finding for things like:
(lldb) process attach --name x<TAB>

The currently selected platform plug-in can now auto complete any available
processes that start with "x". The responsibilities for the platform plug-in
will soon grow and expand.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
04c9c7b03fbec6d0dcc6c848391147de2f129c66 17-Feb-2011 Greg Clayton <gclayton@apple.com> Clean up a bit of the type getting code where lldb_private:Type now has

clang_type_t
GetClangFullType(); // Get a completely defined clang type

clang_type_t
GetClangLayoutType(); // Get a clang type that can be used for type layout

clang_type_t
GetClangForwardType(); // A type that can be completed if needed, but is more efficient.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c3c4661c6a7527580e605dbb69bef7634971fe13 15-Feb-2011 Greg Clayton <gclayton@apple.com> All UnwindPlan objects are now passed around as shared pointers.

ArchDefaultUnwindPlan plug-in interfaces are now cached per architecture
instead of being leaked for every frame.

Split the ArchDefaultUnwindPlan_x86 into ArchDefaultUnwindPlan_x86_64 and
ArchDefaultUnwindPlan_i386 interfaces.

There were sporadic crashes that were due to something leaking or being
destroyed when doing stack crawls. This patch should clear up these issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
7bb069b2216523f21fb6a3ce867f2f7278b1b07b 10-Feb-2011 Greg Clayton <gclayton@apple.com> Modified version of a patch from Warren Paul that takes care of issues with
indirect forms, deals with empty DW_AT_comp_dir attributes, and fixups for
handling other signed integer types.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
a8d4241dcd129f289710c909491e0e80e7e3d732 09-Feb-2011 Greg Clayton <gclayton@apple.com> Added the DWARF unique type map such that we only create a type once in the
module's AST context. Prior to this fix, with gcc binaries, we end up with
a full class definition for any used classes in each compile unit due to the
one definition rule. This would result in us making N copies of class T, where
N is the number of compile units that use class T, in the module AST. When
an expression would then try and use any types that were duplicated, it would
quickly confuse clang and make expression evaluation fail due to all of the
duplicate types that got copied over. This is now fixed by making a map of
types in the DWARF that maps type names to a collection of types + declaration
(file + line number) + DIE. Then later when we find a type we look in this
module map and find any already cached types that we can just use.

8935777



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
52fd984f7e67c3a0ab18d5565f40356bcfa84822 02-Feb-2011 Greg Clayton <gclayton@apple.com> Modified the PluginManager to be ready for loading plug-ins from a system
LLDB plugin directory and a user LLDB plugin directory. We currently still
need to work out at what layer the plug-ins will be, but at least we are
prepared for plug-ins. Plug-ins will attempt to be loaded from the
"/Developer/Library/PrivateFrameworks/LLDB.framework/Resources/Plugins"
folder, and from the "~/Library/Application Support/LLDB/Plugins" folder on
MacOSX. Each plugin will be scanned for:

extern "C" bool LLDBPluginInitialize(void);
extern "C" void LLDBPluginTerminate(void);

If at least LLDBPluginInitialize is found, the plug-in will be loaded. The
LLDBPluginInitialize function returns a bool that indicates if the plug-in
should stay loaded or not (plug-ins might check the current OS, current
hardware, or anything else and determine they don't want to run on the current
host). The plug-in is uniqued by path and added to a static loaded plug-in
map. The plug-in scanning happens during "lldb_private::Initialize()" which
calls to the PluginManager::Initialize() function. Likewise with termination
lldb_private::Terminate() calls PluginManager::Terminate(). The paths for the
plug-in directories is fetched through new Host calls:

bool Host::GetLLDBPath (ePathTypeLLDBSystemPlugins, dir_spec);
bool Host::GetLLDBPath (ePathTypeLLDBUserPlugins, dir_spec);

This way linux and other systems can define their own appropriate locations
for plug-ins to be loaded.

To allow dynamic shared library loading, the Host layer has also been modified
to include shared library open, close and get symbol:

static void *
Host::DynamicLibraryOpen (const FileSpec &file_spec,
Error &error);

static Error
Host::DynamicLibraryClose (void *dynamic_library_handle);

static void *
Host::DynamicLibraryGetSymbol (void *dynamic_library_handle,
const char *symbol_name,
Error &error);

lldb_private::FileSpec also has been modified to support directory enumeration
in an attempt to abstract the directory enumeration into one spot in the code.
The directory enumertion function is static and takes a callback:


typedef enum EnumerateDirectoryResult
{
eEnumerateDirectoryResultNext, // Enumerate next entry in the current directory
eEnumerateDirectoryResultEnter, // Recurse into the current entry if it is a directory or symlink, or next if not
eEnumerateDirectoryResultExit, // Exit from the current directory at the current level.
eEnumerateDirectoryResultQuit // Stop directory enumerations at any level
};

typedef FileSpec::EnumerateDirectoryResult (*EnumerateDirectoryCallbackType) (void *baton,
FileSpec::FileType file_type,
const FileSpec &spec);

static FileSpec::EnumerateDirectoryResult
FileSpec::EnumerateDirectory (const char *dir_path,
bool find_directories,
bool find_files,
bool find_other,
EnumerateDirectoryCallbackType callback,
void *callback_baton);

This allow clients to specify the directory to search, and specifies if only
files, directories or other (pipe, symlink, fifo, etc) files will cause the
callback to be called. The callback also gets to return with the action that
should be performed after this directory entry. eEnumerateDirectoryResultNext
specifies to continue enumerating through a directory with the next entry.
eEnumerateDirectoryResultEnter specifies to recurse down into a directory
entry, or if the file is not a directory or symlink/alias to a directory, then
just iterate to the next entry. eEnumerateDirectoryResultExit specifies to
exit the current directory and skip any entries that might be remaining, yet
continue enumerating to the next entry in the parent directory. And finally
eEnumerateDirectoryResultQuit means to abort all directory enumerations at
all levels.

Modified the Declaration class to not include column information currently
since we don't have any compilers that currently support column based
declaration information. Columns support can be re-enabled with the
additions of a #define.

Added the ability to find an EmulateInstruction plug-in given a target triple
and optional plug-in name in the plug-in manager.

Fixed a few cases where opendir/readdir was being used, but yet not closedir
was being used. Soon these will be deprecated in favor of the new directory
enumeration call that was added to the FileSpec class.





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
28d5fcc3158aebf543e0f3d0a3608c1746f5ef15 27-Jan-2011 Greg Clayton <gclayton@apple.com> Changed the SymbolFile::FindFunction() function calls to only return
lldb_private::Function objects. Previously the SymbolFileSymtab subclass
would return lldb_private::Symbol objects when it was asked to find functions.

The Module::FindFunctions (...) now take a boolean "bool include_symbols" so
that the module can track down functions and symbols, yet functions are found
by the SymbolFile plug-ins (through the SymbolVendor class), and symbols are
gotten through the ObjectFile plug-ins.

Fixed and issue where the DWARF parser might run into incomplete class member
function defintions which would make clang mad when we tried to make certain
member functions with invalid number of parameters (such as an operator=
operator that had no parameters). Now we just avoid and don't complete these
incomplete functions.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
bdcb6abaa287df2c5f312c51d993c1d0b0cb120c 26-Jan-2011 Greg Clayton <gclayton@apple.com> Enabled extra warnings and fixed a bunch of small issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
78bce00166fee49ce77bd00d94899be697ef855a 25-Jan-2011 Greg Clayton <gclayton@apple.com> Fixed an issue that was stopping LLDB from finding complete definitions for
types. What was happening was the DWARF parser was almost ignoring definitions
(DIEs with the DW_AT_declaration set to 1). It wasn't ignoring declarations
that had _some_ children. When this happened, we would treat the declaration
as a complete type. Often we would have a declaration of a type with just
some enum definitions inside and nothing else. Now we correctly ignore these
definitions, and also I added some changes to allow us to figure out what
decl context these special declarations actually point to.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b01000fd063629facd45044f137446fb748ee179 17-Jan-2011 Greg Clayton <gclayton@apple.com> A few of the issue I have been trying to track down and fix have been due to
the way LLDB lazily gets complete definitions for types within the debug info.
When we run across a class/struct/union definition in the DWARF, we will only
parse the full definition if we need to. This works fine for top level types
that are assigned directly to variables and arguments, but when we have a
variable with a class, lets say "A" for this example, that has a member:
"B *m_b". Initially we don't need to hunt down a definition for this class
unless we are ever asked to do something with it ("expr m_b->getDecl()" for
example). With my previous approach to lazy type completion, we would be able
to take a "A *a" and get a complete type for it, but we wouldn't be able to
then do an "a->m_b->getDecl()" unless we always expanded all types within a
class prior to handing out the type. Expanding everything is very costly and
it would be great if there were a better way.

A few months ago I worked with the llvm/clang folks to have the
ExternalASTSource class be able to complete classes if there weren't completed
yet:

class ExternalASTSource {
....

virtual void
CompleteType (clang::TagDecl *Tag);

virtual void
CompleteType (clang::ObjCInterfaceDecl *Class);
};

This was great, because we can now have the class that is producing the AST
(SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources
and the object that creates the forward declaration types can now also
complete them anywhere within the clang type system.

This patch makes a few major changes:
- lldb_private::Module classes now own the AST context. Previously the TypeList
objects did.
- The DWARF parsers now sign up as an external AST sources so they can complete
types.
- All of the pure clang type system wrapper code we have in LLDB (ClangASTContext,
ClangASTType, and more) can now be iterating through children of any type,
and if a class/union/struct type (clang::RecordType or ObjC interface)
is found that is incomplete, we can ask the AST to get the definition.
- The SymbolFileDWARFDebugMap class now will create and use a single AST that
all child SymbolFileDWARF classes will share (much like what happens when
we have a complete linked DWARF for an executable).

We will need to modify some of the ClangUserExpression code to take more
advantage of this completion ability in the near future. Meanwhile we should
be better off now that we can be accessing any children of variables through
pointers and always be able to resolve the clang type if needed.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
0d62dfd4974eb23f550f992e594894b96c5696d1 14-Jan-2011 Greg Clayton <gclayton@apple.com> Fixed an error in the type map for "char **" that was a bad memory smasher.
Anytime we had a valid python list that was trying to go from Python down into
our C++ API, it was allocating too little memory and it ended up smashing
whatever was next to the allocated memory.

Added typemap conversions for "void *, size_t" so we can get
SBProcess::ReadMemory() working. Also added a typemap for "const void *, size_t"
so we can get SBProcess::WriteMemory() to work.

Fixed an issue in the DWARF parser where we weren't correctly calculating the
DeclContext for all types and classes. We now should be a lot more accurate.
Fixes include: enums should now be setting their parent decl context correctly.
We saw a lot of examples where enums in classes were not being properly
namespace scoped. Also, classes within classes now get properly scoped.

Fixed the objective C runtime pointer checkers to let "nil" pointers through
since these are accepted by compiled code. We also now don't call "abort()"
when a pointer doesn't validate correctly since this was wreaking havoc on
the process due to the way abort() works. We now just dereference memory
which should give us an exception from which we can easily and reliably
recover.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c4217a663232c014ee054f55bd90ece79803c963 07-Dec-2010 Sean Callanan <scallanan@apple.com> Fixes to make id work as well as well as fix minor errors
when calling built-ins.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b9f09a6188dc2b48bf7f5677bc1eef9a73c3fa25 06-Dec-2010 Sean Callanan <scallanan@apple.com> Fixed a bug in which the SEL type was being resolved
wrongly as the target of a pointer rather than the
SEL pointer itself. This caused incorrect behavior
when dealing with Objective-C selector variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
539d945ea975ebbbc5fceb632f7969e0ee55d24b 03-Dec-2010 Greg Clayton <gclayton@apple.com> Make sure to index the DWARF if we already haven't so we can resolve forward
declarations when they haven't been found yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1cee7ab7da6103eed3aca0922e61dab7ab2b1505 03-Dec-2010 Greg Clayton <gclayton@apple.com> Fixed an issue that would cause an assertion to fire when an inlined function was found during a regex function find call.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b4e19b388fb3a2c648ce3cdc6336e3b873bd3301 20-Nov-2010 Greg Clayton <gclayton@apple.com> When we resolve a forward declaration type, be sure to put it into the m_die_to_type map so we don't assert later when someone tries to resolve the type.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
8e69de4b9c55ec2eaebc62e4d987c2f0618ac431 20-Nov-2010 Jason Molenda <jmolenda@apple.com> Change the DWARFExpression::Evaluate methods to take an optional
RegisterContext* - normally this is retrieved from the ExecutionContext's
StackFrame but when we need to evaluate an expression while creating
the stack frame list this can be a little tricky.

Add DW_OP_deref_size, needed for the _sigtramp FDE expression.

Add support for processing DWARF expressions in RegisterContextLLDB.

Update callers to DWARFExpression::Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
bd4d7ba32ceae36f7ee3baa217d05bbcdb34a318 16-Nov-2010 Greg Clayton <gclayton@apple.com> Use different qualifier enums on the request of a clang engineer.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
2403b5e89760c1c970c3fe6936cb620d45dcf6c8 16-Nov-2010 Greg Clayton <gclayton@apple.com> First attempt and getting "const" C++ method function signatures correct.
It currently isn't working, but it should be close. I will work on this more
when I figure out what I am not doing correctly.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
3bc52d0a96c18be384028a90914f534ac252fbe4 14-Nov-2010 Greg Clayton <gclayton@apple.com> Just like functions can have a basename and a mangled/demangled name, variable
can too. So now the lldb_private::Variable class has support for this.

Variables now have support for having a basename ("i"), and a mangled name
("_ZN12_GLOBAL__N_11iE"), and a demangled name ("(anonymous namespace)::i").

Nowwhen searching for a variable by name, users might enter the fully qualified
name, or just the basename. So new test functions were added to the Variable
and Mangled classes as:

bool NameMatches (const ConstString &name);
bool NameMatches (const RegularExpression &regex);

I also modified "ClangExpressionDeclMap::FindVariableInScope" to also search
for global variables that are not in the current file scope by first starting
with the current module, then moving on to all modules.

Fixed an issue in the DWARF parser that could cause a varaible to get parsed
more than once. Now, once we have parsed a VariableSP for a DIE, we cache
the result even if a variable wasn't made so we don't do any re-parsing. Some
DW_TAG_variable DIEs don't have locations, or are missing vital info that
stops a debugger from being able to display anything for it, we parse a NULL
variable shared pointer for these DIEs so we don't keep trying to reparse it.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
feb6e56275a8a7a53336bdb957064e9093e8e170 14-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed a crasher (an assert was firing in the DWARF parser) when setting
breakpoints on inlined functions by name. This involved fixing the DWARF parser
to correctly back up and parse the concrete function when we find inlined
functions by name, then grabbing any appropriate inlined blocks and returning
symbol contexts with the block filled in. After this was fixed, the breakpoint
by name resolver needed to correctly deal with symbol contexts that had the
inlined block filled in in the symbol contexts.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e4b9df004d1fdd6ae10c9492fa0f504442829a10 13-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed an issue where we might not find global variables by name when we have
a debug map with DWARF in the .o files due to the attemted shortcut that was
being taken where the global variables were being searched for by looking in
the symbol table. The problem with the symbols in the symbol table is we don't
break apart the symbol names for symbols when they are mangled into basename
and the fully mangled name since this would take a lot of CPU time to chop up
the mangled names and try and find the basenames. The DWARF info typically has
this broken up for us where the basename of the variable is in a the DW_AT_name
attribute, and the mangled name is in the DW_AT_MIPS_linkage_name attribute.
Now we correctly find globals by searching all OSO's for the information so we
can take advantage of this split information.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
6916e358c9725b75ed91f31236c147f26c9af10e 13-Nov-2010 Greg Clayton <gclayton@apple.com> Modified the lldb_private::Type clang type resolving code to handle three
cases when getting the clang type:
- need only a forward declaration
- need a clang type that can be used for layout (members and args/return types)
- need a full clang type

This allows us to partially parse the clang types and be as lazy as possible.
The first case is when we just need to declare a type and we will complete it
later. The forward declaration happens only for class/union/structs and enums.
The layout type allows us to resolve the full clang type _except_ if we have
any modifiers on a pointer or reference (both R and L value). In this case
when we are adding members or function args or return types, we only need to
know how the type will be laid out and we can defer completing the pointee
type until we later need it. The last type means we need a full definition for
the clang type.

Did some renaming of some enumerations to get rid of the old "DC" prefix (which
stands for DebugCore which is no longer around).

Modified the clang namespace support to be almost ready to be fed to the
expression parser. I made a new ClangNamespaceDecl class that can carry around
the AST and the namespace decl so we can copy it into the expression AST. I
modified the symbol vendor and symbol file plug-ins to use this new class.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
07c55d1cd52dba2915e93481bb3c87076a80374c 11-Nov-2010 Greg Clayton <gclayton@apple.com> Disable the debug logging I accidentally left enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
d7cb26e87841731c6452a9f2e997ed0f9c92625c 11-Nov-2010 Greg Clayton <gclayton@apple.com> Added initial support to the lldb_private::SymbolFile for finding
namespaces by name given an optional symbol context. I might end up
dressing up the "clang::NamespaceDecl" into a lldb_private::Namespace
class if we need to do more than is currenlty required of namespaces.
Currently we only need to be able to lookup a namespace by name when
parsing expressions, so I kept it simple for now. The idea here is
even though we are passing around a "clang::NamespaceDecl *", that
we always have it be an opaque pointer (it is forward declared inside
of "lldb/Core/ClangForward.h") and we only use clang::NamespaceDecl
implementations inside of ClangASTContext, or ClangASTType when we need
to extract information from the namespace decl object.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e98ac25604b3d967158917f6fdd5289b3096fd80 10-Nov-2010 Greg Clayton <gclayton@apple.com> Modified lldb_private::SymboleFile to be able to override where its TypeList
comes from by using a virtual function to provide it from the Module's
SymbolVendor by default. This allows the DWARF parser, when being used to
parse DWARF in .o files with a parent DWARF + debug map parser, to get its
type list from the DWARF + debug map parser so when we go and find full
definitions for types (that might come from other .o files), we can use the
type list from the debug map parser. Otherwise we ended up mixing clang types
from one .o file (say a const pointer to a forward declaration "class A") with
the a full type from another .o file. This causes expression parsing, when
copying the clang types from those parsed by the DWARF parser into the
expression AST, to fail -- for good reason. Now all types are created in the
same list.

Also added host support for crash description strings that can be set before
doing a piece of work. On MacOSX, this ties in with CrashReporter support
that allows a string to be dispalyed when the app crashes and allows
LLDB.framework to print a description string in the crash log. Right now this
is hookup up the the CommandInterpreter::HandleCommand() where each command
notes that it is about to be executed, so if we crash while trying to do this
command, we should be able to see the command that caused LLDB to exit. For
all other platforms, this is a nop.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118672 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e5748d889fb7fb97b3ff07444894d7714776b609 10-Nov-2010 Greg Clayton <gclayton@apple.com> Did a lot of code cleanup.

Fixed the DWARF plug-in such that when it gets all attributes for a DIE, that
it omits the DW_AT_sibling and DW_AT_declaration when getting attributes
from a DW_AT_abstract_origin or DW_AT_specification DIE.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
57452832fdce249dd673710c5603a9b44c672d1b 09-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed an issue in the DWARF parser that was causing forward declarations
to not get resolved.

Fixed the "void **isa_ptr" variable inside the objective C verifier to start
with a '$' character so we don't go looking for it in our program.

Moved the lookup for "$__lldb_class" into the part that knows we are looking
for internal types that start with a '$'.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
cc6f7ccd61507b2f7ac0dbd63638df3fbcc14b00 08-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed some type parsing that was causing types to thing they were forward
declarations when they should have been.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
95e33b7b4b832ff5a8dfd0720fe6a100be894df6 07-Nov-2010 Greg Clayton <gclayton@apple.com> Modified the DWARF parser for both the single DWARF file and for the case
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9bcf31e9821fd303c793525e977b14025bbe3f50 01-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed globals not showing up for any but the first compile unit due to a
mismatch: I was using the compile unit user ID (the compile unit offset in
the DWARF) as the compile unit index.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
4ee40ac5bf435bea35e912b157884d0efd598338 30-Oct-2010 Sean Callanan <scallanan@apple.com> Added a hack that allows expressions to ignore
Objective-C member accessibility restrictions.
Ultimately Clang should have a flag that ignores
accessibility for Objective-C like it has one
for C++.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
3f5ee7fd6991891f0892bd71537763d9b59acd12 29-Oct-2010 Greg Clayton <gclayton@apple.com> Modified the lldb_private::TypeList to use a std::multimap for quicker lookup
by type ID (the most common type of type lookup).

Changed the API logging a bit to always show the objects in the OBJECT(POINTER)
format so it will be easy to locate all instances of an object or references
to it when looking at logs.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9bd7e354c07c7a807c89d787995b28d7a7f4ca25 28-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed the "frame variable -G NAME" that would print global
variables by name. It was accidentally getting all the globals
for the compile unit that contained the global variable named
NAME.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f3d0b0c8081691128626eb496fdfcbf8ae54c1de 27-Oct-2010 Greg Clayton <gclayton@apple.com> Updated the lldb_private::Flags class to have better method names and made
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
fcf06fb0b608f09477d7984938255ebf8f92d0da 15-Oct-2010 Greg Clayton <gclayton@apple.com> Separated the DWARF index for types from that the index of the namespaces
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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
fb7c51c07c249bd611051c76e4ff491f1a17cf2d 13-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed C++ class clang type creation and display by making sure we omit
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)".



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
ad60bf486dee699dd524225b63271ddc5b6329b9 12-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed the Objective C method prototypes to be correct (the selectors weren't
being chopped up correctly). The DWARF plug-in also keeps a map of the ObjC
class names to selectors for easy parsing of all class selectors when we parse
the class type.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
b433a3d8b910d571c0bcdcd5018778ac3763e703 01-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed an issue where if a method funciton was asked to be parsed before
its containing class was parsed, we would crash.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115343 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
30449d50f5328ca745d09d943b7e3b1ba41bff08 01-Oct-2010 Greg Clayton <gclayton@apple.com> Make C++ constructors and destructors correctly within the clang types we
generate from DWARF.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115268 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
ea58a3cfac7ff90cd86c707d65dbd7d345a12bbe 01-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed an issue where byte sizes were not able to be calculated for forward
declarations because we lost the original context which was needed to be
able to figure out the byte size.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
4b40711e7950310afb74835820eb669004cd8c44 30-Sep-2010 Greg Clayton <gclayton@apple.com> Cleaned up a unused member variable in Debugger.

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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
294553c0261cdaa71cab9323f6d17061165999a7 29-Sep-2010 Greg Clayton <gclayton@apple.com> 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
462d4147f3bb9141bf62d904f58a623db00669df 29-Sep-2010 Greg Clayton <gclayton@apple.com> Fixed the forward declaration issue that was present in the DWARF parser after
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1344e13127c8c23cc3578062720a286ae5b8805c 28-Sep-2010 Greg Clayton <gclayton@apple.com> Added a DIE to clang opaque type map.

Removed code that shouldn't have been checked in.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114932 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
4fb400f4dc762fb92f9dcf1f6a7656ed12b09a75 27-Sep-2010 Greg Clayton <gclayton@apple.com> Hooked up detach for ProcessGDBRemote.

Remove the GetUserData()/SetUserData() from the DWARFDebugInfoEntry
class. We now track everything with dense maps.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1d8173f1b622482bd6610cc34ffd5668b75cf7bd 24-Sep-2010 Greg Clayton <gclayton@apple.com> Added the ability to create an objective C method for an objective C
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++.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
47a5c4c01066ece2d41cba56c3a065eeca12d47c 23-Sep-2010 Sean Callanan <scallanan@apple.com> Updated to latest LLVM. Major LLVM changes:

- Sema is now exported (and there was much rejoicing.)

- Storage classes are now centrally defined.

Also fixed some bugs that the new LLVM picked up.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
412440aa3a110e4068ee99729f7883c828fb3dce 23-Sep-2010 Greg Clayton <gclayton@apple.com> Added motheds to C++ classes as we parse them to keep clang happy.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
2ea8f27fe76e30ba8fff1f58a50ad3e409e8a8ba 16-Sep-2010 Sean Callanan <scallanan@apple.com> Made CreateFunctionType static. Also fixed the spelling
for CreateParameterDeclaration.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
c4547c59f2e8390bdbf92484c851be06395b8e77 16-Sep-2010 Jim Ingham <jingham@apple.com> Add the ability to not resolve the name passed to FileSpec. Then don't resolve the names of compilation units found in DWARF.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
5fcff9ac1a713d5e814b4a05edef7544be470ad0 15-Sep-2010 Greg Clayton <gclayton@apple.com> 15-20% speed improvement when parsing DWARF. I used instruments to
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1924e2408687e0ee41976010c6b9410bdd01270d 15-Sep-2010 Greg Clayton <gclayton@apple.com> Fixed a missing newline when dumping mixed disassembly.

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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
74124754d6d8ffda5bdaef8ac87e7faaeef3b358 15-Sep-2010 Greg Clayton <gclayton@apple.com> So we can't use .debug_pubtypes as it, as designed, does not tell us about
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
178710cd4307f3d44dc76ebd70fc7daf7ebe17c5 14-Sep-2010 Greg Clayton <gclayton@apple.com> Looking at some of the test suite failures in DWARF in .o files with the
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".



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
aed588178b54d221ef1784862adeb5262d3612f2 13-Sep-2010 Greg Clayton <gclayton@apple.com> Added a work in the DWARF parser when we parse an array that ends up having
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e37f23c664f91f38b77029159b29dc62ca19bcb0 13-Sep-2010 Greg Clayton <gclayton@apple.com> Fixed a crash that would happen when using "frame variables" on any struct,
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
75ccf50c3371d8c8e293af25461705b86fb10a46 21-Aug-2010 Greg Clayton <gclayton@apple.com> Modified the host process monitor callback function Host::StartMonitoringChildProcess
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.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
35729d69ffc5d666ccb61f050a175716f5d06e98 20-Aug-2010 Jim Ingham <jingham@apple.com> Remove redundant call to ParseCompileUnitLineTable. The call to sc.comp_unit->GetLineTable() will parse the line table if it hasn't been read in.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
709c47379882ed56e367d442d9b459be73db5f1e 18-Aug-2010 Greg Clayton <gclayton@apple.com> Avoid an assertion crash by avoiding a circular dependency in the objective
C builtin type conversion.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
0007dfff776edec41a108a57d0a0924b1068977b 12-Aug-2010 Jim Ingham <jingham@apple.com> Few little fixes to reading in inlined functions. Also added a test case with some inlining.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
70a4f92d0e5f605c8ed1662fa959d465c96b0fb9 06-Aug-2010 Sean Callanan <scallanan@apple.com> Fixed namespace visibility problems that were
breaking the build for me on a non-internal
SnowLeopard system.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110412 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
960d6a40711f05effe6fcc5b66f0952450f79ea2 03-Aug-2010 Greg Clayton <gclayton@apple.com> Added support for objective C built-in types: id, Class, and SEL. This
involved watching for the objective C built-in types in DWARF and making sure
when we convert the DWARF types into clang types that we use the appropriate
ASTContext types.

Added a way to find and dump types in lldb (something equivalent to gdb's
"ptype" command):

image lookup --type <TYPENAME>

This only works for looking up types by name and won't work with variables.
It also currently dumps out verbose internal information. I will modify it
to dump more appropriate user level info in my next submission.

Hookup up the "FindTypes()" functions in the SymbolFile and SymbolVendor so
we can lookup types by name in one or more images.

Fixed "image lookup --address <ADDRESS>" to be able to correctly show all
symbol context information, but it will only show this extra information when
the new "--verbose" flag is used.

Updated to latest LLVM to get a few needed fixes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
9488b7423b556c7c777b721d2094fd5ec4a47578 28-Jul-2010 Greg Clayton <gclayton@apple.com> Created lldb::LanguageType by moving an enumeration from the
lldb_private::Language class into the enumerations header so it can be freely
used by other interfaces.

Added correct objective C class support to the DWARF symbol parser. Prior to
this fix we were parsing objective C classes as C++ classes and now that the
expression parser is ready to call functions we need to make sure the objective
C classes have correct AST types.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
84f8075072eef306234f8109573067647735c111 22-Jul-2010 Greg Clayton <gclayton@apple.com> Added a new enumeration named "ClangASTContext::AccessType" that abstracts the type creation from the various access enumerations in Clang. Currently there are clang::AccessSpecifier and the objective C ivars have their own enumeration. So I added a new enumeration that will allow a consistent interface when creating types through ClangASTContext.

I also added new functions to create an Objective C class, ivar and set an objective C superclass. They aren't hooked up in the DWARF parser yet. That is the next step, though I am unsure if I will do this in the DWARF parser or try and do it generically in the existing Record manipulation functions.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
32a8c7e02b84fbc36ee0fdb553002a1880c8d83e 22-Jul-2010 Greg Clayton <gclayton@apple.com> Modified both the ObjectFileMachO and ObjectFileELF to correctly set the
SectionType for Section objects for DWARF.

Modified the DWARF plug-in to get the DWARF sections by SectionType so we
can safely abstract the LLDB core from section names for the various object
file formats.

Modified the SectionType definitions for .debug_pubnames and .debug_pubtypes
to use the correct case.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
53d68e749f0715691a95f23e9490d97e484b15da 21-Jul-2010 Greg Clayton <gclayton@apple.com> Remove use of STL collection class use of the "data()" method since it isn't
part of C++'98. Most of these were "std::vector<T>::data()" and
"std::string::data()".



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
bef1583b89e73de77c8b0897fcf42b5b1fcabe4c 14-Jul-2010 Greg Clayton <gclayton@apple.com> I enabled some extra warnings for hidden local variables and for hidden
virtual functions and caught some things and did some general code cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
e9d0df45df0ee87623985d1e59947a2ca50c14ea 02-Jul-2010 Greg Clayton <gclayton@apple.com> More leaks detection:
- fixed 3 posix spawn attributes leaks
- fixed us always leaking CXXBaseSpecifier objects when we create class
base classes. Clang apparently copies the base classes we pass in.

Fixed some code formatting in ClangASTContext.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
12bec71b323dc520f0e985a86e09c4712559e115 28-Jun-2010 Greg Clayton <gclayton@apple.com> Added function name types to allow us to set breakpoints by name more
intelligently. The four name types we currently have are:

eFunctionNameTypeFull = (1 << 1), // The function name.
// For C this is the same as just the name of the function
// For C++ this is the demangled version of the mangled name.
// For ObjC this is the full function signature with the + or
// - and the square brackets and the class and selector
eFunctionNameTypeBase = (1 << 2), // The function name only, no namespaces or arguments and no class
// methods or selectors will be searched.
eFunctionNameTypeMethod = (1 << 3), // Find function by method name (C++) with no namespace or arguments
eFunctionNameTypeSelector = (1 << 4) // Find function by selector name (ObjC) names


this allows much more flexibility when setting breakoints:

(lldb) breakpoint set --name main --basename
(lldb) breakpoint set --name main --fullname
(lldb) breakpoint set --name main --method
(lldb) breakpoint set --name main --selector

The default:

(lldb) breakpoint set --name main

will inspect the name "main" and look for any parens, or if the name starts
with "-[" or "+[" and if any are found then a full name search will happen.
Else a basename search will be the default.

Fixed some command option structures so not all options are required when they
shouldn't be.

Cleaned up the breakpoint output summary.

Made the "image lookup --address <addr>" output much more verbose so it shows
all the important symbol context results. Added a GetDescription method to
many of the SymbolContext objects for the more verbose output.





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
f6e509ace18dbfcb494654914002b9d3658fd6b5 12-Jun-2010 Greg Clayton <gclayton@apple.com> Fixed an issue with the new DW_TAG_ptr_to_member_type changes where the clang type that was being created was using the pointee_type for both the class and the member pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
fa97069b86f30aa44bb23a1de506ae220359b4fa 12-Jun-2010 Greg Clayton <gclayton@apple.com> Anders Carlsson patch for member pointers. Thanks Anders.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
24943d2ee8bfaa7cf5893e4709143924157a5c1e 08-Jun-2010 Chris Lattner <sabre@nondot.org> Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp