Commit Graph

3959 Commits

Author SHA1 Message Date
Jim Ingham 60dbabbaa7 Add SBValue::GetDynamicValue and SBValue::GetStaticValue API's.
<rdar://problem/10545069>

llvm-svn: 146173
2011-12-08 19:44:08 +00:00
Sean Callanan 5780f9df56 Added the ability to dereference an Objective-C object
pointer to make the result of an expression.  LLDB now
dumps the ivars of the Objective-C object and all of
its parents.  This just required fixing a bug where we
didn't distinguish between Objective-C object pointers
and regular C-style pointers.

Also added a testcase to verify that this continues to
work.

llvm-svn: 146164
2011-12-08 19:04:34 +00:00
Peter Collingbourne dd3e9ccd04 libEnhancedDisassembly.a is gone from recent LLVM.
llvm-svn: 146148
2011-12-08 10:43:04 +00:00
Greg Clayton cab36a3a59 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.

llvm-svn: 146141
2011-12-08 05:16:30 +00:00
Greg Clayton a64e446e4c <rdar://problem/10544202>
Fixed detection of AVX on darwin now that our kernel supports it.

llvm-svn: 146135
2011-12-08 03:19:36 +00:00
Jim Ingham f80bc3f447 Get the bit-field offset & size for ObjC ivars that are bitfields.
<rdar://problem/10535460> lldb expression evaluation doesn't handle bit fields in ObjC classes properly

llvm-svn: 146134
2011-12-08 02:53:10 +00:00
Sean Callanan 56d6fdf695 Tightened up the variable list to deal with
variables that might not have valid names.

llvm-svn: 146133
2011-12-08 02:51:25 +00:00
Greg Clayton d1767f05b5 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. 

llvm-svn: 146130
2011-12-08 02:13:16 +00:00
Sean Callanan 6c62c83c12 Removed function information from the symbol table
for now to fix testcases.  Once we have a valid use
for the function information (i.e., once properties
returning UnknownAnyTy are allowed, once we read
return type information from the runtime, among
other uses) I will re-enable this.

llvm-svn: 146129
2011-12-08 02:08:40 +00:00
Jason Molenda a86588c4b0 Expose the DNBArchMachARM::DBG typedef, specify the type with the
class scoping in DumpDBGState()'s definiton.

llvm-svn: 146128
2011-12-08 01:59:17 +00:00
Greg Clayton 161f367047 Don't crash due to not checking log shared pointer.
llvm-svn: 146126
2011-12-08 01:32:28 +00:00
Sean Callanan 610baf42ce Fixed a few details of method lookup in Objective-C
symbols.  Now we find the correct method.

Unfortunately we don't get the superclass from the
runtime yet so the method doesn't import correctly
(and I added a check to make sure that doesn't hurt
us) but once we get that information right we will
report methods correctly to the parser as well.

Getting superclass information requires a common AST
context for all Objective-C runtime information,
meaning that the superclass and the subclass are in
the same AST context in all cases.  That is the next
thing that needs to be done here.

llvm-svn: 146089
2011-12-07 22:39:39 +00:00
Eli Friedman 00fda923b6 Fix <title> on webpage.
llvm-svn: 146085
2011-12-07 22:09:43 +00:00
Sean Callanan ae6d614118 Fixed a potential crasher if the frame is not
avalable when a global variable is looked up.
In ClangExpressionDeclMap, a frame should usually
be available.

llvm-svn: 146066
2011-12-07 20:41:47 +00:00
Jim Ingham b35274095c Fix assert string to be more informative.
llvm-svn: 146061
2011-12-07 20:10:58 +00:00
Johnny Chen 1669f67776 Modified the script to have the flexibility of specifying the gdb executable path
for use in the benchmark against lldb's disassembly speed.  Note that the lldb
executable path can already be specified using the LLDB_EXEC env variable.

rdar://problem/7511194

llvm-svn: 146050
2011-12-07 19:27:06 +00:00
Jason Molenda 42bb552c7e Use the shorter form of the LLDB framework binary path.
llvm-svn: 145982
2011-12-06 22:48:52 +00:00
Johnny Chen 5700922945 Add a typedef for arm_debug_state_t as DBG. Plus some minor comment changes.
llvm-svn: 145978
2011-12-06 22:19:09 +00:00
Greg Clayton 09c3e3d7f5 <rdar://problem/10487848>
Protect a member variable from being modified by multiple threads.

llvm-svn: 145920
2011-12-06 04:51:14 +00:00
Jason Molenda 5e2192adb5 Skip over lldb-93.
llvm-svn: 145917
2011-12-06 04:21:20 +00:00
Sean Callanan 0eed0d42a0 As part of the work to make Objective-C type information
from symbols more accessible, I have added a second
map to the ClangASTImporter: the ObjCInterfaceMetaMap.
This map keeps track of all type definitions found for
a particular Objective-C interface, allowing the
ClangASTSource to refer to all possible sources when
looking for method definitions.

