Commit Graph

12736 Commits

Author SHA1 Message Date
Todd Fiala 5c3cc83b26 Reduce load on TestMultipleDebuggers.
4-core CPUs have a hard time keeping up with the number of debuggers
we were simultaneously spawning.  This leads to a timeout, which
leaves processes hanging around in "suspended mode", which can't be
killed with signals.

llvm-svn: 249421
2015-10-06 15:33:51 +00:00
Todd Fiala 0f247a479e Switching TestCallUserDefinedFunction from xfail to flaky on OS X.
This is passing 50/50 times for me.  Moving to flaky as precautionary
measure.

llvm-svn: 249419
2015-10-06 15:23:52 +00:00
Tamas Berghammer 63e6bd3687 Rename a test case to avoid name conflict
Rename the python source file for DataFormatterOSTypeTestCase to match
the purpose of the test and to avoid a name conflict with
DataFormatterBoolRefPtr. The name conflict caused a race condition in
the test runner what we have to address separately.

llvm-svn: 249407
2015-10-06 14:39:05 +00:00
Bruce Mitchener b810314825 Fix virtual/override warnings in new MIPS code.
Reviewers: bhushan, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 249405
2015-10-06 14:19:32 +00:00
Bruce Mitchener eb284e4667 Fix segmentation fault in lldb_private::Symbols::LocateExecutableSymbolFile()
Summary:
When `module_spec.GetFileSpec().GetDirectory().AsCString()` returned a `nullptr` this line caused a segmentation fault:

`std::string module_directory = module_spec.GetFileSpec().GetDirectory().AsCString()`

Some context:
I was remote debugging an executable built with Clang in an Ubuntu VM on my Windows machine using lldb-mi. I copied the executable and nothing else from the Ubuntu VM to the Windows machine.

Then started lldb-server in the Ubuntu VM:

```
./bin/lldb-server gdbserver *:8888 -- /home/enlight/Projects/dbgmits/build/Debug/data_tests_target
```

And ran `lldb-mi --interpreter` on Windows with the following commands:

```
-file-exec-and-symbols C:\Projects\data_tests_target
-target-select remote 192.168.56.101:8888
-exec-continue

```

After which the segmentation fault occurred at the aforementioned line. Inside this method `module_spec.GetFileSpec()` returns an empty `FileSpec` (no dir, no filename), while `module_spec.GetSymbolFileSpec().GetFilename()` returns `"libc-2.19.so"`.

Patch thanks to Vadim Macagon.

Reviewers: brucem, zturner, clayborg

Subscribers: lldb-commits

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

llvm-svn: 249387
2015-10-06 10:17:34 +00:00
Bhushan D. Attarde f55a0a47cf [MIPS] Emulate microMIPS instructions
SUMMARY:
    This patch includes:

    1. Emulation of prologue/epilogue and branch instructions for microMIPS.
    2. Setting up alternate disassembler (to be used for microMIPS).
       So there will be two disassembler instances, one for microMIPS and other for MIPS.
       Appropriate disassembler will be used based on the address class of instruction address.

    3. Some of the branch instructions does not have fixed sized delay slot, that means delay slot instruction can be of 2-byte or 4-byte.
       For this "m_next_inst_size" has been introduced which stores the size of next instruction (i.e size of delay slot instruction in case of branch).
       This can be used wherever the size of next instruction is required.

    4. A minor change to use mips32 register names instead of mips64 names.
    
    Reviewers: clayborg, tberghammer
    Subscribers: mohit.bhakkad, sagar, jaydeep, nitesh.jain, lldb-commits
    Differential Revision: http://reviews.llvm.org/D13282 

llvm-svn: 249381
2015-10-06 08:52:08 +00:00
Ewan Crawford 15f2bd9549 RenderScript command for printing allocation information
This patch adds a new command 'language renderscript allocation list' for printing the details of all loaded RS allocations.

In order to work out this information lldb JITs the runtime for the data it wants.
This has a penalty of a couple seconds latency, so is only done once for each allocation and the results cached.

If the user later wants to recalculate this information however, they can force lldb to do so with the --refresh flag.


Reviewed by: jingham, clayborg
Subscribers: lldb-commits, ADodds, domipheus, dean, tberghammer, danalbert, srhines 
Differential Revision: http://reviews.llvm.org/D13247

