Commit Graph

14777 Commits

Author SHA1 Message Date
Jason Molenda 68715551f8 Ignore clang-module-cache directories that may be created
in the testsuite directory while it runs.

llvm-svn: 275944
2016-07-19 02:37:07 +00:00
Chaoren Lin 926db72a4d Add missing headers after header cleanup in r275882.
llvm-svn: 275914
2016-07-18 21:11:43 +00:00
Todd Fiala c11c0823d0 make macOS 'launch in terminal' bring terminal to the front during launch
rdar://25235812

llvm-svn: 275885
2016-07-18 19:15:38 +00:00
Pavel Labath 5ab9732aef Revert "[test] Report error when inferior test processes exit with a non-zero code"
This reverts r275782.

The problem with the commit is that it reports an additional "exit (1)" error for every file
containing a failing test, which is far more than I had intended to do. I'll need to come up with
a more fine-grained way of achieving the result.

llvm-svn: 275791
2016-07-18 14:42:01 +00:00
Nitesh Jain de69d40686 [LLVM][MIPS] Revert support for FRE.
Reviewers: jaydeep

Subscribers: bhushan, mohit.bhakkad, slthakur, llvm-commits
llvm-svn: 275785
2016-07-18 12:37:44 +00:00
Pavel Labath 52bd8012bd [test] Report error when inferior test processes exit with a non-zero code
Summary:
We've run into this problem when the test errored out so early (because it could not connect to
the remote device), that the code in D20193 did not catch the error. This resulted in the test
suite reporting success with 0 tests being run.

This patch makes sure that any non-zero exit code from the inferior process gets reported as an
error. Basically I expand the concept of "exceptional exits", which was previously being used for
signals to cover these cases as well.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D22404

llvm-svn: 275782
2016-07-18 11:27:19 +00:00
Howard Hellyer 97be487728 Implement GetMemoryRegions() for Windows Minidumps and live processes.
Summary:
This patch fills in the implementation of GetMemoryRegions() on the Windows live process and minidump implementations of lldb_private::Process (ProcessWindowsLive::GetMemoryRegionInfo and ProcessWinMiniDump::Impl::GetMemoryRegionInfo.) The GetMemoryRegions API was added under: http://reviews.llvm.org/D20565

The existing Windows implementations didn’t fill in the start and end addresses within MemoryRegionInfo. This patch fixes that and adds support for the new mapped flag on MemoryRegionInfo that says whether a memory range is mapped into the process address space or not.

The behaviour of both live and core implementations should match the behaviour documented on Process::GetMemoryRegionInfo (in Process.h) which in turn should match the behaviour of the qMemoryRegionInfo query documented in lldb-gdb-remote.txt.

Reviewers: clayborg, amccarth

Subscribers: amccarth, lldb-commits

Differential Revision: https://reviews.llvm.org/D22352

llvm-svn: 275778
2016-07-18 08:25:59 +00:00
Jason Molenda 5fe4d141e0 Refactor (with some rewriting) the DynamicLoaderMacOSX plugin into
a base class and a derived class, with the derived class containing
the methods specific to reading dyld's all_image_infos, dyld's
method of specifying images that have been loaded or unloaded, the
place where we put a breakpoint in dyld to get notified about newly
loaded or unloaded images.

This is in preparation for a second derived class which will use
some alternate methods for getting this information; that will be
a separate commit in the next few days.

There's a couple of ivars that should probably be in the derived
DyanmicLoaderMacOSX class instead of the base DynamicLoaderDarwin
class (m_dyld_image_infos, m_dyld_image_infos_stop_id).  I don't
think I'll need to use these in the new derived class - I'll 
move them down to DynamicLoaderMacOSX if it works out that way;
it'll simplify locking if I can do that.

<rdar://problem/25251243> 

llvm-svn: 275733
2016-07-17 21:27:32 +00:00
Jason Molenda 5d4102417b Initialize the "is_loaded" local in LoadModuleAtAddress in
case Process::GetFileLoadAddress fails to set it to a real
value.  (fixing "conditional use of garbage value" clang warning)

llvm-svn: 275731
2016-07-17 20:01:54 +00:00
Jason Molenda a41deb1c69 Add missing break stmt to DW_CFA_GNU_args_size case.
llvm-svn: 275729
2016-07-17 19:57:49 +00:00
Sean Callanan 85e632f1fe Fixed the location of the Swift bindings in the Xcode build.
$BUILT_PRODUCTS_DIR is usually the same as $CONFIGURATION_BUILD_DIR, but differs
when LLDB is being built BuildAndIntegration, in which case $BUILT_PRODUCTS_DIR
is more accurate.