There is a bug in lookup that I still need to figure out,
but after that we should be able to report full method
information for Objective-C classes shown in symbols.

Also fixed some errors I ran into when enabling the maps
for the persistent type store.  The persistent type store
previously did not use the ClangASTImporter to import
types, instead using ASTImporters that got allocated each
time a type needed copying.  To support the requirements
of the persistent type store -- namely, that types must be
copied, completed, and then completely severed from their
origin in the parser's AST context (which will go away) --
I added a new function called DeportType which severs all
these connections.

llvm-svn: 145914
2011-12-06 03:41:14 +00:00
Sean Callanan 853604d596 Set a flag on the AST type dump to see Objective-C
methods.  The Clang dump is now much more verbose,
but when somebody types "target modules lookup -t"
that is typically what they're looking for.

llvm-svn: 145892
2011-12-06 01:44:41 +00:00
Jim Ingham 7d1c115d2e Correct typo in method name (AddSymbolFileRepresendation...)
llvm-svn: 145884
2011-12-06 01:07:22 +00:00
Jim Ingham ac01260545 Sanity check the inputs to SBCommandInterpreter::HandleCompletion
llvm-svn: 145840
2011-12-05 19:24:15 +00:00
Sean Callanan 458bba71be Because we now call StartTagDeclarationDefinition()
and CompleteTagDeclarationDefinition() on Objective-C
interfaces populated by SymbolFileSymtab::FindTypes(),
we should mark the interface as forward-declared when
we create it.

llvm-svn: 145825
2011-12-05 18:49:06 +00:00
Greg Clayton 2a4c2f7998 Bumped Xcode project version for lldb-92.
llvm-svn: 145814
2011-12-05 17:41:20 +00:00
Greg Clayton 3649ef008d Fixed the remaining test suite failures after the recent objective C cleanup
and fixes we did. Now that objective C classes are represented by symbols with
their own type, there were a few more places in the objective C code that needed
to be fixed when searching for dynamic types.

Cleaned up the objective C runtime plug-in a bit to not keep having to create
constant strings and make one less memory access when we find an "isa" in the
objective C cache.

llvm-svn: 145799
2011-12-05 06:07:35 +00:00
Greg Clayton 1075acafeb Added the ability for clients to grab a set of symbol table indexes and then
add them to a fast lookup map. lldb_private::Symtab now export the following
public typedefs:

namespace lldb_private {

	class Symtab {
		typedef std::vector<uint32_t> IndexCollection;
		typedef UniqueCStringMap<uint32_t> NameToIndexMap;
	};
}

Clients can then find symbols by name and or type and end up with a 
Symtab::IndexCollection that is filled with indexes. These indexes can then
be put into a name to index lookup map and control if the mangled and 
demangled names get added to the map:

bool add_demangled = true;
bool add_mangled = true;
Symtab::NameToIndexMap name_to_index;
symtab->AppendSymbolNamesToMap (indexes, add_demangled, add_mangled, name_to_index).

This can be repeated as many times as needed to get a lookup table that
you are happy with, and then this can be sorted:

name_to_index.Sort();

Now name lookups can be done using a subset of the symbols you extracted from
the symbol table. This is currently being used to extract objective C types
from object files when there is no debug info in SymbolFileSymtab.

Cleaned up how the objective C types were being vended to be more efficient
and fixed some errors in the regular expression that was being used.

llvm-svn: 145777
2011-12-03 20:02:42 +00:00
Greg Clayton 901c5ca15b 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.

llvm-svn: 145759
2011-12-03 04:40:03 +00:00
Sean Callanan bfaf54d665 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.

llvm-svn: 145758
2011-12-03 04:38:43 +00:00
Greg Clayton dfb6dc9187 Added a code for a test to find the real Objective C class definition. I
still need to write the test case file.

llvm-svn: 145756
2011-12-03 04:35:51 +00:00
Sean Callanan 3b107b172d Added ClangExternalASTSourceCommon, a local superclass
for all our external AST sources that lets us associate
arbitrary flags with the types we put into the AST
contexts.  Also added an API on ClangASTContext that
allows access to these flags given only an ASTContext
and a type.

Because we don't have access to RTTI, and because at
some point in the future we might encounter external
AST sources that we didn't make (so they don't subclass
ClangExternalASTSourceCommon) I added a magic number
that we check before doing anything else, so that we
can catch that problem as soon as it appears.