llvm-svn: 249380
2015-10-06 08:42:32 +00:00
Abhishek Aggarwal 2f00005cd7 Bug 25050: X87 FPU Special Purpose Registers
Summary:
  - For x86_64-FreeBSD Platform:
    -- LLDB now provides correct values of X87 FPU
       Special Purpose Registers like fstat, ftag, fctrl etc..

Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>

Reviewers: emaste, mikesart, clayborg

Subscribers: emaste

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

llvm-svn: 249379
2015-10-06 07:04:03 +00:00
Mohit K. Bhakkad acdff168e2 [LLDB][MIPS] Fix hit_count for mips watchpoints
Reviewers: clayborg, jingham.
Subscribers: jaydeep, bhushan, dsanders, sagar, nitesh.jain, zturner, jasonmolenda, lldb-commits.
Differential Revision: http://reviews.llvm.org/D13241

llvm-svn: 249377
2015-10-06 05:25:17 +00:00
Enrico Granata 8a9a8f3940 Introduce a FormattersMatchData class which contains all the information that data formatters need in one place, and also allows for lazy computation of expensive chunks of information if need be
This is a NFC commit that is essentially plumbing the new currency through the system

llvm-svn: 249366
2015-10-06 01:02:47 +00:00
Greg Clayton b3788eaf99 SBTarget::Attach(SBAttachInfo &) was changed to not be asynchronous back in February and this affected Xcode's abililty to cancel an attach to process by name.
Added the ability to specify if an attach by name should be synchronous or not in SBAttachInfo and ProcessAttachInfo.

<rdar://problem/22821480>

llvm-svn: 249361
2015-10-05 22:58:37 +00:00
Mohit K. Bhakkad 72207b167c [LLDB][MIPS] Skip invalid size watchpoint testcase for MIPS
Reviewers: jaydeep.
Subscribers: lldb-commits.
Differential Revision: http://reviews.llvm.org/D13335

llvm-svn: 249299
2015-10-05 10:56:19 +00:00
Todd Fiala 65b9056f3d cmake: ensure readline python module target is added before finishing swig.
When the readline target exists (only for non-Android Linux currently),
ensure that target is made a dependency of the finish_swig python-wrap-up
steps.  This ensures it is built when building the lldb target.

Fixes:
https://llvm.org/bugs/show_bug.cgi?id=25038

llvm-svn: 249256
2015-10-04 01:28:51 +00:00
Sean Callanan 9fda9d2177 Add PersistentVariableDelegate to handle language-specific dematerialization.
The concept here is that languages may have different ways of communicating
results.  In particular, languages may have different names for their result
variables and in fact may have multiple types of result variables (e.g.,
error results).  Materializer was tied to one specific model of result handling.

Instead, now UserExpressions can register their own handlers for the result
variables they inject.  This allows language-specific code in Materializer to
be moved into the expression parser plug-in, and it simplifies Materializer.
These delegates are subclasses of PersistentVariableDelegate.

PersistentVariableDelegate can provide the name of the result variable, and is
notified when the result variable is populated.  It can also be used to touch
persistent variables if need be, updating language-specific state.  The
UserExpression owns the delegate and can decide on its result based on
consulting all of its (potentially multiple) delegates.

The user expression itself now makes the determination of what the final result
of the expression is, rather than relying on the Materializer, and I've added a
virtual function to UserExpression to allow this.

llvm-svn: 249233
2015-10-03 09:09:01 +00:00
Enrico Granata bd0998a1be Do not attempt to join the remote paths if none exist
llvm-svn: 249210
2015-10-02 22:53:32 +00:00
Zachary Turner 25b9ced0ed Re-disable TestBuiltinTrap on Windows.
This was inadvertently re-enabled as a in r248883.

llvm-svn: 249209
2015-10-02 22:47:37 +00:00
Zachary Turner a259116513 Updated xfail / skip status on a few tests.
TestDiamond and TestSBValueCast were due to a bug in clang.  That
bug has been fixed, so xfail is removed.  However fixing that bug
exposed another bug in clang, which is not yet fixed.  That bug
causes one test to start crashing, and another to fail unexpectedly
so the status of those tests is updated as well.

llvm-svn: 249208
2015-10-02 22:47:28 +00:00
Zachary Turner 89a7938291 Remove instance reference of static member function.
llvm-svn: 249207
2015-10-02 22:47:14 +00:00
Zachary Turner 6c3c0ed539 Have a clean(er) shutdown when detaching from a process.
llvm-svn: 249206
2015-10-02 22:47:04 +00:00
Oleksiy Vyalov a1733984f2 Fix TestCompDirSymLink.py - remove existing symlink leftovers if previous test run
was terminated (e.g., due timeout).

