Commit Graph

16100 Commits

Author SHA1 Message Date
Jim Ingham 5cfe9294fe TestStaticVariables still fails on Linux.
llvm-svn: 300519
2017-04-18 00:44:14 +00:00
Jim Ingham 7c0d74aa2b This test is succeeding on macOS with clang.
llvm-svn: 300517
2017-04-18 00:20:59 +00:00
Jason Molenda 1781d6f732 Unify the common code in the ios, tvos, watchos platforms into a single
PlatformRemoveDarwinDevice class, subclassed to those three so they can 
provide their specific information.

<rdar://problem/30159764> 

llvm-svn: 300512
2017-04-17 22:52:20 +00:00
Davide Italiano 52ffb53909 [ClangASTContext] Placate `casts away qualifiers` warnings from GCC.
llvm-svn: 300476
2017-04-17 18:24:18 +00:00
Greg Clayton 84577092ba Don't ever reduce the timeout of a packet, only increase it.
Differential Revision: https://reviews.llvm.org/D32087

llvm-svn: 300455
2017-04-17 16:20:22 +00:00
Kuba Mracek 66785fdb25 ThreadSanitizer plugin: Support Swift access races and fix how external races are displayed.
llvm-svn: 300416
2017-04-16 04:02:45 +00:00
Zachary Turner 426d1379b0 Fix crash when completing in the current directory.
llvm-svn: 300386
2017-04-15 02:44:53 +00:00
Davide Italiano cf8a8294e5 [Interpreter] Make a static func a lambda and remove always_inline.
The attribute was fairly dubious as: a) we shouldn't tell the compiler
when to inline functions, b) GCC complains that the function may be
not always inlinable.

llvm-svn: 300377
2017-04-14 22:36:08 +00:00
Davide Italiano 49a28fdafb [ARM/Emulation] Remove an unneeded comparison and simplify. NFCI.
reg0 is always zero and comparison to an unsigned always yields
true.

llvm-svn: 300375
2017-04-14 22:27:28 +00:00
Chris Bieneman e0f17785f8 Fix bot breakage from r300372
Use #cmakedefine instead of #cmakedefine01 because the uses are ifndef instead of if.

llvm-svn: 300374
2017-04-14 22:20:36 +00:00
Davide Italiano 6462def06d [Process/Utility] Remove dead code. NFCI.
llvm-svn: 300373
2017-04-14 22:04:05 +00:00
Chris Bieneman b90bee044b [CMake] Support generating Config.h
Summary:
This patch removes the hand maintained config files in favor of auto-generating the config file. We will still need to maintain the defines for the Xcode builds on Mac, but all CMake builds use the generated header instead.

This will enable finer grained platform support tests and enable supporting LLDB on more platforms with less manual maintenance.

I have only tested this patch on Darwin, and any help testing it out on other platforms would be greatly appreciated. I've probably messed something up somewhere.

Reviewers: labath, zturner

Reviewed By: labath

Subscribers: krytarowski, emaste, srhines, lldb-commits, mgorny

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

llvm-svn: 300372
2017-04-14 22:03:45 +00:00
Greg Clayton 70a9f511c2 Increase the packet timeout for the jModulesInfo since it can take longer than the default 1 second timeout on some linux versions when many shared libraries are involved.
llvm-svn: 300342
2017-04-14 17:10:04 +00:00
Greg Clayton db1550ab66 Fixed to disassemble new packets and fixed the dumping of the 'x' packets.
llvm-svn: 300341
2017-04-14 17:05:21 +00:00
Jason Molenda 3f60829455 Don't use uuid_clear(), non-darwin platforms include
Utility/UuidCompatibility.h which gets you a definiton
of uuid_t but none of the functions that operate on it.

llvm-svn: 300162
2017-04-13 02:12:32 +00:00
Jason Molenda 9b7fcdcb57 Use two LC_NOTE load commands for identifying the main binary that
lldb should use when given a corefile.

