Commit Graph

18951 Commits

Author SHA1 Message Date
Benjamin Kramer 93110c2fe4 Make function definition in header inline
Otherwise including this header from more than one place will break
linking.

llvm-svn: 355684
2019-03-08 10:43:56 +00:00
Jason Molenda 988332a54a Add ASAN llvm build directory variants to
get_llvm_bin_dirs().

llvm-svn: 355661
2019-03-08 04:18:21 +00:00
Jonas Devlieghere a9daa6a022 [Reproducers] TestImagineList.test -> TestImageList.test
And run the actual binary so we load the shared libraries.

llvm-svn: 355658
2019-03-08 00:53:57 +00:00
Jonas Devlieghere 743a27908f [Reproducers] Mark partial specialization as inline
The overload and/or template specialization are regular functions and
should be marked inline when implemented in the header. Writing the
previous commit message should've made that obvious but I was already
overthinking it. This will fix the windows bot.

llvm-svn: 355657
2019-03-08 00:24:06 +00:00
Zachary Turner 7e89b3cc17 [lldb-vscode] Report an error if an invalid program is specified.
Previously if an invalid program was specified, there was a bug
which, when we attempted to launch the program, would report that
the operation succeeded, causing LLDB to then hang while waiting
indefinitely to receive some events from the process.

After this patch, when an invalid program is specified, we immediately
return to vs code with an error message that indicates that the
program can not be found.

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

llvm-svn: 355656
2019-03-08 00:11:27 +00:00
Jonas Devlieghere 4aba7bb923 [Reproducers] Use partial template specialization instead of overload
Not sure if this is what's causing MSVC to claim the function to be
already defined elsewhere, but worth a shot.

llvm-svn: 355654
2019-03-07 23:37:46 +00:00
Jonas Devlieghere 8d359c147d Make bytes_read an unsigned
llvm-svn: 355651
2019-03-07 22:59:55 +00:00
Jonas Devlieghere 4e7301ecf2 Remove unused function
llvm-svn: 355650
2019-03-07 22:58:39 +00:00
Jonas Devlieghere 581af8b09d [SBAPI] Log from record macro
The current record macros already log the function being called. This
patch extends the macros to also log their input arguments and removes
explicit logging from the SB API.

This might degrade the amount of information in some cases (because of
smarter casts or efforts to log return values). However I think this is
outweighed by the increased coverage and consistency. Furthermore, using
the reproducer infrastructure, diagnosing bugs in the API layer should
become much easier compared to relying on log messages.

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

llvm-svn: 355649
2019-03-07 22:47:13 +00:00
Alex Langford d672e533d5 Fix TestPaths.py on windows
I committed an implementation of GetClangResourceDir on windows but
forgot to update this test. I merged the tests like I intended to, but I
realized that the test was actually failing. After looking into it, it
appears that FileSystem::Resolve was taking the path and setting
the FileSpec's Directory to "/path/to/lldb/lib/clang/" and the File to
"9.0.0" which isn't what we want. So I removed the resolve line from
DefaultComputeClangResourceDir.

llvm-svn: 355648
2019-03-07 22:37:23 +00:00
Frederic Riss 46fac9c4f2 Add logging to TestQueues.py
In an attempt to understand why the test is still failing after r355555,
add some logging.

llvm-svn: 355647
2019-03-07 22:28:01 +00:00
Frederic Riss c525b36b43 Fix TestAppleSimulatorOSType.py with Xcode 10.2
It looks like the simctl tool shipped in Xcode10.2 changed the format of
its json output.

llvm-svn: 355644
2019-03-07 22:12:03 +00:00
Davide Italiano 47a149914d [testsuite] Recommit the TestTerminal directory.
Turns out this is actually testing that editline doesn't
screw up the terminal.

llvm-svn: 355640
2019-03-07 21:33:43 +00:00
Zachary Turner 29e8754172 [lldb-vscode] Support running in server mode on Windows.
Windows can't use standard i/o system calls such as read and write
to work with sockets, it instead needs to use the specific send
and recv calls.  This complicates matters for the debug adapter,
since it needs to be able to work in both server mode where it
communicates over a socket, as well as non-server mode where it
communicates via stdin and stdout.  To abstract this out, I've
introduced a class IOStream which hides all these details and
exposes a read/write interface that does the right on each
platform.

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

llvm-svn: 355637
2019-03-07 21:23:21 +00:00
Adrian Prantl 0c72a42a8f Add an LLVM-style dump method to CompilerType for extra convenience during debugging
This change has no effect on Release (NoAsserts) builds.

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