llvm-svn: 249203
2015-10-02 22:37:55 +00:00
Enrico Granata 6b2ed8bdca Fix the CMake build
llvm-svn: 249189
2015-10-02 21:14:38 +00:00
Enrico Granata 7de855c6d9 Add hooks that enable NSSet, NSDictionary and NSString formatting to apply to other types beyond the well-known ones
This is meant to support languages that can do some sort of bridging from<-->to these ObjC types via types that statically vend themselves as Cocoa types, but dynamically have an implementation that does not match any of our well-known types, but where an introspecting formatter can be vended by the bridged language

llvm-svn: 249185
2015-10-02 20:59:58 +00:00
Todd Fiala ae5dee8031 Fix race on subprocess.Popen return values.
This fixes:
https://llvm.org/bugs/show_bug.cgi?id=25019

llvm-svn: 249182
2015-10-02 20:51:11 +00:00
Sean Callanan a994b0b273 Made GetScratchTypeSystemForLanguage return an error if desired.
Also made it not store nullptrs in its TypeSystemMap, so it will retry to make
the AST context if it errored out last time.

llvm-svn: 249167
2015-10-02 18:40:30 +00:00
Tamas Berghammer b285e9e0d2 Change expected stop reason in TestInferiorAssert for Android API <= 16
llvm-svn: 249120
2015-10-02 12:00:04 +00:00
Tamas Berghammer f5ead561b3 Fix several issues around .ARM.exidx section handling
* Use .ARM.exidx as a fallback unwind plan for non-call site when the
  instruction emulation based unwind failed.
* Work around an old compiler issue where the compiler isn't sort the
  entries in .ARM.exidx based on their address.
* Fix unwind info parsing when the virtual file address >= 0x80000000
* Fix bug in unwind info parsing when neither lr nor pc is explicitly
  restored.

Differential revision: http://reviews.llvm.org/D13380

llvm-svn: 249119
2015-10-02 11:58:26 +00:00
Enrico Granata 72d8a72241 Teach 'type lookup' to pull types from clang modules; also add a test case
llvm-svn: 249117
2015-10-02 01:23:11 +00:00
Sean Callanan 9301ec1191 Eliminated redundant "constructors" for ClangExpressionVariable.
The ClangExpressionVariable::CreateVariableInList functions looked cute, but                                                                                                                                           
caused more confusion than they solved.  I removed them, and instead made sure                                                                                                                                         
that there are adequate facilities for easily adding newly-constructed                                                                                                                                                 
ExpressionVariables to lists.      

I also made some of the constructors that are common be generic, so that it's
possible to construct expression variables from generic places (like the ABI and
ValueObject) without having to know the specifics about the class.

llvm-svn: 249095
2015-10-01 23:07:06 +00:00
Dawn Perchik 8587212085 [lldb-mi] Add support for StopAtEntry in MI via "-exec-run --start".
This patch adds a --start option to the lldb-mi -exec-run command for
getting process stopped at entry point after launch.  It is equivelent
to the -s option in the lldb command line interpreter:
    process launch -s
and is therefore not supported on all hosts and/or targets.  To check
if the --start option is supported, see if the corresponding feature
"exec-run-start-option" is in the list of options reported by the lldb-mi
"-list-features" command.

Patch from engineer.developer@gmail.com (Kirill Lapshin)
Reviewed by: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D12977

llvm-svn: 249072
2015-10-01 21:15:43 +00:00
Oleksiy Vyalov af87713a81 Fix Android build after r249047.
llvm-svn: 249055
2015-10-01 19:08:00 +00:00
Enrico Granata 9b0af1b86f Add a 'type lookup' command. This command is meant to look up type information by name in a language-specific way.
Currently, it only supports Objective-C - C++ types can be looked up through debug info via 'image lookup -t', whereas ObjC types via this command are looked up by runtime introspection

This behavior is in line with type lookup's behavior in Xcode 7, but I am definitely open to feedback as to what makes the most sense here

llvm-svn: 249047
2015-10-01 18:16:18 +00:00
Oleksiy Vyalov d21ca280cb Use %HOME%/.lldb/module_cache as a default module cache directory.
http://reviews.llvm.org/D13323

llvm-svn: 249040
2015-10-01 17:48:57 +00:00
Sean Callanan 1ab1ee7620 Removed a mutex guard that I accidentally pasted in from other code.
It was causing deadlocks when stepping out.