llvm-svn: 275652
2016-07-16 00:18:24 +00:00
Eugene Zelenko dab35bd67f Fixes for standalone build:
* include CheckAtomic to set HAVE_CXX_ATOMICS64_WITHOUT_LIB properly (introduced in r274121)
* hint Clang CMake files for LLVM CMake files location (inctroduced in ~ r274176)

Differential revision: https://reviews.llvm.org/D22322

llvm-svn: 275641
2016-07-15 22:46:15 +00:00
Pavel Labath 9377a7b6a8 Fix TestDarwinNSLogOutput for windows
pexpect python package does not exist on windows

llvm-svn: 275555
2016-07-15 12:19:28 +00:00
Pavel Labath 4abe5d69ea [NPL] Simplify process launch code
Summary:
This removes one level of indirection, which was just packing and repacking launch args into
different structures. NFC.

Reviewers: tberghammer

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D22357

llvm-svn: 275544
2016-07-15 10:18:15 +00:00
Jim Ingham fa0f2a0dcf Remember to add the testcase I wrote for r274822.
llvm-svn: 275519
2016-07-15 01:41:54 +00:00
Todd Fiala 38c5318662 adjust one of the NSLog output tests to only run on macOS 10.12+
The LLDB NSLog handling when Xcode intends to suppress NSLog
output only works on Fall 2016 OS releases.  Skip it on earlier
OSes.

llvm-svn: 275506
2016-07-15 00:51:26 +00:00
Kate Stone 7428a18c1e LLDB help content has accumulated over time without a recent attempt to
review it for consistency, accuracy, and clarity. These changes attempt to
address all of the above while keeping the text relatively terse.

<rdar://problem/24868841>

llvm-svn: 275485
2016-07-14 22:03:10 +00:00
Kate Stone 240414dc95 Editing multi-line content in a terminal environment involves a lot of
trade-offs. When LLDB's multi-line editing support was first introduced
for expressions / REPL contexts the behavior was as follows:

* The Return key is treated as a line-break except at the end of the input
  buffer, where a completeness test is applied

This worked well enough when writing code, and makes it trivial to insert
new lines above code you've already typed. Just use cursor navigation to
move up and type freely. Where it was awkward is that the gesture to insert
a line break and end editing is conflated for most people. Sometimes you
want Return to end the editing session and other times you want to insert
a line break.

This commit changes the behavior as follows:

* The Return key is treated as the end of editing except at the end of the
  input buffer, where a completeness test is applied

* The Meta+Return sequence is always treated as a line break. This is
  consistent with conventions in Facebook and elsewhere since
  Alt/Option+Return is often mapped to Meta+Return. The unfortunate
  exception is on macOS where this *can* be the case, but isn't by
  default. Sigh.

Note that by design both before and after the patch pasting a Return
character always introduces a line break.

<rdar://problem/26886287>

llvm-svn: 275482
2016-07-14 22:00:04 +00:00
Todd Fiala da2f494992 removed darwin_log.py file from previous check-in
This file was not intended to be part of the last check-in.

llvm-svn: 275478
2016-07-14 21:25:42 +00:00
Todd Fiala 4acb65ecee fix command-line LLDB so NSLog messages show up
Changes to the underlying logging infrastructure in Fall 2016 Darwin
OSes were no longer showing up NSLog messages in command-line LLDB.
This change restores that functionality, and adds test cases to
verify the new behavior.

rdar://26732492

llvm-svn: 275472
2016-07-14 21:02:45 +00:00
Greg Clayton 7853dd5dec Add support for Objective-C class properties.
Added test cases to exiting tests to cover the new functionality.

<rdar://problem/24311282> 

llvm-svn: 275459
2016-07-14 19:31:18 +00:00
Benjamin Kramer 56a46bc680 Upgrade all the .arcconfigs to https.
llvm-svn: 275409
2016-07-14 13:15:37 +00:00
Pavel Labath c54f9c4851 mark newly failing tests as XFAIL
llvm-svn: 275394
2016-07-14 10:43:24 +00:00
Pavel Labath fa3d652d26 [test] [linux] define PR_SET_PTRACER constants if the system does not provide them
Android API <= 16 header do not have these symbols defined, but the kernel does support the
relevant calls. And in general, since these calls are on a best-effort basis, it won't hurt even
if we try to run in on a really ancient kernel.

llvm-svn: 275393
2016-07-14 10:43:21 +00:00
Ilia K beb1aa907d Fix -break-enable/-break-disable commands (MI)
* Previously -break-enable mistakenly set BP's enabled flag to false.
* These commands print fake =breakpoint-modified messages, what's not
  needed anymore because that events are come in normal way.
* Add tests for -break-enable/-break-disable commands

Initial patch from xuefangliang@hotmail.com. The test case was improved by me.

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

llvm-svn: 275381
2016-07-14 07:43:14 +00:00
Greg Clayton ae26b488df Added test for setting breakpoints by basename and fullname.
<rdar://problem/24599697> 