This uses an LC_NOTE "main bin spec" or an LC_NOTE "kern ver str"
if they are present in a Mach-O core file.

Core files may have multiple different binaries -- different kernels,
or a mix of user process and kernel binaries -- and it can be
difficult for lldb to detect the correct one to use simply by looking
at the pages of memory.  These two new LC_NOTE load commands allow
for the correct binary to be recorded unambiguously.

<rdar://problem/20878266> 

llvm-svn: 300138
2017-04-12 23:33:30 +00:00
Chris Bieneman a4f532e0ac [NFC] Adding a new wrapper for getaddrinfo
Summary: This patch adds a new wrapper for getaddrinfo which returns a std::vector of SocketAddresses. While this patch doesn't add any uses of the new function, I have two separable patches that are dependent on this, so I put it in its own patch.

Reviewers: zturner

Reviewed By: zturner

Subscribers: lldb-commits

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

llvm-svn: 300112
2017-04-12 21:56:33 +00:00
Chris Bieneman efd065e6a0 Support Unit Testing debugserver
Summary:
This patch refactors the CMake build system's support for building debugserver to allow us to build the majority of debugserver's sources into the debugserverCommon library which can then be reused by unit tests.

The first unit test I've written tests debug server's ability to accept incoming connections from LLDB. The test forks the process, and one side creates a listening socket using debugserver's socket API, the other side creates a transmitting socket using LLDB's TCPSocket class.

I have no clue where to even start getting this connected into the LLDB Xcode project, so for now these tests are CMake-only.

Reviewers: zturner, labath, jasonmolenda

Subscribers: lldb-commits, mgorny

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

llvm-svn: 300111
2017-04-12 21:56:29 +00:00
Pavel Labath f0565cc84a Add libc++ category to the remaining libc++ data formatters
llvm-svn: 300054
2017-04-12 12:32:58 +00:00
Pavel Labath da7b15df70 Fix TestCppIncompleteTypes for android/clang
LDFLAGS contains some .a files. If it is specified before the relevant
object files, undefined symbol errors occur.