llvm-svn: 249039
2015-10-01 17:48:25 +00:00
Sean Callanan b92bd7538e Made Target hold a map of languages to TypeSystems, and added some accessors.
Also added some target-level search functions so that persistent variables and
symbols can be searched for without hand-iterating across the map of
TypeSystems.

llvm-svn: 249027
2015-10-01 16:28:02 +00:00
Sagar Thakur 2ee26ee37b Romove accidentially added statement in r249020
llvm-svn: 249021
2015-10-01 15:15:42 +00:00
Sagar Thakur b8862c0107 [LLDB][MIPS] Fix gp register value for o32 applications on 64-bit target
GP registers for o32 applications were always giving zero value because SetType() on the RegisterValue was causing the accessor functions to pickup the value from m_scalar of RegisterValue which is zero.
In this patch byte size and byte order of register value is set at the time of setting the value of the register.

llvm-svn: 249020
2015-10-01 15:05:31 +00:00
Tamas Berghammer 3e8947be91 Fix Android-SDK detection on API 10 device
Run the getprop command with AdbClient::Shell instead of
Platform::RunShellCommand because getting the output from getprop
with Platform::RunShellCommand have some (currently unknown) issues.

llvm-svn: 249014
2015-10-01 13:58:01 +00:00
Tamas Berghammer 76011b63cd Fix breakpoint opcode calculation on Linux
Change the way we detect if we have to place a thumb breakpoint instead
of an arm breakpoint in the case when no symbol table or mapping symbols
are available. Detect it based on the LSB of the FileAddress instead of
the LSB of the LoadAddress because the LSB of the LoadAddress is already
masked out.

llvm-svn: 249013
2015-10-01 13:57:57 +00:00
Tamas Berghammer 3c47151d1a Restrict the scope of a hack in DYLDRendezvous
The hack is there to work around an incorrect load address reported
by the android linker on API 21 and 22 devices. This CL restricts the
hack to those android API levels.

Differential revision: http://reviews.llvm.org/D13288

llvm-svn: 249012
2015-10-01 13:57:54 +00:00
Tamas Berghammer 539cd118b2 Trim the output of mktem in PlatformAndroid::DownloadSymbolFile
Differential revision: http://reviews.llvm.org/D13293

llvm-svn: 248998
2015-10-01 09:42:23 +00:00
Pavel Labath 746ffd6980 Revert "Fixing a subtle issue on Mac OS X systems with dSYMs..."
This reverts commit r248985, as it was breaking all remote
expression-evaluating tests (on android at least).

