Commit Graph

7658 Commits

Author SHA1 Message Date
Jason Molenda c8badb717b Remove one of the three spaces after a period in one of the breakpoint
set help messages.
<rdar://problem/22870082> 

llvm-svn: 248755
2015-09-28 23:02:00 +00:00
Oleksiy Vyalov 36c42b592d Bind listener to 127.0.0.1 to make sure that loopback address is used.
llvm-svn: 248722
2015-09-28 17:42:16 +00:00
Pavel Labath c8c77d46ef Revert "Fix race condition during process detach"
This fix is not correct on its own until D12968 is resolved. Will resumbit once that is done.

llvm-svn: 248702
2015-09-28 09:37:51 +00:00
Sean Callanan 6d874ee31a Moved ClangExpressionHelper.h into the Clang expression parser plug-in.
llvm-svn: 248631
2015-09-25 22:47:07 +00:00
Sean Callanan 4dbb271fcc Moved more Clang-specific parts of the expression parser into the Clang plugin.
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
2015-09-25 20:35:58 +00:00
Dawn Perchik 5e8115b33b Add comment in StringExtractor::GetHexU8
llvm-svn: 248601
2015-09-25 18:23:50 +00:00
Tamas Berghammer 92d2c8eaef Eliminate a potential crash in the struct layout code with a gracefull fallback
Differential revision: http://reviews.llvm.org/D12963

llvm-svn: 248571
2015-09-25 12:50:51 +00:00
Dawn Perchik 045c829223 Fix evaluation of unicode character arrays (char16_t[] and char32_t[])
Suppose we have the UTF-16 string:
    char16_t[] s = u"hello";
Before this patch, evaluating the string in lldb would get:
    (char16_t [6]) $0 = ([0] = U+0068 u'h', [1] = U+0065 u'e', [2] = U+006c u'l', [3] = U+006c u'l', [4] = U+006f u'o', [5] = U+0000 u'\0')
After applying the patch, we now get:
    (char16_t [6]) $0 = u"hello"

Patch from evgeny.leviant@gmail.com
Reviewed by: granata.enrico
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13053

llvm-svn: 248555
2015-09-25 02:16:52 +00:00
Todd Fiala 5e365481be Fix tests on cmake-based OS X after rL248338
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
2015-09-24 21:59:48 +00:00
Bruce Mitchener 68acf7acd2 Improve error reporting for failing to find argdumper.
Reviewers: tfiala, granata.enrico, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13125

llvm-svn: 248466
2015-09-24 07:08:29 +00:00
Bruce Mitchener 3ad353f3f4 Rename clang_type -> compiler_type for variables.
Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13102

llvm-svn: 248461
2015-09-24 03:54:50 +00:00
Bruce Mitchener 16eb1d2278 execinfo.h isn't needed on Mac OS X for Host.mm.
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
2015-09-24 01:37:32 +00:00
Enrico Granata d188803f45 The Visual Studio compiler does not like this C-ism when 'enum class'es are involved
llvm-svn: 248429
2015-09-23 20:49:15 +00:00
Enrico Granata 15a67f49aa Make the ObjCLanguageRuntimes comply with llvm-style RTTI
llvm-svn: 248427
2015-09-23 20:12:19 +00:00
Enrico Granata e5ffa089cc Revert 248366 "Testcase and fix for bug 24074"
This commit introduced regressions in several test cases on FreeBSD and Mac OS X

llvm-svn: 248421
2015-09-23 19:32:56 +00:00
Ed Maste c6dd651518 Handle new types in ClangASTContext::GetEncoding
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
2015-09-23 18:32:34 +00:00
Siva Chandra cebabb9fc0 DWARFASTParserClang::CompleteTypeFromDWARF: Handle incomplete baseclass or child
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
2015-09-23 17:47:08 +00:00
Pavel Labath 84f6f277ac Fix race condition during process detach
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
2015-09-23 10:16:57 +00:00
Ravitheja Addepally 9fcf72ef9b Testcase and fix for bug 24074
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
2015-09-23 07:19:02 +00:00
Bruce Mitchener 77b94d4416 Fix covered-switch-default warning in FormatManager.
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
2015-09-23 02:33:30 +00:00
Enrico Granata 9c63f99a13 Allow CompilerType to express a vote on whether oneliner printing should happen
llvm-svn: 248363
2015-09-23 02:04:34 +00:00
Enrico Granata c6bf2e2d1d Add {TypeSystem|CompilerType}::GetTypeForFormatters()
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
2015-09-23 01:39:46 +00:00
Bruce Mitchener 48ea900c67 Use opaque_compiler_type_t in place of void*.
Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13060