llvm-svn: 355632
2019-03-07 20:20:02 +00:00
Alex Langford 53954b5e12 [ExpressionParser] Implement ComputeClangResourceDir for Windows
Summary: This function is useful for expression evaluation, especially when doing swift debugging on windows.

Reviewers: aprantl, labath

Reviewed By: labath

Subscribers: teemperor, jdoerfert, lldb-commits

Tags: #lldb

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

llvm-svn: 355631
2019-03-07 20:09:15 +00:00
Ali Tamur d0156256e2 [lldb] Fix DW_OP_addrx uses.
Summary: DW_OP_GNU_addr_index has been renamed as DW_OP_addrx in the standard. clang produces DW_OP_addrx tags and with this change lldb starts to process them.

Reviewers: aprantl, jingham, davide, clayborg, serge-sans-paille

Reviewed By: aprantl

Subscribers: jdoerfert, dblaikie, labath, shafik, lldb-commits

Tags: #lldb

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

llvm-svn: 355629
2019-03-07 19:41:08 +00:00
Davide Italiano 2f94dcec5a [testsuite] Spring cleaning: this tests `stty`, not `lldb`.
llvm-svn: 355615
2019-03-07 18:05:18 +00:00
Davide Italiano bd53e768d2 [testsuite] Drop characters that can't be decoded, restoring parity with Py2.
Tests that check the output of `memory find` may trip over
unreadable characters, and in Python 3 this is an error.

llvm-svn: 355612
2019-03-07 17:45:53 +00:00
Jan Kratochvil 8a4efd2153 Fix TestDataFormatter.test uninitialized variable
After D55626 I see a failure in my Fedora buildbot.

There is uninitialized variable as the Foo constructor has not been run and foo
is an autovariable.

(lldb) breakpoint set -f foo.cpp -l 11
Breakpoint 1: where = TestDataFormatter.test.tmp.out`main + 30 at foo.cpp:11:7, address = 0x000000000040112e
(lldb) run
Process 801065 stopped
* thread #1, name = 'TestDataFormatt', stop reason = breakpoint 1.1
    frame #0: 0x000000000040112e TestDataFormatter.test.tmp.out`main(argc=1, argv=0x00007fffffffcc48) at foo.cpp:11:7
   8   	};
   9
   10  	int main(int argc, char **argv) {
-> 11  	  Foo foo(1, 2.22);
   12  	  return 0;
   13  	}

Process 801065 launched: '.../tools/lldb/lit/Reproducer/Functionalities/Output/TestDataFormatter.test.tmp.out' (x86_64)
(lldb) frame var
(int) argc = 1
(char **) argv = 0x00007fffffffcc48
(Foo) foo = (m_i = 4198432, m_d = 0)

While the testcase expects m_i will be 0.

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

llvm-svn: 355611
2019-03-07 17:35:47 +00:00
Jonas Devlieghere 0ccc0b1a5f [Reproducers] Disable registering lldb::thread_t everywhere
As discussed on the mailing list, default serialization for thread ids
is not correct, even if they're represented as basic types. I'm
purposely leaving the corresponding record macros in place so that we
don't break the API boundary detection.

llvm-svn: 355610
2019-03-07 17:27:33 +00:00
Jan Kratochvil 67fb9b4a31 Skip TestGdbserverPort.test on Windows
lldb/cmake/modules/LLDBConfig.cmake does not build lldb-server on Windows:
if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
    set(LLDB_CAN_USE_LLDB_SERVER 1)

Also do not append 'platform' parameter twice - although that was quietly
ignored.

llvm-svn: 355579
2019-03-07 03:41:00 +00:00
Jason Molenda a583486065 When disassembling Aarch64 target and vendor Apple, set the cpu to
"apple-latest" which llvm uses to indicate the newest supported ISA.
Add a unit test; I'm only testing an armv8.1 instruction in this
unit test which would already be disassembled correctly because we
set the disassembler to ARM v8.2 mode, but it ensures that nothing
has been broken by adding this cpu spec.

<rdar://problem/38714781> 

llvm-svn: 355578
2019-03-07 03:16:45 +00:00
Alex Langford 03df653f71 Repair the build when LLDB_DISABLE_PYTHON is set
Summary:
If LLDB_DISABLE_PYTHON is set, some functions are unavailable but
SBReproducer assumes they are. Let's conditionally register those functions
since they are conditionally declared.

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