llvm-svn: 248995
2015-10-01 09:03:33 +00:00
Bruce Mitchener f0248ca545 Add a Post-Build Event on Windows to copy the correct custom Python DLL to the LLDB binaries dir
Summary:
After a developer builds LLDB from source on Windows (assuming they've built it with Python support enabled), they may be somewhat flustered when it fails to launch with a cryptic error.

{F890625}

This happens because Windows can't find python27.dll (or python27_d.dll in case LLDB was built in debug mode). Many developers may have previously installed a release build of Python 2.7 and will not notice anything is amiss when they run a release build of LLDB because Windows will load the python27.dll from one of the system directories or `PATH` (rather than the one that the LLDB build instructions tell them to build). The issue tends to be more pronounced with debug builds of LLDB, since fewer developers probably have python27_d.dll sitting in one of the Windows system directories.

To ensure Windows loads the correct custom built Python DLL when launching LLDB I've added a post-build event that copies the relevant DLL (based on the LLDB build configuration) from `PYTHON_HOME` to the directory in which the LLDB executable is generated.

Patch by Vadim Macagon. Thanks!

Reviewers: brucem, zturner

Subscribers: lldb-commits

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

llvm-svn: 248992
2015-10-01 07:55:44 +00:00
Bruce Mitchener 852cb7fb0d Use the correct Python lib for each build configuration generated by the Visual Studio CMake generator
Summary:
Previously `CMAKE_BUILD_TYPE` was used to determine whether to link in `python27.lib` or `python27_d.lib`, unfortunately this only works reliably when using a CMake generator that generates a single build configuration (e.g. Ninja). The Visual Studio CMake generator generates four build configurations at once (`Debug`, `Release`, `RelWithDebInfo`, `MinSizeRel`), so if `CMAKE_BUILD_TYPE` is set to `Debug` all four build configurations end up linking in `python27_d.lib`, this is clearly undesirable.

To ensure that the correct Python lib is used for each build configuration the value of `PYTHON_LIBRARY` is now determined using generator expressions that evaluate to either the debug or release Python lib. The values of `PYTHON_EXECUTABLE` and `PYTHON_DLL` are now likewise determined using generator expressions.

Note that these changes only apply to the Windows build.

Patch by Vadim Macagon. Thanks!

Reviewers: zturner, brucem

Subscribers: zturner, lldb-commits

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

llvm-svn: 248991
2015-10-01 07:47:38 +00:00
Bruce Mitchener c32c277b84 Include platform agnostic <HostGetOpt.h> in the place of <getopt.h>
Summary: Problem caught on NetBSD with missing getopt_long_only(3).

Change by Kamil Rytarowski <n54@gmx.com>

Reviewers: joerg, brucem

Subscribers: brucem, lldb-commits

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

llvm-svn: 248990
2015-10-01 07:45:58 +00:00
Jason Molenda 8b2f23d515 Fixing a subtle issue on Mac OS X systems with dSYMs (possibly
introduced by r235737 but I didn't look into it too closely).

A dSYM can have a per-UUID plist in it which tells lldb where
to find an executable binary for the dSYM (DBGSymbolRichExecutable)
- other information can be included in this plist, like how to
remap the source file paths from their build pathnames to their
long-term storage pathnames.

This per-UUID plist is a unusual; it is used probably exclusively
inside apple with our build system.  It is not created by default
in normal dSYMs.

The problem was like this:

  1. lldb wants to find an executable, given only a UUID
     (this happens when lldb is doing cross-host debugging
      and doesn't have a copy of the target system's binaries)

  2. It eventually calls LocateMacOSXFilesUsingDebugSymbols
     which does a spotlight search for the dSYM on the local
     system, and failing that, tries the DBGShellCommands
     command to find the dSYM.

  3. It gets a dSYM.  It reads the per-UUID plist in the dSYM.
     The dSYM has a DBGSymbolRichExecutable kv pair pointing to
     the binary on a network filesystem.

  4. Using the binary on the network filesystem, lldb now goes
     to find the dSYM.

  5. It starts by looking for a dSYM next to the binary it found.

  6. lldb is now reading the dSYM over a network filesystem,
     ignoring the one it found on its local filesystem earlier.

Everything still *works* but it's much slower.

This would be a tricky one to write up in a testsuite case;
you really need the binary to not exist on the local system.
And LocateMacOSXFilesUsingDebugSymbols will only compile on
Mac OS X - even if I found a way to write up a test case, it
would not run anywhere but on a mac.

One change Greg wanted while I was touching this code was to
have LocateMacOSXFilesUsingDebugSymbols (which could be asked
to find a binary OR find a dSYM) to instead return a ModuleSpec
with the sum total of everything it could find.  This
change of passing around a ModuleSpec instead of a FileSpec
was percolated up into ModuleList::GetSharedModule.

The changes to LocateMacOSXFilesUsingDebugSymbols look larger
than they really are - there's a lot of simple whitespace changes
in there.

I ran the testsuites on mac, no new regressions introduced

<rdar://problem/21993813> 

llvm-svn: 248985
2015-10-01 05:37:22 +00:00
Sean Callanan 0f625f42fd Use the preferred display language when making a persistent variable from a
ValueObject.

llvm-svn: 248971
2015-10-01 00:39:03 +00:00
Sean Callanan 7aeb7e256b Changed PersistentExpressionState to allow symbol lookups. Clang doesn't
report any (yet).

llvm-svn: 248970
2015-10-01 00:38:06 +00:00
Enrico Granata 6754e04f6d Introudce a IsTopLevelFunction() API on Language and Function
This is meant to support languages that have a scripting mode with top-level code that acts as global

For now, this flag only controls whether 'frame variable' will attempt to treat globals as locals when within such a function

llvm-svn: 248960
2015-09-30 23:12:22 +00:00
Oleksiy Vyalov de1736ae02 Fix Linux build.
llvm-svn: 248956
2015-09-30 22:27:55 +00:00
Todd Fiala 84f14ab0fb Fixes a potential hang in test runner timeout logic.
Part of https://llvm.org/bugs/show_bug.cgi?id=25002

In writing the new process_control test included here,
I discovered that the scenario would hang indefinitely,
bypassing the timeout logic.

This fixes the indefinite hang, converting an error
in the new test to a failure.  I'll fix the failure
next.  This one was heinous enough to fix on its own,
though.

llvm-svn: 248936
2015-09-30 20:13:58 +00:00