Commit Graph

14796 Commits

Author SHA1 Message Date
Enrico Granata d2a10e88f6 Print a warning if the directory passed to --test-subdir doesn't end up existing
llvm-svn: 276709
2016-07-25 23:26:24 +00:00
Jason Molenda 716814aa8a Remove some tab characters that snuck in to my mnost recent edits.
llvm-svn: 276485
2016-07-22 22:26:26 +00:00
Todd Fiala 6118ce1221 Breakup TestConcurrentEvents.py into separate test subdirs per test method
This change breaks up the monolithic TestConcurrentEvents.py into a
separate subdir per test method. This allows them to run concurrently,
reduces the chance of a timeout occurring during normal operation, and
allows us to home in on any test methods that may be locking up.

This is step one in the process of squashing timeouts in these test
methods.

The reason for breaking each test method into its own file is to make it
very clear to us if there are a subset of the tests that do in fact lock
up frequently. This will limit how much hunting we need to do to
recreate it.

The reason for putting each file in a separate subdirectory is so that
our concurrent test runner can run multiple test files at the same time.
The unit of serialization in the LLDB test suite is the test directory,
so moving them into separate directories enables the test runner to do
more at the same time.

This change introduces usage of VPATH from gnu make. I use that to
facilitate keeping a single copy of the main.cpp in the parent
concurrent_events directory. Initially I had tried specifying the source
file as ../main.cpp, but our current makefile rules get confused by that
and then also build the output into the parent directory, which defeats
the ability to run each of the test methods concurrently. In the event
that not all systems support VPATH, I can do a bit of surgery on the
Makefile rules and attempt to make it smarter with regards to relative
paths to source files used in the build.

llvm-svn: 276478
2016-07-22 21:50:55 +00:00
Tamas Berghammer d7d69f8083 Support loading files even when incorrect file name specified by the linker
"Incorrect" file name seen on Android whene the main executable is
called "app_process32" (or 64) but the linker specifies the package
name (e.g. com.android.calculator2). Additionally it can be present
in case of some linker bugs.

This CL adds logic to try to fetch the correct file name from the proc
file system based on the base address sepcified by the linker in case
we are failed to load the module by name.

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

llvm-svn: 276411
2016-07-22 12:55:35 +00:00
Pavel Labath 4e6fad5760 Fixing layout of elf-core file related structures
Summary:
The binary layout of prstatus and prpsinfo was wrong.
Some of the member variables where not aligned properly
and others where with a wrong type (e.g. the time related
stuff in prstatus).

I used the structs defined in bfd in binutils to see what the layout
of the elf-core format in these section is.
(https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/hosts/x86-64linux.h;h=4e420a1f2081dd3b51f5d6b7a8e4093580f5cdb5;hb=master)
Note: those structures are only for x86 64 bit elf-core files

This shouldn't have any impact on the functionality, because
lldb actually uses only a few of the member variables of those structs
and they are with a correct type and alignment.