llvm-svn: 355575
2019-03-07 01:02:55 +00:00
Adrian Prantl db5a779f2f Avoid using -S in combination with "script"; it's unreliable.
llvm-svn: 355573
2019-03-07 00:46:56 +00:00
Adrian Prantl f4d2fa3fa0 crashlog.py: Catch exception from subprocess.
llvm-svn: 355572
2019-03-07 00:41:51 +00:00
Adrian Prantl 59a94225c9 Relax testcase.
Recent versions of llvm monorepo builds build libc++abi.dylib as libc++abi.1.dylib.
This accespts both variants.

llvm-svn: 355571
2019-03-07 00:34:13 +00:00
Jonas Devlieghere ae5d62585e [Reproducers] Add tests for different types of functionality
This patch adds test that check that functionality in lldb continues to
work when replaying a reproducer.

 - Entries in image list are identical.
 - That stepping behaves the same.
 - That the data formatters behave the same.

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

llvm-svn: 355570
2019-03-07 00:24:44 +00:00
Adrian Prantl 28f7466f4e Promote more debug-only assertions to regular assertions.
llvm-svn: 355569
2019-03-07 00:14:20 +00:00
Adrian Prantl 1dfba3cfba Promote more debug-only assertions to regular assertions.
llvm-svn: 355568
2019-03-07 00:10:11 +00:00
Davide Italiano 9a8e777f8c [Python] Unbreak the recently modified tests for python 2.
llvm-svn: 355566
2019-03-06 23:50:36 +00:00
Jason Molenda 2d6e6cbacc Remove the warning in
DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule
which would list every kext that failed to load when doing kernel
debugging.  Instead, in DynamicLoaderDarwinKernel::ParseKextSummaries,
print a summary of how many kexts lldb was unable to load at the end.

I want to reduce the amount of output at the start of kernel debug
sessions a bit; we'll see if anyone really wanted to see the list of
which kexts specifically were unable to be loaded.

No functional change, only changing lldb's output at the start of
a kernel debug session.

<rdar://problem/48654569> 

llvm-svn: 355565
2019-03-06 23:47:52 +00:00
Davide Italiano a658ab9f55 [testsuite] Port crashlog to python 3, second attempt.
llvm-svn: 355562
2019-03-06 22:54:11 +00:00
Jim Ingham 798174455f Fix Cmake files for ExpressionSourceCode.cpp -> ClangExpressionSourceCode.cpp.
llvm-svn: 355561
2019-03-06 22:53:38 +00:00
Jim Ingham ea401ec7f4 Factor the clang specific parts of ExpressionSourceCode.{h,cpp} into the clang plugin.
NFC

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

llvm-svn: 355560
2019-03-06 22:43:25 +00:00
Zachary Turner 2157f57d2d Pass /bigobj for SBReproducer.cpp with MSVC
/BIGOBJ is used to bypass certain COFF file format
limitations and is used with, unsurprisingly, very big
object files.  This file has grown large enough that it
needs this flag in order to compile successfully.

llvm-svn: 355559
2019-03-06 22:42:34 +00:00
Zachary Turner 3229000f63 [lldb-vscode] Correctly propagate errors back to VS Code.
llvm-svn: 355557
2019-03-06 22:30:06 +00:00
Frederic Riss fcda044d22 [debugserver] Fix IsUserReady thread filtering
Summary:
In 2010 (r118866), filtering code was added to debugserver to avoid reporting threads
that were "not ready to be displayed to the user". This code inspects the thread's
state and discards threads marked 'uninterruptible'. Turns out, this state is pretty
common and not only a characterisitic of 'user-readiness'. This filtering was tracked
down as the source of the flakiness of TestQueues and TestConcurrent* with the symptom
of missing threads.

We discussed with the kernel team and there should be no need for us to filter the
restult of task_threads(). Everything that is returned from there can be examined.
So I went on and tried to remove the filtering completely. This produces other test
failures, where we were reporting more theads than expected. Always threads that had
been terminated, but weren't removed from the task bookkeeping structures yet. Those
threads always had a PC of 0.

This patch changes the heuristic to make the filtering a little less strict and only
rejects threads that are 'uninteruptible' *and* have a PC of 0. This has proven to be
solid in my testing.

Reviewers: jasonmolenda, clayborg, jingham

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 355555
2019-03-06 21:56:14 +00:00
Jan Kratochvil 94b1ff72f5 Sanity check --max-gdbserver-port
In mail
	[lldb-dev] Remote debugging a docker process
	https://lists.llvm.org/pipermail/lldb-dev/2019-March/014795.html
