History log of /external/lldb/include/lldb/Symbol/Type.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
8c3391ba76c5e3440a0cc10296dbde1b44300509 19-Jun-2013 Enrico Granata <egranata@apple.com> <rdar://problem/14194128>

ClangASTContext was failing to retrieve fields and base class info for ObjC variables
This checkin fixes that and adds a test case



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@184248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
1a469c75c0597abc2a9abdf86b624b2e71ea8650 23-Jan-2013 Enrico Granata <egranata@apple.com> <rdar://problem/12711206>

Extending ValueObjectDynamicValue so that it stores a TypeAndOrName instead of a TypeSP.
This change allows us to reflect the notion that a ValueObject can have a dynamic type for which we have no debug information.
Previously, we would coalesce that to the static type of the object, potentially losing relevant information or even getting it wrong.
This fix ensures we can correctly report the class name for Cocoa objects whose types are hidden classes that we know nothing about (e.g. __NSArrayI for immutable arrays).
As a side effect, our --show-types argument to frame variable no longer needs to append custom dynamic type information.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
1b888f8af37eb363d5026ee1bd3eea409be8eae3 12-Nov-2012 Greg Clayton <gclayton@apple.com> New compiler warnings caught issues with the m_encoding_uid field that should have been a lldb::user_id_t type, but was a uint32_t a long time ago and never got updated.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167774 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
ef22b90240618ed8056dac14a756dff574f8218a 24-Oct-2012 Greg Clayton <gclayton@apple.com> Objective C cleanup. Removed an cache that was no longer needed and changes the code that gets the dynamic type and class name to use our new Objective C cache.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@166512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
b9bd4eeeb21dc4d634a61d00fa68f62c630bd38c 22-Oct-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12473003>

Allow type searches to specify a type keyword when searching for type. Currently supported type keywords are: struct, class, union, enum, and typedef.

So now you can search for types with a string like "struct foo".



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@166420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
f6132ef983e8a5b98fbe5e184f5128eff8c04730 01-Aug-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11275622>

Added new API to lldb::SBTypeMember for bitfields:

bool SBTypeMember::IsBitfield();
uint32_t SBTypeMember::GetBitfieldSizeInBits();

Also added new properties for easy access. Now SBTypeMember objects in python have a "fields" property for all type fields, "bases" for all direct bases, "vbases" for all virtual base classes and "members" for a combo of all three organized by bit offset. They all return a python list() of SBTypeMember objects. Usage:
(lldb) script
>>> t = lldb.target.FindFirstType("my_type")
>>> for field in t.fields:
... print field
>>> for vbase in t.vbases:
... print vbase
>>> for base in t.bases:
... print base
>>> for member in t.members:
... print member

Also added new "is_bitfield" property to the SBTypeMember objects that will return the result of SBTypeMember::IsBitfield(), and "bitfield_bit_size" which will return the result of SBTypeMember::GetBitfieldSizeInBits();

I also fixed "SBTypeMember::GetOffsetInBytes()" to return the correct byte offset.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
0cbaacd31bce2f37aaa9ecb2f31b3e8bf84d25b4 15-May-2012 Greg Clayton <gclayton@apple.com> Modified "image lookup -t <typename>" to expand typedefs.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
598df88bd6fc33c6fb330bc859bdc277795501f3 14-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10434005>

Prepare LLDB to be built with C++11 by hiding all accesses to std::tr1 behind
macros that allows us to easily compile for either C++.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
d760907c1d42726fa0c8c48efa28385ed339bb94 17-Feb-2012 Enrico Granata <granata.enrico@gmail.com> Adding formatters for several useful Objective-C/Cocoa data types. The new categories are not enabled at startup, but can be manually activated if desired.
Adding new API calls to SBValue to be able to retrieve the associated formatters
Some refactoring to FormatNavigator::Get() in order to shrink its size down to more manageable terms (a future, massive, refactoring effort will still be needed)
Test cases added for the above


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
f03d97e519811a029578cc120a7a2725cdf2aad1 12-Jan-2012 Jim Ingham <jingham@apple.com> Discriminate between the lldb_private::Type's for ObjC Classes that come from debug info, and those that
are made up from the ObjC runtime symbols. For now the latter contain nothing but the fact that the name
describes an ObjC class, and so are not useful for things like dynamic types.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@148059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
96154be69fa240a662419183ed08e1cfc5418164 13-Nov-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10126482>

Fixed an issues with the SBType and SBTypeMember classes:
- Fixed SBType to be able to dump itself from python
- Fixed SBType::GetNumberOfFields() to return the correct value for objective C interfaces
- Fixed SBTypeMember to be able to dump itself from python
- Fixed the SBTypeMember ability to get a field offset in bytes (the value
being returned was wrong)
- Added the SBTypeMember ability to get a field offset in bits


Cleaned up a lot of the Stream usage in the SB API files.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144493 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
d68e089f8353eaf845c3559dac6d47b32830974f 10-Sep-2011 Greg Clayton <gclayton@apple.com> Added the ability to introspect types thourgh the public SBType interface.

