There are still a bunch of dependencies on the plug-in, but this helps to
identify them.
There are also a few more bits we need to move (and abstract, for example the
ClangPersistentVariables).
llvm-svn: 248612
See:
https://llvm.org/bugs/show_bug.cgi?id=24926
for details. On OS X, when LLDB.framework is
not part of the lldb.dylib path, the supporting
executable path is resolved to be the bin directory
sitting next to the lib directory with the dylib
lives. Not a perfect solution, but we also can't
base it on the executable path since both Python
and the lldb driver can be the executable.
llvm-svn: 248545
Summary: This is no longer needed as this file no longer calls backtrace().
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13049
llvm-svn: 248457
And remove the switch default, so that the -Wcovered-switch-default
warning will catch new types next time they're added.
Differential Revision: http://reviews.llvm.org/D13096
llvm-svn: 248414
Summary:
With this change DWARFASTParserClang::CompleteTypeFromDWARF returns false if
DWARFASTParserClang::ParseChildMembers returns false. Similarly, it returns
false if any base class is of an incomplete type. This helps in cases like
these:
class Foo
{
public:
std::string str;
};
...
Foo f;
If a file with the above code is compiled with a modern clang but without
the -fno-limit-debug-info (or similar) option, then the DWARF has only
a forward declration for std::string. In which case, the type for
"class Foo" cannot be completed. If LLDB does not detect that a child
member has incomplete type, then it wrongly conveys to clang (the LLDB
compiler) that "class Foo" is complete, and consequently crashes due to
an assertion failure in clang when running commands like "p f" or
"frame var f".
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13066
llvm-svn: 248401
Summary:
The following situation occured in TestAttachResume:
The inferior was stoped at a breakpoint and we did a continue, immediately followed by a detach.
Since there was a trap instruction under the IP, the continue did a step-over-breakpoint before
resuming the inferior for real. In some cases, the detach command was executed between these two
events (after the step-over stop, but before continue). Here, public state was running, but
private state was stopped. This caused a problem because HaltForDestroyOrDetach was checking the
public state to see whether it needs to stop the process (call Halt()), but Halt() was checking
the private state and concluded that there is nothing for it to do.
Solution: Instead of Halt() call SendAsyncInterrupt(), which will then cause Halt() to be
executed in the context of the private state thread. I also rename HaltForDestroyOrDetach to
reflect it does not call halt directly.
Reviewers: jingham, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13056
llvm-svn: 248371
Summary:
In bug 24074, the type information is not shown
correctly. This commit includes the following -
-> Changes for displaying correct type based on
current lexical scope for the command "image
lookup -t"
-> The corresponding testcase.
Reviewers: jingham, ovyalov, spyffe, richard.mitton, clayborg
Differential Revision: http://reviews.llvm.org/D12404
llvm-svn: 248366
Summary:
The default case doesn't need to be here as the switch covers
all possible values. If there's a new "lazy bool" value added
in the future, the compiler would start to warn about the new
case not being covered.
Reviewers: granata.enrico, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13084
llvm-svn: 248365
Different type system may have different notions of attributes of a type that do not matter for data formatters matching purposes
For instance, in the case of clang types, we remove some qualifiers (e.g. "volatile") as it doesn't make much sense to differentiate volatile T from T in the data formatters
This new API allows each type system to generate, if needed, a type that does not have those unwanted attributes that the data formatters can then consume to generate matches
llvm-svn: 248359
on iOS devices; fallout from Vince's cleanups made
in r237218 back in May. iOS native lldbs will call
StartDebugserverProcess() with a random port #
(see ProcessGDBRemote::LaunchAndConnectToDebugserver)
and neither side of this conditional expression should
be followed in that case.
I added an "if (in_port == 0) { ..." check around the
entire if/then/else and indented the block of code so
the diff looks larger than it really is.
<rdar://problem/21712643>
llvm-svn: 248343
The argdumper-based launching is more friendly to System Integrity Protection, and will work on older releases of OS X as well
Leave non-Apple builds alone
llvm-svn: 248338
This is meant to cover cases such as the obvious
Base *base = new Derived();
where GetDynamicTypeAndAddress(base) would return the type "Derived", not "Derived *"
llvm-svn: 248315
Summary:
This is no longer related to Clang and is just an opaque pointer
to data for a compiler type.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13039
llvm-svn: 248288
Summary:
pthread_setname_np() is a nonstandard GNU extension and isn't available
in every C library. Check before it's usage that GLIBC is available or
that we are targeting Android.
Reviewers: clayborg, ovyalov
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13019
llvm-svn: 248280
After the std::move operation the unique pointer is null.
So this statement always returns a null pointer.
Also remove unnecessary call to Module::ParseAllDebugSymbols(),
which spews errors due to how it incorrectly tries to parse DWARF DIE types.
llvm-svn: 248274
Summary:
Normally, these macros are defined in fnctl.h. However, GLIBC exposes their
definition through <sys/file.h> too. This change allows us to compile
LLDB with non-GLIBC C libraries.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13022
llvm-svn: 248255
This patch adds some of the groundwork required for tracking the lifetime of scripts and allocations and collecting data associated with them during execution.
Committed on behalf of Aidan Dodds.
Authored by: ADodds
Reviewed by: clayborg, jingham
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12936
llvm-svn: 248149
Both GNU AS and LLVM emits language type DW_LANG_Mips_Assembler for
all assembly code.
Differential revision: http://reviews.llvm.org/D12962
llvm-svn: 248146
We use the symbolic link to resolver to find the target of the LLDB shlib
symlink if there is a symlink. This allows us to find shlib-relative resources
even when running under the testsuite, where _lldb.so is a symlink in the Python
resource directory.
Also changed a comment to be slightly more clear about what resolve_path in the
constructor for FileSpec means, since if we were actually using realpath() this
code wouldn't have been necessary.
http://reviews.llvm.org/D12984
llvm-svn: 248048
Summary:
With the recent changes to separate clang from the core structures
of LLDB, many inclusions of clang headers can be removed.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12954
llvm-svn: 248004
For C++ and ObjC, dynamic values are always (at least somewhat) pointer-like in nature, so a ValueType of scalar is actually good enough that it could originally be hardcoded as the right choice
Other languages, might have broader notions of things that are dynamic (e.g. a language where a value type can be dynamic). In those cases, it might actually be the case that a dynamic value is a pointer-to the data, or even a host address if dynamic expression results entirely in host space are being talked about
This patch enables the language runtime to make that decision, and makes ValueObjectDynamicValue comply with it
llvm-svn: 247957
This cleans up type systems to be more pluggable. Prior to this we had issues:
- Module, SymbolFile, and many others has "ClangASTContext &GetClangASTContext()" functions. All have been switched over to use "TypeSystem *GetTypeSystemForLanguage()"
- Cleaned up any places that were using the GetClangASTContext() functions to use TypeSystem
- Cleaned up Module so that it no longer has dedicated type system member variables:
lldb::ClangASTContextUP m_ast; ///< The Clang AST context for this module.
lldb::GoASTContextUP m_go_ast; ///< The Go AST context for this module.
Now we have a type system map:
typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> TypeSystemMap;
TypeSystemMap m_type_system_map; ///< A map of any type systems associated with this module
- Many places in code were using ClangASTContext static functions to place with CompilerType objects and add modifiers (const, volatile, restrict) and to make typedefs, L and R value references and more. These have been made into CompilerType functions that are abstract:
class CompilerType
{
...
//----------------------------------------------------------------------
// Return a new CompilerType that is a L value reference to this type if
// this type is valid and the type system supports L value references,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
GetLValueReferenceType () const;
//----------------------------------------------------------------------
// Return a new CompilerType that is a R value reference to this type if
// this type is valid and the type system supports R value references,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
GetRValueReferenceType () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a const modifier to this type if
// this type is valid and the type system supports const modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddConstModifier () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a volatile modifier to this type if
// this type is valid and the type system supports volatile modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddVolatileModifier () const;
//----------------------------------------------------------------------
// Return a new CompilerType adds a restrict modifier to this type if
// this type is valid and the type system supports restrict modifiers,
// else return an invalid type.
//----------------------------------------------------------------------
CompilerType
AddRestrictModifier () const;
//----------------------------------------------------------------------
// Create a typedef to this type using "name" as the name of the typedef
// this type is valid and the type system supports typedefs, else return
// an invalid type.
//----------------------------------------------------------------------
CompilerType
CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const;
};
Other changes include:
- Removed "CompilerType TypeSystem::GetIntTypeFromBitSize(...)" and CompilerType TypeSystem::GetFloatTypeFromBitSize(...) and replaced it with "CompilerType TypeSystem::GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size);"
- Fixed code in Type.h to not request the full type for a type for no good reason, just request the forward type and let the type expand as needed
llvm-svn: 247953