llvm-svn: 275336
2016-07-13 22:38:54 +00:00
Stephane Sezer 1852a78416 Fix a check in the objc trampoline handler
Summary:
The function FunctionCaller::WriteFunctionArguments returns false on
errors, so they should check for the false return value.

Change by Walter Erquinigo <a20012251@gmail.com>

Reviewers: jingham, clayborg

Subscribers: lldb-commits

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

llvm-svn: 275287
2016-07-13 17:34:26 +00:00
Greg Clayton 0e27d67a98 Remove comment that isn't needed anymore.
<rdar://problem/24599697>

llvm-svn: 275285
2016-07-13 17:25:55 +00:00
Greg Clayton 6234a5c863 Centralize the way symbol and functions are looked up by making a Module::LookupInfo class that does all of the heavy lifting.
Background: symbols and functions can be looked up by full mangled name and by basename. SymbolFile and ObjectFile are expected to be able to do the lookups based on full mangled name or by basename, so when the user types something that is incomplete, we must be able to look it up efficiently. For example the user types "a:🅱️:c" as a symbol to set a breakpoint on, we will break this down into a 'lookup "c"' and then weed out N matches down to just the ones that match "a:🅱️:c". Previously this was done manaully in many functions by calling Module::PrepareForFunctionNameLookup(...) and then doing the lookup and manually pruning the results down afterward with duplicated code. Now all places use Module::LookupInfo to do the work in one place.

This allowed me to fix the name lookups to look for "func" with eFunctionNameTypeFull as the "name_type_mask", and correctly weed the results:

"func", "func()", "func(int)", "a::func()", "b::func()", and "a:🅱️:func()" down to just "func", "func()", "func(int)". Previously we would have set 6 breakpoints, now we correctly set just 3. This also extends to the expression parser when it looks up names for functions it needs to not get multiple results so we can call the correct function.

<rdar://problem/24599697> 

llvm-svn: 275281
2016-07-13 17:12:24 +00:00
Pavel Labath 1ee89eb8d9 Add "support" for DW_CFA_GNU_args_size to the unwinder
Summary:
This adds the knowledge of the DW_CFA_GNU_args_size instruction to the eh_frame parsing code.
Right now it is ignored as I am unsure how is it supposed to be handled, but now we are at least
able to parse the rest of the FDE containing this instruction.

I also add a fix for a bug which was exposed by this instruction. Namely, a mismatched sequence
of remember/restore instructions in the input could cause us to pop an empty stack and crash. Now
we just log the error and ignore the offending instruction.

Reviewers: jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 275260
2016-07-13 10:55:24 +00:00
Sean Callanan 6371058473 Revert r275223, which committed the wrong thing.
llvm-svn: 275237
2016-07-12 23:31:42 +00:00
Greg Clayton d28fae834a Remove assert since it was crashing the mutli process driver tests. Made the code behave correctly when indexes are out of range or the collection is empty and is "log enable lldb unwind" is enabled, log an error message.
llvm-svn: 275226
2016-07-12 23:07:50 +00:00
Greg Clayton f1d93ecc76 This doesn't compiler on Darwin. Skipping it.
llvm-svn: 275225
2016-07-12 23:06:28 +00:00
Sean Callanan 3b477ac4f9 Mark TagDecls as having external visible storage, like ContainerDecls.
The lookup tables can get out of date during the lifetime of the object so we
need to preserve LLDB's ability to answer questions about TagDecls' contents.

<rdar://problem/20751935>

llvm-svn: 275223
2016-07-12 22:42:07 +00:00
Enrico Granata 7031867b9b Tweaks to the NSIndexPath formatter to enhance stability
rdar://problem/25767901

llvm-svn: 275199
2016-07-12 18:33:52 +00:00
Oleksiy Vyalov 9d90186d8c Add logging to Linux Host::GetProcessAndStatInfo.
llvm-svn: 275198
2016-07-12 18:14:27 +00:00
Pavel Labath bb5651bd61 Increase "process load" timeout
Loading a dynamic library can take quite a long time, since it triggers a number of
shared-library-event stops for dependent libraries. This is especially true for remote targets
due to communication latency. Increase the default 500ms timeout to account for that.

Committing as obvious.

llvm-svn: 275185
2016-07-12 16:06:31 +00:00
Pavel Labath 3be0a3a173 [NPL] Increase ETXTBSY workaround sleep
10ms does not seem to be enough all the time, go to 50.

llvm-svn: 275175
2016-07-12 15:13:11 +00:00
Pavel Labath 8a93f822e1 [test] Fix category-based skipping
Summary:
LLDBTestResult.hardMarkAsSkipped marked the whole class as skipped when the first class in the
test failed the category check. This meant that subsequent tests in the same class did not run
even if they were passing the category filter. Fix that.