llvm-svn: 145748
2011-12-03 03:15:28 +00:00
Greg Clayton ef3ad87ac6 Remove accidental "else" that was left in in prior checking.
llvm-svn: 145746
2011-12-03 03:02:17 +00:00
Greg Clayton 456809c161 Added new symbol types for Objective C classes, metaclasses, and ivars. Each
object file can correctly make these symbols which will abstract us from the
file format and ABI and we can then ask for the objective C class symbol for
a class and find out which object file it was defined in.

llvm-svn: 145744
2011-12-03 02:30:59 +00:00
Jim Ingham 25f6670003 Make the ThreadPlanStepThrough set a backstop breakpoint on the return address from
the function it is being asked to step through, so that even if we get the trampoline
target wrong (for instance) we will still not lose control.

The other fix here is to tighten up the handling of the case where the current plan
doesn't explain the stop, but a plan above us does.  In that case, if the plan that
does explain the stop says it is done, we need to clean up the plans below it and 
continue on with our processing.

llvm-svn: 145740
2011-12-03 01:52:59 +00:00
Greg Clayton c91d804af9 Fixed some extra warnings that show up with the new clang.
llvm-svn: 145735
2011-12-03 00:46:21 +00:00
Greg Clayton 934cb05e40 <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.

llvm-svn: 145733
2011-12-03 00:27:05 +00:00
Johnny Chen 5daa6de433 Let's also record the compiler version used for compiling the inferior into the session info
llvm-svn: 145732
2011-12-03 00:16:59 +00:00
Greg Clayton 4c3b8fb7e6 <rdar://problem/10410131>
Fixed an issue that could cause an infinite recursion when using "type filter".

llvm-svn: 145720
2011-12-02 22:48:25 +00:00
Sean Callanan 3ed3bca38e Modified the Objective-C type map in SymbolFileSymtab
to use ConstStrings.  The const char*s were assumed to
be from ConstStrings before, but since storing a full-on
ConstString is no more expensive than storing a const
char* it makes better sense to enforce uniqueness with
the type checker.

llvm-svn: 145688
2011-12-02 18:06:45 +00:00
Sean Callanan 596ab8ee08 Added support for extracting method information from
Objective-C symbols.  The methods aren't used yet if
there is a competing definition in the DWARF; I will
resolve that next.

llvm-svn: 145675
2011-12-02 03:41:39 +00:00
Greg Clayton 1ba6cfd1e6 After moving lldb::pid_t to 64 bits, keep a deprecated version around for
previous binaries that link against this for a few builds to make sure we
can continue to run against previous binaries.

llvm-svn: 145668
2011-12-02 02:10:57 +00:00
Greg Clayton e04741d03a <rdar://problem/10394517>
Fixed templates with NonTypeTemplateParmDecl objects. For example:

template <unsigned N>
....

This fixes SmallVector and all of the other classes that have template params
that are non types.

llvm-svn: 145667
2011-12-02 02:09:28 +00:00
Jim Ingham 6d6d107167 "f" should be an alias for "frame select" not "finish" to match the gdb usage.
llvm-svn: 145660
2011-12-02 01:12:59 +00:00
Greg Clayton 61e7a58c0c Process IDs (lldb::pid_t) and thread IDs (lldb::tid_t) are now 64 bit. This
will allow us to represent a process/thread ID using a pointer for the OS
plug-ins where they might want to represent the process or thread ID using
the address of the process or thread structure.

llvm-svn: 145644
2011-12-01 23:28:38 +00:00
Sean Callanan e0a64f7302 Modified clients of ClangASTImporter to be more robust
in the face of failures to import types, since blithely
passing on NULL types can sometimes lead to trouble.

Also eliminated a use of getAs and replaced it with
dyn_cast, which is more robust.

llvm-svn: 145628
2011-12-01 21:04:37 +00:00
Jim Ingham 87c665fb8d Protect a few log->Printf calls with "if (log)"...
llvm-svn: 145625
2011-12-01 20:26:15 +00:00
Sean Callanan a5230ce303 Picked up a new revision of Clang to pull in Objective-C
enhancements.  With these enhancements, the return values
of Objective-C methods with unknown return types can be
implicitly cast to id for the purpose of making method
calls.

So what would have required this:

(int)[(id)[ClassWithNoDebugInfo methodReturningObject] methodReturningInt]

can now be written as:

(int)[[ClassWithNoDebugInfo methodReturningObject] methodReturningInt]

llvm-svn: 145567
2011-12-01 04:31:46 +00:00
Greg Clayton eaeaf6f906 <rdar://problem/10507811>
Avoid a crash for the new DW_OP_stack_value and DW_OP_implicit_value opcodes
that was due to an assertion.

llvm-svn: 145564
2011-12-01 04:06:15 +00:00
Greg Clayton b1a0292240 Bumping Xcode project version for lldb-91.
llvm-svn: 145561
2011-12-01 03:52:18 +00:00