I found this while trying to add/fix the support for
i386 core files (https://llvm.org/bugs/show_bug.cgi?id=26947)

Reviewers: labath

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D22628
Author: Dimitar Vlahovski <dvlahovski@google.com>

llvm-svn: 276406
2016-07-22 12:18:45 +00:00
Tamas Berghammer 0576ad6d35 Fix a crash when an ELF section symbol have no name
llvm-svn: 276403
2016-07-22 10:43:03 +00:00
Jason Molenda 37397353cc Add support to get the shared cache information from the new
debugserver jGetSharedCacheInfo packet instead of reading 
the dyld internal data structures directly.  This code is 
(currently) only used for ios native lldb's - I should really
move this ObjectFileMachO::GetProcessSharedCacheUUID method
somewhere else, it makes less and less sense being in the
file reader.

<rdar://problem/25251243> 

llvm-svn: 276369
2016-07-22 00:17:55 +00:00
Jason Molenda e62dda20a4 Stop printing double { characters on Dictionary StructuredData objects
when Dumping, thanks to Devin to catching the edit mistake I made in 
r276079.

llvm-svn: 276351
2016-07-21 22:50:01 +00:00
Oleksiy Vyalov dd778ca6b5 Add check for non-null log instance in PlatformAndroid.
llvm-svn: 276303
2016-07-21 17:03:25 +00:00
Pavel Labath 5ad891f719 Unify process launching code on linux
Summary:
We've had two copies of code for launching processes:
- one in NativeProcessLinux, used for launching debugged processes
- one in ProcessLauncherAndroid, used on android for launching all other kinds of processes

These have over time acquired support for various launch options, but neither supported all of
them. I now replace them with a single implementation ProcessLauncherLinux, which supports all
the options the individual versions supported and set it to be used to launch all processes on
linux.

This also works around the ETXTBSY issue on android when the process is started from the platform
instance, as that used to go through the version which did not contain the workaround.

Reviewers: tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 276288
2016-07-21 14:54:03 +00:00
Jason Molenda 9ab5dc2417 Add a new DynamicLoader plugin that uses SPI that are in development
for the fall (northern hemisphere) 2016 Darwin platforms to learn
about loaded images, instead of reading dyld internal data structures.
These new SPI don't exist on older releases, and new packets are
needed from debugserver to use them (those changes are already committed).

I had to change the minimum deployment target for debugserver in the xcode
project file to macOS 10.10 so that debugserver will use the 
[[NSProcessInfo processInfo] operatingSystemVersion]
call in MachProcess::GetOSVersionNumbers to get the operarting system
version # -- this API is only available in macOS 10.10 and newer
("OS X Yosemite", released Oct 2014).  If we have many people building
llvm.org lldb on older systems still, we can back off on this for the
llvm.org sources.

There should be no change in behavior with this commit, either to
older darwin systems or newer darwin systems.

For now the new DynamicLoader plugin is never activated - I'm forcing
the old plugin to be used in DynamicLoaderDarwin::UseDYLDSPI.
I'll remove that unconditional use of the old plugin soon, so the
newer plugin is used on the newest Darwin platforms.

<rdar://problem/25251243> 

llvm-svn: 276254
2016-07-21 08:30:55 +00:00
Enrico Granata 99bd2de619 Fix an issue where LLDB would detect an empty shared cache - which is legitimate albeit suboptimal - and warn about being unable to fetch ObjC class information, even though class data was actually properly loaded from the dynamic hashmap
Only ever warn about missing ObjC runtime class data if one either can't run the expressions to obtain such data, or the total count of classes is below a threshold that makes things sound really suspicious

Fixes rdar://27438500

llvm-svn: 276220
2016-07-21 00:13:40 +00:00
Francis Ricci 628fd34e84 Fix typo in test runner
llvm-svn: 276166
2016-07-20 19:37:31 +00:00
Jim Ingham 22c9e7b295 If x/i is followed by x/g, the format should be reset to 'x'.
Otherwise, you have to say "x/gx" to what you obviously intended to
happen to happen.

<rdar://problem/27415507>

llvm-svn: 276132
2016-07-20 15:41:12 +00:00
Jason Molenda d9c9da536f Add a default-value bool flag pretty_print to the StructuredData Dump methods.
They will dump pretty-print (indentation, extra whitepsace) by default.  
I'll make a change to ProcessGDBRemote soon so it stops sending JSON strings
to debugserver pretty-printed; it's unnecessary extra bytes being sent between
the two.

llvm-svn: 276079
2016-07-20 03:49:02 +00:00
Enrico Granata 1d2e609b01 s/Cocoa/Foundation/
llvm-svn: 276065
2016-07-19 23:58:23 +00:00
Enrico Granata e555763fc6 Fix an issue where the libc++ std::list formatter wasn't recognizing the new memory layout correctly
rdar://problem/26999542

llvm-svn: 276061
2016-07-19 23:50:31 +00:00
Enrico Granata b5ab08bdb1 Don't check the value of the unset variables on iOS
llvm-svn: 276033
2016-07-19 21:50:39 +00:00
Ed Maste 75500e72bb Typo corrections identified by codespell
Submitted by giffunip@yahoo.com; I fixed a couple of nearby errors and
incorrect changes in the patch.

llvm.org/pr27634

llvm-svn: 275983
2016-07-19 15:28:02 +00:00
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