llvm-svn: 300048
2017-04-12 10:59:34 +00:00
Pavel Labath d3656a03ab Fix libc++ vector<bool> data formatter (bug #32553)
Summary:
The iteration list through the available data formatters was undefined,
which meant that the vector<bool> formatter kicked in only in cases
where it happened to be queried before the general vector formatter. To
fix this, I merge the two data formatter entries into one, and select
which implementation to use in the factory function.

Reviewers: jasonmolenda, tberghammer, EricWF

Subscribers: lldb-commits

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

llvm-svn: 300047
2017-04-12 10:59:24 +00:00
Pavel Labath 74207ad7ba Fix TestGuessLanguage for gcc
gcc emits DW_LANG_C89 even if we specify -std=c99 during compilation.
Since this isn't an lldb bug, but just the way the compiler happens to
be implemented, I teach the test to expect this situation correctly.

llvm-svn: 300046
2017-04-12 10:13:50 +00:00
Pavel Labath efe4e412ad Android.rules: setup correct objcopy path
This fixes a couple of tests when using android clang as a compiler.

llvm-svn: 300045
2017-04-12 10:13:47 +00:00
Jim Ingham bdbdd22937 Teach SBFrame how to guess its language.
<rdar://problem/31411646>

llvm-svn: 300012
2017-04-12 00:19:54 +00:00
Pavel Labath 0df645dda4 Add missing annotation to TestDataFormatterUnordered
llvm-svn: 299934
2017-04-11 12:26:33 +00:00
Pavel Labath f0a6d8ada3 Remove Plugins/Process/POSIX from include_directories
Summary:
The files there can always be referred to using their full path, which
is what most of the code has been doing already, so this makes the
situation more consistent. Also fix the the code in the FreeBSD plugin
to use the new paths.

Reviewers: eugene, emaste

Subscribers: lldb-commits, kettenis, mgorny, krytarowski

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

llvm-svn: 299933
2017-04-11 12:26:25 +00:00
Matt Arsenault 75696ffa25 Update for alloca construction changes
llvm-svn: 299898
2017-04-10 23:27:53 +00:00
Shoaib Meenai 96e541a7cf [lldb] Fix ninja URL
The old URL is a 404 now. Pointed out by Smirftsch1 on IRC.

llvm-svn: 299845
2017-04-10 15:41:15 +00:00
Jason Molenda 969230a702 Mark this test as XFAIL on all platforms, it's happening everywhere.
llvm.org/pr32553 and <rdar://problem/30646077> are tracking this.

llvm-svn: 299807
2017-04-07 23:20:22 +00:00
Kamil Rytarowski 426e864182 Correct environ parsing on NetBSD
Summary:
This replaces old code in Host::GetEnvironment for NetBSD
with the version from Linux. This makes parsing environment
variables correctly. It also fixes programs that depend on the
variables like curses(3) applications.

Long term this function should be moved to Process Plugin,
as currently env variables are not available with remote
debugging.

Other BSDs might want to catch up after this change.

Tested with NetBSD top(1).

Sponsored by <The NetBSD Foundation>

Reviewers: emaste, labath, joerg, kettenis

Reviewed By: emaste

Subscribers: #lldb

Tags: #lldb

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

llvm-svn: 299783
2017-04-07 16:45:36 +00:00
Ed Maste 70a26e93a9 Correct environ parsing on FreeBSD
Sync Host:GetEnvironment with Linux and Kamil Rytarowski's forthcoming
NetBSD change in review D31784.

llvm-svn: 299781
2017-04-07 16:40:25 +00:00
Eugene Zemtsov 5753710248 Add more tests for ExtractContextAndIdentifier
llvm-svn: 299729
2017-04-06 23:12:43 +00:00
Eugene Zemtsov a633ee6e4a New C++ function name parsing logic (Resubmit)
Current implementation of CPlusPlusLanguage::MethodName::Parse() doesn't
get anywhere close to covering full extent of possible function declarations.
It causes incorrect behavior in avoid-stepping and sometimes messes
printing of thread backtrace.

This change implements more methodical parsing logic based on clang
lexer and simple recursive parser.

Examples:
void std::vector<Class, std::allocator<Class>>::_M_emplace_back_aux<Class const&>(Class const&)
void (*&std::_Any_data::_M_access<void (*)()>())()

Previous version of this change (D31451) was rolled back due to an issue
with Objective-C selectors being incorrectly recognized as a C++ identifier.

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

llvm-svn: 299721
2017-04-06 22:36:02 +00:00
Zachary Turner 813de71329 Try to fix FreeBSD build after IWYU changes.
llvm-svn: 299719
2017-04-06 22:18:59 +00:00
Zachary Turner 720bd7af62 Fix build failure in unit test.
llvm-svn: 299718
2017-04-06 21:57:39 +00:00
Zachary Turner 2f3df6137a iwyu fixes for lldbCore.
This adjusts header file includes for headers and source files
in Core.  In doing so, one dependency cycle is eliminated
because all the includes from Core to that project were dead
includes anyway.  In places where some files in other projects
were only compiling due to a transitive include from another
header, fixups have been made so that those files also include
the header they need.  Tested on Windows and Linux, and plan
to address failures on OSX and FreeBSD after watching the
bots.

llvm-svn: 299714
2017-04-06 21:28:29 +00:00
Zachary Turner 8d4e2768be Try to fix FreeBSD build after iwyu changes.
llvm-svn: 299705
2017-04-06 20:51:22 +00:00
Tamas Berghammer 95776ad5b8 XFAIL TestDataFormatterLibcxxVBool on Linux & Android
The skipping logic for the test have been fixed recently but the test is
very flakey on the buildbot.

llvm-svn: 299677
2017-04-06 18:15:43 +00:00
Zachary Turner 4479ac15c9 iwyu fixes on lldbUtility.
This patch makes adjustments to header file includes in
lldbUtility based on recommendations by the iwyu tool
(include-what-you-use).  The goal here is to make sure that
all files include the exact set of headers which are needed
for that file only, to eliminate cases of dead includes (e.g.
someone deleted some code but forgot to delete the header
includes that that code necessitated), and to eliminate the
case where header includes are picked up transitively.

llvm-svn: 299676
2017-04-06 18:12:24 +00:00
Jason Molenda 30169d5ef2 Update unittests/Host/SocketTest.cpp to also use the new
one-socket API.

llvm-svn: 299613
2017-04-06 03:16:44 +00:00
Jason Molenda 3533cec58b Some old mach-o core files have an LC_IDENT load command
and there's a string in there that can be helpful in locating
the kernel binary.  Use it.
<rdar://problem/31444711> 

llvm-svn: 299612
2017-04-06 01:50:11 +00:00
Jim Ingham bef72b77fa getAsInteger is not a equivalent replacement for strtol
work around that fact for CommandObjectMemoryWrite.

<rdar://problem/31457148>

llvm-svn: 299609
2017-04-06 01:33:38 +00:00
Jason Molenda 90dce06f24 Change how UDP sockets are set up -- use the same one socket for
both sending and receiving information, instead of using one socket
to send and another to receive.  The two socket arrangement fails over
when a firewall is between the two systems.
<rdar://problem/31286757> 

llvm-svn: 299608
2017-04-06 01:21:44 +00:00
Pavel Labath 46f1d4a12c Annotate some more libc++ tests with the new category
This makes sure we are able to run them properly on android.

llvm-svn: 299588
2017-04-05 20:34:26 +00:00
Sean Callanan 894c147104 The darwin_log tests are very fragile and currently do not properly assess the state of that functionality.
I have put them all in their own category, and made that category disabled by default.

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

llvm-svn: 299587
2017-04-05 20:33:39 +00:00
Nitesh Jain d5be88ecf8 Fix a typo introduce in r299200.
llvm-svn: 299527
2017-04-05 09:31:43 +00:00
Jim Ingham 9645a6290a Reverting r299374 & r299402 due to testsuite failure.
This caused a failure in the test case:

  functionalities/breakpoint/objc/TestObjCBreakpoints.py

When we are parsing up names we stick interesting parts of the names
in various buckets, one of which is the ObjC selector bucket.  The new
C++ name parser must be interfering with this process somehow.

<rdar://problem/31439305>

llvm-svn: 299489
2017-04-05 00:08:21 +00:00
Jim Ingham 61cc47ad30 Tone down the "lldb types" log a bit.
Change the get shared class info function to only
dump its results to the inferior stdout when the
log is verbose.  This matches the lldb side of the
same process, which only logs what it found if the
log is on verbose.

llvm-svn: 299451
2017-04-04 17:48:21 +00:00
Ilia K a97973ab4e Enable lldm-mi commands -stack-list-locals -stack-list-variables and -var-create to work only with variables in scope
Patch by ayuckhulk

Reviewers: abidh, lldb-commits, ki.stfu

Reviewed By: ki.stfu

Tags: #lldb

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

llvm-svn: 299417
2017-04-04 08:00:28 +00:00
Jason Molenda 498ff61e2d Skip three test cases that are asserting on macosx as of r299199. A quick
look showed that the target's arch has no core / byte order and so when
AuxVector::AuxVector calls into a dataextractor and sets the byte size to 0,
it asserts.  e.g.

  m_arch = {
    m_triple = (Data = "x86_64--linux", Arch = x86_64, SubArch = NoSubArch, Vendor = UnknownVendor, OS = Linux, Environment = UnknownEnvironment, ObjectFormat = ELF)
    m_core = kCore_invalid
    m_byte_order = eByteOrderInvalid
    m_flags = 0x00000000
    m_distribution_id = <no value available>
  }

<rdar://problem/31380097> 

llvm-svn: 299408
2017-04-04 01:09:20 +00:00