Reviewers: tfiala

Subscribers: lldb-commits

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

llvm-svn: 275173
2016-07-12 15:07:18 +00:00
Pavel Labath dc15f1d7b8 Fix a race on process exit
Summary:
Process::SetExitStatus was popping the process io handler and resetting m_process_input_reader
shared pointer, which is not a safe thing to do as the function is called asynchronously and
other threads may be accessing the member variable. (E.g. if the process terminates really
quickly, the private state thread might only be in the process of pushing the handler on the
stack. Sometimes, this leads to deadlock, as the shared pointer's state gets corrupted by the
concurrent access.

Since the IOHandler will be popped anyway in Process:HandleProcessStateChangedEvent when the
exited event gets processed, doing the same in SetExitStatus seems to be unnecessary.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 275165
2016-07-12 09:37:55 +00:00
Pavel Labath 402c8c0716 Dwarf parser: don't lookup void typedefs in the DWO
Summary:
void typedefs do not have a DW_AT_type attribute, so we end up with an empty encoding_uid
variable. These don't need to be looked up and trying to look that will assert in a debug build.

Reviewers: clayborg

Subscribers: lldb-commits, tberghammer

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

llvm-svn: 275164
2016-07-12 09:26:30 +00:00
Jason Molenda 85967fa3c4 Add some safety checks to Platform::GetRemoteSharedModule so if it
is passed a ModuleSpec with a UUID, it won't accept a file it finds
with a matching FileSpec & ArchSpec, but with a different UUID.

<rdar://problem/27258864> 

llvm-svn: 275151
2016-07-12 03:25:22 +00:00
Stephane Sezer 185ab5b030 Add LLVM build config for BuildAndIntegration.
Reviewers: tfiala, clayborg

Subscribers: lldb-commits

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

llvm-svn: 275140
2016-07-12 01:44:58 +00:00
Stephane Sezer f54fe041f0 Make ThreadPlanStepInstruction's constructor public.
Summary:
Some thread plans have public contructors, some others have protected
constructors with friend classes. Not sure how these were determined,
but this thread plan is going to be required to implement trampoline
step-through on Windows.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 275139
2016-07-12 01:43:46 +00:00
Stephane Sezer de76548f9a Apply local patches when building llvm on Mac.
Summary:
This is already done when building for linux with the CMake build
system. This functionality disappeared recently when some of the build
scripts used by the xcode build system changed.

Reviewers: tfiala, clayborg

Subscribers: lldb-commits

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

llvm-svn: 275134
2016-07-12 01:28:59 +00:00
Greg Clayton aacb80853a Fixed a threading race condition where we could crash after calling Debugger::Terminate().
The issue was we have two global variables: one that contains a DebuggerList pointer and one that contains a std::mutex pointer. These get initialized in Debugger::Initialize(), and everywhere that uses these does:

if (g_debugger_list_ptr && g_debugger_list_mutex_ptr)
{
    std::lock_guard<std::recursive_mutex> guard(*g_debugger_list_mutex_ptr);
    // do work while mutex is locked
}

Debugger::Terminate() was deleting and nulling out g_debugger_list_ptr which meant we had a race condition where someone might do the if statement and it evaluates to true, then another thread calls Debugger::Terminate() and deletes and nulls out g_debugger_list_ptr while holding the mutex, and another thread then locks the mutex and tries to use g_debugger_list_ptr. The fix is to just not delete and null out the g_debugger_list_ptr variable.

llvm-svn: 275119
2016-07-11 22:50:18 +00:00
Enrico Granata 02989a4b5d Fix an issue where one could not define a Python command with the same name as an existing alias (or rather, one could but the results of invoking the command were far from satisfactory)
llvm-svn: 275080
2016-07-11 17:36:55 +00:00
Tamas Berghammer c73301bbe3 Change the /proc/<pid>/maps to not assert on incorrect input
If LLDB reads some incorrect input form /proc/<pid>/maps then it
should report an error instead of assert-ing as we don't want to
crash in case of an incorrect maps file.

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

llvm-svn: 275060
2016-07-11 13:43:27 +00:00
Greg Clayton 6a3116415b When calling "settings set target.source-map <old-path> <new-path>", make sure that <new-path> exists before accepting it as a remapping.
We had some clients that had added old source paths remappings to their .lldbinit files and they were causing trouble at a later date. This fix should help mitigate these issues.

<rdar://problem/26358860>

llvm-svn: 274948
2016-07-08 23:06:38 +00:00
Enrico Granata 3b207c6655 Make IsSyntheticChildrenGenerated() virtual so that dynamic and synthetic values can refer back to their parents
llvm-svn: 274901
2016-07-08 18:39:36 +00:00