llvm-svn: 248352
2015-09-23 00:18:24 +00:00
Jason Molenda 040975472c A small fixup needed for debugserver to work natively
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
2015-09-22 23:25:44 +00:00
Enrico Granata f515729a07 Move the "run" alias from process launch --shell to process launch --shell-expand-args when building on OS X
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
2015-09-22 22:57:12 +00:00
Enrico Granata 7eed48779d On second thought, amend the previous patch to pass itself the ValueObject& for the static value instead of just its type
llvm-svn: 248316
2015-09-22 19:58:02 +00:00
Enrico Granata c74275bc4a Move the logic to post-process dynamic types for ValueObject purposes from the ValueObjects to the LanguageRuntime plugins
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
2015-09-22 19:45:52 +00:00
Bruce Mitchener 23a3b0e8a4 Rename clang_type_t to opaque_compiler_type_t.
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
2015-09-22 17:04:24 +00:00
Tamas Berghammer 3f934e4b13 Fix register names in EmulateInstructionMIPS.cpp
llvm-svn: 248281
2015-09-22 15:04:39 +00:00
Vasileios Kalintiris 747372b91a Do not use pthread_setname_np() if we don't have GLIBC or Android.
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
2015-09-22 14:52:31 +00:00
Sagar Thakur af368f6e88 [MIPS32] Emulate MSA instructions for MIPS32
This patch adds MSA branch instruction emulation for MIPS32.

Reviewers: tberghammer, jaydeep
Subscribers: mohit.bhakkad, bhushan, nitesh.jain
Differential: http://reviews.llvm.org/D12898
llvm-svn: 248277
2015-09-22 13:57:11 +00:00
Ewan Crawford d10ca9deee RenderScript lookup bug fix
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
2015-09-22 13:36:35 +00:00
Vasileios Kalintiris 187855b870 Remove unused header <execinfo.h>.
llvm-svn: 248268
2015-09-22 12:43:23 +00:00
Vasileios Kalintiris e6f54ef5d0 Check for GLIBC before including execinfo.h
Reviewers: ovyalov, clayborg

Subscribers: tberghammer, danalbert, llvm-commits, srhines

Differential Revision: http://reviews.llvm.org/D13016

llvm-svn: 248256
2015-09-22 09:53:30 +00:00
Vasileios Kalintiris 44562da811 Use fcntl.h to retrieve the O_CREAT and O_RDWR constants.
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
2015-09-22 09:46:35 +00:00
Jaydeep Patil 44d07fcc7c [LLDB][MIPS] microMIPS breakpoints, disassembly and compressed addresses
SUMMARY:
    This patch detects microMIPS symbols, sets breakpoints using un-compressed address and 
    display disassembly in mixed mode for microMIPS applications (running on bare-iron targets).

    Reviewers: clayborg
    Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
    Differential Revision: http://reviews.llvm.org/D12079

llvm-svn: 248248
2015-09-22 06:36:56 +00:00
Bruce Mitchener adb99821bc Fix typos.
Summary: Another round of minor typo fixes.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13026

llvm-svn: 248243
2015-09-22 05:07:56 +00:00
Bruce Mitchener 937e3964e2 Further reduction of Clang-related header inclusion.
Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13018

llvm-svn: 248176
2015-09-21 16:56:08 +00:00
Bruce Mitchener 4ad833400f Rename GetChildClangTypeAtIndex to GetChildCompilerTypeAtIndex
Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13020

llvm-svn: 248175
2015-09-21 16:48:48 +00:00
Ewan Crawford 78f339d19c Groundwork for better tracking of renderscript allocations and scripts
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
2015-09-21 10:53:18 +00:00
Tamas Berghammer 1bacb9220a Fix MSVC warings in DWARFExpression.cpp
llvm-svn: 248148
2015-09-21 10:24:59 +00:00
Tamas Berghammer 6b144354ff Use ClangASTContext for compile units with language eLanguageTypeMipsAssembler
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
2015-09-21 10:08:49 +00:00
Sean Callanan 9077e9f8f2 Moved ResolveSymbolicLink() to the FileSystem where it belongs, thanks
zturner!

http://reviews.llvm.org/D12984

llvm-svn: 248055
2015-09-18 22:24:57 +00:00
Sean Callanan db7d8083cd Added support for resolving symbolic links to FileSpec.
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
2015-09-18 21:39:31 +00:00
Oleksiy Vyalov 2b38f33b82 Remove unused modules from module cache.
http://reviews.llvm.org/D12971

llvm-svn: 248017
2015-09-18 18:12:39 +00:00
Bruce Mitchener 1c95046aa5 Reduce inclusion of clang headers.
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
2015-09-18 17:02:48 +00:00
Aidan Dodds 827802871b Differential Revision: http://reviews.llvm.org/D12966
On behalf of Dean De Leo

llvm-svn: 248003
2015-09-18 16:49:39 +00:00
Jaydeep Patil 630dd7ff35 [LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo
SUMMARY:
    Using response.IsUnsupportedResponse instead of !response.IsNormalResponse().

    Reviewers: clayborg, labath
    Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits
    Differential Revision: http://reviews.llvm.org/D12876

llvm-svn: 247968
2015-09-18 05:32:54 +00:00
Enrico Granata 0b6003f3e6 Make LanguageRuntime::GetDynamicTypeAndAddress return a ValueType
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
2015-09-17 22:56:38 +00:00
Greg Clayton 56939cb310 TypeSystem is now a plugin interface and removed any "ClangASTContext &Class::GetClangASTContext()" functions.
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
2015-09-17 22:23:34 +00:00