user was confused by --min-gdbserver-port and --max-gdbserver-port options
being ignored. I think there is even a bug that --max-gdbserver-port is upper
exclusive limit (and not upper inclusive limit appropriate for max).

At least this patch should catch such mistake by an error message. The question
is whether --max-gdbserver-port should not be changed to really be max and not
max+1 but that would break backward compatibility.

Now the mail example does produce:
	error: --min-gdbserver-port (5001) is not lower than --max-gdbserver-port (5001)

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

llvm-svn: 355554
2019-03-06 21:52:19 +00:00
Adrian Prantl 0e4c482124 Pass ConstString by value (NFC)
My apologies for the large patch. With the exception of ConstString.h
itself it was entirely produced by sed.

ConstString has exactly one const char * data member, so passing a
ConstString by reference is not any more efficient than copying it by
value. In both cases a single pointer is passed. But passing it by
value makes it harder to accidentally return the address of a local
object.

(This fixes rdar://problem/48640859 for the Apple folks)

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

llvm-svn: 355553
2019-03-06 21:22:25 +00:00
Raphael Isemann a4a167fb75 Remove redundant second os.path.join call [NFC]
llvm-svn: 355548
2019-03-06 20:51:28 +00:00
Zachary Turner 8f7cfecfbf Try again to fix OSX compilation failure.
llvm-svn: 355536
2019-03-06 19:14:41 +00:00
Zachary Turner a313ec11fc Try to fix OSX compilation failure.
llvm-svn: 355531
2019-03-06 18:44:27 +00:00
Zachary Turner a89ce43cec Resubmit "Don't include UnixSignals.h from Host."
This was reverted because it breaks the GreenDragon bot, but
the reason for the breakage is lost, so I'm resubmitting this
now so we can find out what the problem is.

llvm-svn: 355528
2019-03-06 18:20:23 +00:00
Greg Clayton 6795eb3884 Fix core files for 32 bit architectures that are supported in ProcessELFCore.cpp
Core files need to know the size of the PRSTATUS header so that we can grab the register values that follow it. The code that figure out this size was using a hard coded list of architecture cores instead of relying on 32 or 64 bit for most cores.

The fix here fixes core files for 32 bit ARM. Prior to this the PRSTATUS header size was being returned as zero and the register values were being taken from the first bytes of the PRSTATUS struct (signo, etc).

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

llvm-svn: 355526
2019-03-06 18:04:10 +00:00
Shafik Yaghmour 641d0b8cee Adding test to cover the correct import of SourceLocation pertaining to a built-in during expression parsing
Summary: This tests a fix in the ASTImpoter.cpp to ensure that we import built-in correctly,
see differential: https://reviews.llvm.org/D58743
Once this change is merged this test should pass and should catch regressions in this feature.

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

llvm-svn: 355525
2019-03-06 18:03:54 +00:00
Tatyana Krasnukha 1b6700eff4 Re-apply "Fix embedded Python initialization according to changes in version 3.7"
llvm-svn: 355523
2019-03-06 17:27:40 +00:00
Jonas Devlieghere 584f3a6d38 [Reproducers] Guard register macros that take lldb::thread_t on Windows
On Windows, lldb::thread_t is just a void*, so the we will try to
allocate an object of type void when deserializing. Undef this for now
until we support void* arguments.

llvm-svn: 355519
2019-03-06 16:42:33 +00:00
Jonas Devlieghere 9ebe71a4e1 [Reproducers] Don't use VLA in SBReproducer redirect
This should unbreak the Windows bot.

llvm-svn: 355518
2019-03-06 16:33:48 +00:00
Michal Gorny 2508fcff60 [lldb] [lit] Attempt to fix regex in toolchain-clang.test
llvm-svn: 355510
2019-03-06 14:49:48 +00:00
Pavel Labath b8093314ef Move RangeMap.h into Utility
Summary:
This file implements some general purpose data structures, and so it
belongs to the Utility module.

Reviewers: zturner, jingham, JDevlieghere, clayborg, espindola

Subscribers: emaste, mgorny, javed.absar, arichardson, MaskRay, lldb-commits

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

llvm-svn: 355509
2019-03-06 14:41:43 +00:00
Michal Gorny a2cc148f9f [lldb] [test] Pass appropriate -L&-Wl,-rpath for libc++ on NetBSD
Pass appropriate -L and -Wl,-rpath flags pointing out to the LLVM
library directory on NetBSD.  This is necessary since clang on NetBSD
requires libc++ but it is not installed as part of the system
by default.  For the purpose of running buildbot, we want LLDB to use
just-built libc++.

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

llvm-svn: 355502
2019-03-06 14:03:18 +00:00
Jason Molenda 4cc9ff1245 Change the scanning algorithm in DynamicLoaderDarwinKernel::SearchForKernelNearPC.
Currently when lldb might be doing a kernel debug session, it scans through
memory by taking the current pc value and looking for a kernel at megabyte
boundaries, up to 32MB behind $pc.  This adjusts the algorithm to
scan back at every 16k page boundary and to stop scanning as soon
as we hit a memory read error.  The addition of stopping at a memory read
error saves us from tons of unnecessary packet traffic on generic 
targets where lldb might look for a kernel binary.

I've been trying to think of how to construct a test for this; it's a bit
tricky.  A gdb-remote protocol test with the contents of a fake tiny kernel
mach-o binary would satisify part of it, but this kernel path also directly
calls over to dsymForUUID or DebugSymbols framework lookups to find the 
kernel binary as well.  I'll keep thinking about this one, but it's so
intertangled with these two external systems that it may be hard to do.

<rdar://problem/48578197> 

llvm-svn: 355476
2019-03-06 02:45:27 +00:00
Jason Molenda b459f182e8 Re-commit logging for SBCompileUnit::GetNumLineEntries.
llvm-svn: 355473
2019-03-06 02:32:45 +00:00
Alex Langford a4223f9e5f [ExpressionParser] Fix ComputeClangResourceDirectory for windows
The function signature of ComputeClangResourceDirectory for windows
wasn't updated when the others changed, causing the windows build to
fail. This should fix that.

llvm-svn: 355471
2019-03-06 01:57:04 +00:00
Jonas Devlieghere 2e3e65fb62 [Reproducers] Enable replay from SBRepro.
Now that the LLDB instrumentation macros are in place, we should use
that to test reproducer replay.

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

llvm-svn: 355470
2019-03-06 01:49:57 +00:00
Jonas Devlieghere 7e23df4437 [Reproducers] Don't intercept SBDebugger::SetInputFileHandle
With the reproducer logic in place for the command interpreter we no
longer need to make SBDebugger::SetInputFileHandle a no-op.

llvm-svn: 355469
2019-03-06 01:49:54 +00:00
Adrian Prantl 61f1b70a78 Replace debug-only assert with a plain old assert.
llvm-svn: 355466
2019-03-06 01:07:45 +00:00
Jonas Devlieghere 3c28c0b2aa [Reproducers] Undef LLDB_REPRO_INSTR_TRACE
Forgot to undef this before landing.

llvm-svn: 355465
2019-03-06 01:00:36 +00:00
Jonas Devlieghere 504be84c9f [Reproducers] Fix warnings without asserts
Make sure the variable is used when asserts are compiled out.

llvm-svn: 355464
2019-03-06 00:52:48 +00:00
Alex Langford 787fe33434 [ExpressionParser] Test GetClangResourceDir
Summary:
I'm doing this because I plan on implementing `ComputeClangResourceDirectory`
on windows so that `GetClangResourceDir` will work.  Additionally, I made
test_paths make sure that the directory member of the returned FileSpec is not
none. This will fail on windows since `ComputeClangResourceDirectory` isn't
implemented yet.

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

llvm-svn: 355463
2019-03-06 00:45:16 +00:00
Jonas Devlieghere baf5664f50 [Reproducers] Add SBReproducer macros
This patch adds the SBReproducer macros needed to capture and reply the
corresponding calls. This patch was generated by running the lldb-instr
tool on the API source files.

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

llvm-svn: 355459
2019-03-06 00:06:00 +00:00
Jonas Devlieghere bd4bf82a48 [SBAPI] Don't check IsValid in constructor
When running the test suite with the instrumentation macros, I noticed
two lldb-mi tests regressed. The issue was the copy constructor of
SBLineEntry. Without the macros the returned value would be elided, but
with the macros the copy constructor was called. The latter using ::IsValid
to determine whether the underlying opaque pointer should be set. This
is likely a remnant of when ::IsValid would only check the validity of the
smart pointer. In SBLineEntry however, it actually forwards to
LineEntry::IsValid().

So what happened here was that because of the macros the copy
constructor was called. The opaque pointer was valid but the LineEntry
didn't consider itself valid. So the copied-to object ended up default
initialized.

This patch replaces all checks for IsValid in copy (assignment)
constructors with checks for the opaque pointer itself.

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

llvm-svn: 355458
2019-03-06 00:05:55 +00:00
Adrian Prantl d823020bac Remove tautological #ifdefs (NFC)
Differential Revision: https://reviews.llvm.org/D58838

llvm-svn: 355457
2019-03-05 23:51:25 +00:00
Jason Molenda f228b2c2ef Revert logging addition to SBCompileUnit::GetNumLineEntries,
causing lldb-mi testsuite failures?  

llvm-svn: 355449
2019-03-05 22:17:47 +00:00
Stella Stamenova 2717b76c1a [lit, windows] Disable stop-hook-threads on Windows
This test is also no longer reliably failing or passing on Windows and it is hanging every few runs.

llvm-svn: 355448
2019-03-05 21:43:04 +00:00
Stella Stamenova d15f3b188b [lldbsuite, windows] Skip the TestEvents tests on Windows
These tests are flakey on Windows and recently they have started failing AND also hanging the whole suite when they fail.

llvm-svn: 355443
2019-03-05 21:03:36 +00:00
Jason Molenda 14c1e08ff5 Add logging to SBCompileUnit::GetNumLineEntries.
llvm-svn: 355435
2019-03-05 19:43:56 +00:00
Shafik Yaghmour bb322e79c1 [DataFormatters] Fix regression in libc++ std::atomic formatter caused by https://reviews.llvm.org/D56913
rdar://problem/48568543

llvm-svn: 355422
2019-03-05 18:34:35 +00:00
Davide Italiano 70b082e85c Revert "[lldbtest] Check against the correct name for libcxxabi (macOS)."
This passes locally but breaks on the bots. Maybe an SDK difference.
Reverting while I investigate.

llvm-svn: 355415
2019-03-05 17:21:55 +00:00
Yury Delendik 05812b65db [lldb] Disable some of TestJITLoaderGDB.py tests on Windows
The test expect sample executable code be built, but fails on Windows.

Review comment https://reviews.llvm.org/D57689#1418597

Tags: #lldb

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

llvm-svn: 355413
2019-03-05 17:09:26 +00:00
Tatyana Krasnukha 622862987f Revert "Fix embedded Python initialization according to changes in version 3.7"
Testsuite hangs on Windows likely due to these changes.

llvm-svn: 355406
2019-03-05 15:27:33 +00:00
Yury Delendik bc6b225d42 Adds property to force enabling of GDB JIT loader for MacOS
Summary:
Based on https://gist.github.com/thlorenz/30bf0a3f67b1d97b2945#patching-and-rebuilding

The functionality was disabled at 521c2278ab

Reviewers: jingham

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 355402
2019-03-05 14:23:53 +00:00
Pavel Labath a55999301e One more UserIDResolver fix
The intention in r355323 has been to implement a no-op resolver in the
HostInfoBase class, which will then be shadowed a an implementation in
the HostInfoPosix class. However, I add the shadowing declaration in
HostInfoPosix.h, and instead had implemented the HostInfoBase function
in HostInfoPosix.cpp. This has lead to undefined symbols on windows, and
a subsequent implementation of a no-op resolver in HostInfoWindows
(r355329).

Since now there is no point on having a no-op resolver in the base
class, I just remove the base declaration altogether, and have
HostInfoPosix implement the (newly-declared) HostInfoPosix version of
that function.

llvm-svn: 355398
2019-03-05 12:51:20 +00:00
Alexander Kornienko 7523f743b4 [lldb] Fix linux host build after r355342
llvm-svn: 355392
2019-03-05 12:05:35 +00:00
Tatyana Krasnukha b30c1d571b Fix embedded Python initialization according to changes in version 3.7
Differential Revision: https://reviews.llvm.org/D58833

llvm-svn: 355388
2019-03-05 11:18:45 +00:00
Alex Langford 81dbc02671 [Expression] Remove unused parameter from Evaluate
llvm-svn: 355375
2019-03-05 03:33:34 +00:00
Davide Italiano 814ad73452 Revert "[testsuite] Port crashlog and dependencies to Python 3."
This revert the commit because it broke the bots. I need to find
a way that works with both versions.

llvm-svn: 355364
2019-03-05 01:34:47 +00:00
Davide Italiano fc188448fa [testsuite] Port crashlog and dependencies to Python 3.
Fixes three tests in the testsuite.

llvm-svn: 355359
2019-03-05 00:53:38 +00:00
Jim Ingham 3fc1a73a79 Fix the Xcode project for UserIDResolver.
llvm-svn: 355358
2019-03-05 00:52:12 +00:00
Davide Italiano 8800d30360 [lldbtest] Check against the correct name for libcxxabi (macOS).
llvm-svn: 355356
2019-03-05 00:47:15 +00:00
Davide Italiano e94add2f64 [Host] Fix the build (and the modules build).
-> Add a missing include to find the base class.
-> Add a missing out-of-line declaration for a member function.

llvm-svn: 355353
2019-03-05 00:37:40 +00:00
Shafik Yaghmour 6ed191093d Revert "[DataFormatters] Fix regression in libc++ std::atomic formatter caused by https://reviews.llvm.org/D56913"
This reverts commit r355351.

llvm-svn: 355352
2019-03-05 00:29:58 +00:00
Shafik Yaghmour d38e41ec60 [DataFormatters] Fix regression in libc++ std::atomic formatter caused by https://reviews.llvm.org/D56913
rdar://problem/48568543

llvm-svn: 355351
2019-03-05 00:17:18 +00:00
Zachary Turner 805e71060e Move ProcessInfo from Host to Utility.
There are set of classes in Target that describe the parameters of a
process - e.g. it's PID, name, user id, and similar. However, since it
is a bare description of a process and contains no actual functionality,
there's nothing specifically that makes this appropriate for being in
Target -- it could just as well be describing a process on the host, or
some hypothetical virtual process that doesn't even exist.

To cement this, I'm moving these classes to Utility. It's possible that
we can find a better place for it in the future, but as it is neither
Host specific nor Target specific, Utility seems like the most appropriate
place for the time being.

After this there is only 2 remaining references to Target from Host,
which I'll address in a followup.

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

llvm-svn: 355342
2019-03-04 21:51:03 +00:00
Alex Langford 0ca4f84f2f [build.py] Allow clang-cl to build files starting with '/U'
Summary:
clang-cl tries to match cl's interface, and treats /U as "Removes a
predefined macro" as cl does. When you feed clang-cl a file that begins with
'/U' (e.g. /Users/xiaobai/foo.c), clang-cl will emit a warning and in some cases
an error, like so:

clang-9: warning: '/Users/xiaobai/foo.c' treated as the '/U' option [-Wslash-u-filename]
clang-9: note: Use '--' to treat subsequent arguments as filenames
clang-9: error: no input files

If you're using clang-cl, make sure '--' is passed before the source file.

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

llvm-svn: 355341
2019-03-04 21:36:49 +00:00
Shoaib Meenai 5be71faf4b [build] Rename clang-headers to clang-resource-headers
Summary:
The current install-clang-headers target installs clang's resource
directory headers. This is different from the install-llvm-headers
target, which installs LLVM's API headers. We want to introduce the
corresponding target to clang, and the natural name for that new target
would be install-clang-headers. Rename the existing target to
install-clang-resource-headers to free up the install-clang-headers name
for the new target, following the discussion on cfe-dev [1].

I didn't find any bots on zorg referencing install-clang-headers. I'll
send out another PSA to cfe-dev to accompany this rename.

[1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html

Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille

Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits

Tags: #clang, #sanitizers, #lldb, #openmp, #llvm

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

llvm-svn: 355340
2019-03-04 21:19:53 +00:00
Zachary Turner bb4d4e2d76 Fix Windows build after UserIDResolver patch.
That patch added a function to HostInfo that returns an instance
of UserIDResolver, but this function was unimplemented on Windows,
leading to linker errors.  For now, just return a dummy implementation
that doesn't resolve user ids to get the build green.

llvm-svn: 355329
2019-03-04 19:57:04 +00:00
Pavel Labath aa51e6a683 Refactor user/group name resolving code
Summary:
This creates an abstract base class called "UserIDResolver", which can
be implemented to provide user/group ID resolution capabilities for
various objects. Posix host implement a PosixUserIDResolver, which does
that using posix apis (getpwuid and friends).  PlatformGDBRemote
forwards queries over the gdb-remote link, etc. ProcessInstanceInfo
class is refactored to make use of this interface instead of taking a
platform pointer as an argument. The base resolver class already
implements caching and thread-safety, so implementations don't have to
worry about that.

The main motivating factor for this was to remove external dependencies
from the ProcessInstanceInfo class (so it can be put next to
ProcessLaunchInfo and friends), but it has other benefits too:
- ability to test the user name caching code
- ability to test ProcessInstanceInfo dumping code
- consistent interface for user/group resolution between Platform and
  Host classes.

Reviewers: zturner, clayborg, jingham

Subscribers: mgorny, lldb-commits

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

llvm-svn: 355323
2019-03-04 18:48:00 +00:00
Michal Gorny de11105d2e [lldb] [test] Mark failing tests XFAIL on NetBSD
Add a convenience 'expectedFailureNetBSD' decorator and mark all tests
currently failing on NetBSD with it.  Also skip a few tests that hang
the test suite.  This should establish a baseline for the test suite
and get us closer to enabling tests on buildbot.  This will help us
catch regressions while we still have a lot of work to do to get tests
working.

It seems that there are also some flaky tests.  I am going to address
them later on.

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

llvm-svn: 355320
2019-03-04 16:54:06 +00:00
Michal Gorny e39ec43be7 [lldb] [Process/gdb-remote] Use '127.0.0.1' in ConnectLocally()
Use '127.0.0.1' instead of 'localhost' in ConnectLocally() function
as this is the specific address the server is bound to.  Using
'localhost' may involve trying IPv6 first which may accidentally be used
by another service.

While technically it might be interesting to support IPv6 here, it would
need to be supported properly, with the connection copying family
and address from the listening socket, and possibly without relying
on existence of 'localhost' at all.

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

llvm-svn: 355285
2019-03-03 12:42:43 +00:00
Pavel Labath e52b84ef8e Reinstate UNSUPPORTED: linux on stop-hook-threads.test
This stanza was removed in r355213, but it seems that patch did not
fully fix the problem, as the test still fails sporadically
(particularly under heavy load) on linux.

llvm-svn: 355276
2019-03-02 19:58:10 +00:00
Michal Gorny c10a884873 [lldb] [lit] Pass -pthread on NetBSD as well
llvm-svn: 355274
2019-03-02 16:48:44 +00:00
Michal Gorny 8085c1b3c1 [lldb] [lldbtest] Fix getBuildFlags() not to use libstdc++ on NetBSD
Remove the code forcing -stdlib=libstdc++ on NetBSD in getBuildFlags()
method.  NetBSD uses libc++ everywhere else, and using libstdc++ here
causes lang/cpp/dynamic-value to fail to build.

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

llvm-svn: 355273
2019-03-02 16:46:29 +00:00
Pavel Labath 113c4c108d Fix gcc build for r355249
automatic move should not fire when returning type T in a function with
result type Expected<T>. Some compilers seem to allow that nonetheless.

llvm-svn: 355270
2019-03-02 16:23:07 +00:00
Jonas Devlieghere d77c2e0926 [Reproducers] Capture and replay interpreter commands.
This patch adds the necessary logic to capture and replay commands
entered into the command interpreter. A DataRecorder shadows the input
and writes its data to a know file. During replay this file is used as
the command interpreter's input.

It's possible to the command interpreter more than once, with a
different input source. We support this scenario by using multiple
buffers. The synchronization for this takes place at the SB layer, where
we create a new recorder every time the debugger input is changed.
During replay we use the corresponding buffer as input.

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

llvm-svn: 355249
2019-03-02 00:20:26 +00:00
Adrian Prantl 25f718e9f8 Delete commented-out code.
llvm-svn: 355238
2019-03-01 22:30:31 +00:00
Jim Ingham 3139fc9767 Resubmit r354706 with a fix for process launch.
When the debugger is run in sync mode, you need to
be able to tell whether a hijacked resume is for some
special purpose (like waiting for the SIGSTOP on attach)
or just to perform a synchronous resume.  Target::Launch was doing
that wrong, and that caused stop-hooks on process launch
in source files to behave incorrectly.

<rdar://problem/48115661>

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

llvm-svn: 355213
2019-03-01 18:13:38 +00:00
Jason Molenda 7cdaf1e06b Update com.apple.diagnosticd.diagnostic entitlement
name to the newer com.apple.private.logging.diagnostic.

<rdar://problem/47183116> 

llvm-svn: 355170
2019-03-01 03:34:51 +00:00
Jason Molenda e772052edf Increase timeout in Symbols::DownloadObjectAndSymbolFile
from 30 seconds to 120 seconds.  We've seen cases where
this symbol lookup can exceed 30 seconds for people
working remotely.

<rdar://problem/48460476> 

llvm-svn: 355169
2019-03-01 03:24:59 +00:00