Fixed up many API calls to not be "const" as const doesn't mean anything to
most of our lldb::SB objects since they contain a shared pointer, auto_ptr, or
pointer to the types which circumvent the constness anyway.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
0fb0bcc9d4e951145e1b8c783652224c09b23af4 04-Aug-2011 Greg Clayton <gclayton@apple.com> Cleaned up the SBType.h file to not include internal headers and reorganized
the SBType implementation classes.

Fixed LLDB core and the test suite to not use deprecated SBValue APIs.

Added a few new APIs to SBValue:

int64_t
SBValue::GetValueAsSigned(int64_t fail_value=0);

uint64_t
SBValue::GetValueAsUnsigned(uint64_t fail_value=0)




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
979e20d127335143ffc89c2e37ec3a8b717ff22d 29-Jul-2011 Enrico Granata <granata.enrico@gmail.com> Public API changes:
- Completely new implementation of SBType
- Various enhancements in several other classes
Python synthetic children providers for std::vector<T>, std::list<T> and std::map<K,V>:
- these return the actual elements into the container as the children of the container
- basic template name parsing that works (hopefully) on both Clang and GCC
- find them in examples/synthetic and in the test suite in functionalities/data-formatter/data-formatter-python-synth
New summary string token ${svar :
- the syntax is just the same as in ${var but this new token lets you read the values
coming from the synthetic children provider instead of the actual children
- Python providers above provide a synthetic child len that returns the number of elements
into the container
Full bug fix for the issue in which getting byte size for a non-complete type would crash LLDB
Several other fixes, including:
- inverted the order of arguments in the ClangASTType constructor
- EvaluationPoint now only returns SharedPointer's to Target and Process
- the help text for several type subcommands now correctly indicates argument-less options as such


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
ef80aabe53b7fdf61309ba6d3d6865c94c681345 02-May-2011 Jim Ingham <jingham@apple.com> Adding support for fetching the Dynamic Value for ObjC Objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
b344843f75ef893762c93fd0a22d2d45712ce74d 24-Mar-2011 Greg Clayton <gclayton@apple.com> Fixed the LLDB build so that we can have private types, private enums and
public types and public enums. This was done to keep the SWIG stuff from
parsing all sorts of enums and types that weren't needed, and allows us to
abstract our API better.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
00c3ae7dac4cf9654d1569735c41e58fb2fd8969 21-Jan-2011 Greg Clayton <gclayton@apple.com> Fixed up the SBValue::GetExpressionPath() to be more correct under more
circumstances.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
bf8e42b9da0e1c6349a727d644ad37610b00d556 15-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed an expression parsing issue where if you were stopped somewhere without
debug information and you evaluated an expression, a crash would occur as a
result of an unchecked pointer.

Added the ability to get the expression path for a ValueObject. For a rectangle
point child "x" the expression path would be something like: "rect.top_left.x".
This will allow GUI and command lines to get ahold of the expression path for
a value object without having to explicitly know about the hierarchy. This
means the ValueObject base class now has a "ValueObject *m_parent;" member.
All ValueObject subclasses now correctly track their lineage and are able
to provide value expression paths as well.

Added a new "--flat" option to the "frame variable" to allow for flat variable
output. An example of the current and new outputs:

(lldb) frame variable
argc = 1
argv = 0x00007fff5fbffe80
pt = {
x = 2
y = 3
}
rect = {
bottom_left = {
x = 1
y = 2
}
top_right = {
x = 3
y = 4
}
}
(lldb) frame variable --flat
argc = 1
argv = 0x00007fff5fbffe80
pt.x = 2
pt.y = 3
rect.bottom_left.x = 1
rect.bottom_left.y = 2
rect.top_right.x = 3
rect.top_right.y = 4


As you can see when there is a lot of hierarchy it can help flatten things out.
Also if you want to use a member in an expression, you can copy the text from
the "--flat" output and not have to piece it together manually. This can help
when you want to use parts of the STL in expressions:

(lldb) frame variable --flat
argc = 1
argv = 0x00007fff5fbffea8
hello_world._M_dataplus._M_p = 0x0000000000000000
(lldb) expr hello_world._M_dataplus._M_p[0] == '\0'




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
0bda40346c10604b3cef2e42bef4f4d6f534e18b 20-Aug-2010 Jim Ingham <jingham@apple.com> Add an accessor to get the Declaration for a type.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
1674b12bbc3dae7b9543b8c5f958e90ddc767fa4 22-Jul-2010 Greg Clayton <gclayton@apple.com> Change over to using the definitions for mach-o types and defines to the
defines that are in "llvm/Support/MachO.h". This should allow ObjectFileMachO
and ObjectContainerUniversalMachO to be able to be cross compiled in Linux.

Also did some cleanup on the ASTType by renaming it to ClangASTType and
renaming the header file. Moved a lot of "AST * + opaque clang type *"
functionality from lldb_private::Type over into ClangASTType.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h
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/include/lldb/Symbol/Type.h