Commit Graph

1745 Commits

Author SHA1 Message Date
Greg Clayton 621e8b4387 Fix UUID decoding from minidump files
This patch fixes:

UUIDs now don't include the age field from a PDB70 when the age is zero. Prior to this they would incorrectly contain the zero age which stopped us from being able to match up the UUID with real files.
UUIDs for Apple targets get the first 32 bit value and next two 16 bit values swapped. Breakpad incorrectly swaps these values when it creates darwin minidump files, so this must be undone so we can match up symbol files with the minidump modules.
UUIDs that are all zeroes are treated as invalid UUIDs. Breakpad will always save out a UUID, even if one wasn't available. This caused all files that have UUID values of zero to be uniqued to the first module that had a zero UUID. We now don't fill in the UUID if it is all zeroes.
Added tests for PDB70 and ELF build ID based CvRecords.

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

llvm-svn: 356573
2019-03-20 16:50:17 +00:00
Adrian Prantl da8c0e4a3c Improve error handling for Clang module imports.
rdar://problem/48883558

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

llvm-svn: 356462
2019-03-19 15:38:26 +00:00
Pavel Labath 0e5012eac3 Skip TestVSCode_setFunctionBreakpoints on linux
Test hangs under heavy load.

llvm-svn: 356379
2019-03-18 16:04:53 +00:00
Pavel Labath 58e9ef139d Fix TestCommandScriptImmediateOutput for python3
s/iteritems/items

llvm-svn: 356370
2019-03-18 14:13:12 +00:00
Adrian Prantl 2ebbb88960 Implement a better way of not passing the sanitizer environment on to tests.
rdar://problem/48889580

llvm-svn: 356275
2019-03-15 17:22:00 +00:00
Adrian Prantl ac093d61c4 Fix a double-overrelease in the TestDataFormatterObjC test program.
llvm-svn: 356160
2019-03-14 15:58:21 +00:00
Adrian Prantl 23b37bf362 Make sure that a sanitizer LLDB's environment doesn't get passed on
to test binaries.

llvm-svn: 356113
2019-03-14 00:46:15 +00:00
Davide Italiano 9e75a08409 [Python] Fix TestDataFormatterSmartArray to work across python versions.
Python 3 default encoding is utf-8, so taking random bytes and
interpreting them as a string might result in invalid unicode sequences.
As the only thing we care about here is that the formatter shows the
elements of the underyling array, relax the string matching (this is
good enough as all the elements are distinct so they resolve to different
strings).

llvm-svn: 356096
2019-03-13 20:04:34 +00:00
Stella Stamenova 823d9f3cdf [lldbsuite] Un-xfail TestPyObjSynthProvider on Windows
One of Davide's changes yesterday fixed the behavior on Windows, so the test is now passing.

llvm-svn: 356065
2019-03-13 16:53:53 +00:00
Davide Italiano 0b29af0f7c [TestBatchMode] We already log this output to a file.
llvm-svn: 356003
2019-03-13 02:47:51 +00:00
Davide Italiano cd49351212 [testsuite] Remove other traces broken in python 3.
They can be reinstated in case somebody needs to debug
this test in the future.

llvm-svn: 356002
2019-03-13 02:44:32 +00:00
Davide Italiano 796aa0e49a [testsuite] Remove dead code in TestFormats.
llvm-svn: 356000
2019-03-13 01:26:01 +00:00
Davide Italiano a85f662ada [test] Some unicode sequences can't be printed, and Py 3 is more picky.
Given this was under trace, it can just be removed. If somebody
ever needs to debug this testcase again and print the data, they
can add a new statement.

llvm-svn: 355999
2019-03-13 00:48:32 +00:00
Davide Italiano ca715b6ea0 [Python] Fix another batch of python 2/python 3 portability issues.
llvm-svn: 355998
2019-03-13 00:48:29 +00:00
Adrian Prantl 97f51c95db Fix the broken Batch test by passing a custom module cache to the inferior lldb.
llvm-svn: 355991
2019-03-12 22:20:29 +00:00
Adrian Prantl df85147707 Revert "Temporarily add more logging to TestBatchMode"
llvm-svn: 355990
2019-03-12 22:20:26 +00:00
Adrian Prantl 8ef3da494c Temporarily add more logging to TestBatchMode
llvm-svn: 355986
2019-03-12 21:30:50 +00:00
Davide Italiano 2bd995b7e8 [lldb-mi] Make this test more reliable. NFC.
Except that it will probably stop failing on and off on my machine.

llvm-svn: 355968
2019-03-12 20:41:29 +00:00
Jim Ingham 2ca0ebf6b4 Re-enable this test, the underlying bug was fixed and the test now passes.
llvm-svn: 355956
2019-03-12 19:25:29 +00:00
Raphael Isemann 6c0bbfc0c9 Add ability to import std module into expression parser to improve C++ debugging
Summary:
This patch is the MVP version of importing the std module into the expression parser to improve C++ debugging.

What happens in this patch is that we inject a `@import std` into our expression source code. We also
modify our internal Clang instance for parsing this expression to work with modules and debug info
at the same time (which is the main change in terms of LOC). We implicitly build the `std` module on the first use. The
C++ include paths for building are extracted from the debug info, which means that this currently only
works if the program is compiled with `-glldb -fmodules` and uses the std module. The C include paths
are currently specified by LLDB.

I enabled the tests currently only for libc++ and Linux because I could test this locally. I'll enable the tests
for other platforms once this has landed and doesn't break any bots (and I implemented the platform-specific
C include paths for them).

With this patch we can now:
* Build a libc++ as a module and import it into the expression parser.
* Read from the module while also referencing declarations from the debug info. E.g. `std::abs(local_variable)`.

What doesn't work (yet):
* Merging debug info and C++ module declarations. E.g. `std::vector<CustomClass>` doesn't work.
* Pretty much anything that involves the ASTImporter and templated code. As the ASTImporter is used for saving the result declaration, this means that we can't
call yet any function that returns a non-trivial type.
* Use libstdc++ for this, as it requires multiple include paths and Clang only emits one include path per module. Also libstdc++ doesn't support Clang modules without patches.

Reviewers: aprantl, jingham, shafik, friss, davide, serge-sans-paille

Reviewed By: aprantl

Subscribers: labath, mgorny, abidh, jdoerfert, lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

llvm-svn: 355939
2019-03-12 17:09:33 +00:00
Raphael Isemann a946997c24 Correctly look up declarations in inline namespaces
Summary:
This patch marks the inline namespaces from DWARF as inline and also ensures that looking
up declarations now follows the lookup rules for inline namespaces.

Reviewers: aprantl, shafik, serge-sans-paille

Reviewed By: aprantl

Subscribers: eraman, jdoerfert, lldb-commits

Tags: #c_modules_in_lldb, #lldb

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

llvm-svn: 355897
2019-03-12 07:45:04 +00:00
Greg Clayton 0d6f681292 Fix a crasher in StackFrame::GetValueForVariableExpressionPath()
There was a crash that would happen if an IDE would ask for a child of a shared pointer via any SB API call that ends up calling StackFrame::GetValueForVariableExpressionPath(). The previous code expects an error to be set describing why the synthetic child of a type was not able to be found, but we have some synthetic child providers that weren't setting the error and returning an empty value object shared pointer. This fixes that to ensure we don't lose our debug session by crashing, fully tests GetValueForVariableExpressionPath functionality, and ensures we don't crash on GetValueForVariableExpressionPath() in the future.

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

llvm-svn: 355850
2019-03-11 18:16:20 +00:00
Adrian Prantl 5cc2790410 Makefile.rules: Upstream SDKROOT handling code for Darwin.
llvm-svn: 355843
2019-03-11 17:24:10 +00:00
Adrian Prantl f05b42e960 Bring Doxygen comment syntax in sync with LLVM coding style.
This changes '@' prefix to '\'.

llvm-svn: 355841
2019-03-11 17:09:29 +00:00
Michal Gorny b94c24e2ac [lldb] [test] Mark more tests flakey on NetBSD
llvm-svn: 355838
2019-03-11 17:01:31 +00:00
Michal Gorny 3aa36c9a47 [lldb] [test] Mark a few tests flakey on NetBSD
llvm-svn: 355830
2019-03-11 15:46:07 +00:00
Michal Gorny 369a011cee [lldb] [test] Make 2lwp_process_SIGSEGV test more portable
Fix 2lwp_process_SIGSEGV NetBSD core test to terminate inside regular
function rather than libc call, in order to get reproducible backtrace
on different platforms.

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

llvm-svn: 355786
2019-03-10 09:50:36 +00:00
Michal Gorny 377d9dc872 [lldb] [test] Adjust XFAIL list to match buildbot results
Adjust the XFAIL-ing tests to match consistent results from buildbot.
I'm going to work on differences between them and my local results
following this.

llvm-svn: 355774
2019-03-09 12:47:38 +00:00
Frederic Riss 08ae3e0f0b Actually implement the TestQueues.py workaround
The code commited in r355764 didn't do what I want as I typed GetThreadID
instead of GetQueueID. This commit contains a (hopefully) better version
of the workaround.

llvm-svn: 355766
2019-03-09 01:34:44 +00:00
Frederic Riss 65e062655e Try to workaround the TestQueues.py flakyness
This is not a fix, but if I understand enough of the issue, it should
bail out early of the test when in a situation that would result in
a failure down the road.

llvm-svn: 355764
2019-03-09 01:23:47 +00:00
Michal Gorny 942e6c7c9e [lldb] [test] Skip broken NetBSD core test
Apparently the problem is harder than anticipated.  Skip the test for
now to fix buildbots.

llvm-svn: 355750
2019-03-08 22:41:14 +00:00
Michal Gorny 7b374be946 [lldb] [test] Do not check libc function names in NetBSD core test
Fix the NetBSD core test not to verify libc function names in backtrace.
This obviously requires the same libc.so as originally used to produce
the core file, and so it is going to fail everywhere except on my
system.

llvm-svn: 355747
2019-03-08 22:32:35 +00:00
Michal Gorny c12f159788 [lldb] [Process] Add proper support for NetBSD core files with threads
Improve the support for processing NetBSD cores.  Fix reading process
identifier, thread information and associating the terminating signal
with the correct thread.

Includes test cases for single-threaded program receiving SIGSEGV,
and two dual-threaded programs: one where thread receives the signal,
and the other one when the whole process is signalled.

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

llvm-svn: 355736
2019-03-08 21:10:43 +00:00
Frederic Riss 7f3c16c0f3 Add more logging to TestQueues.py
The last round of logging taught us that when the test fails, lldb
is indeed aware of the thread it's failing to associate to a given
queue. Add more logging to try to figure out why the thread and the
queue do not appear related to the Queue APIs.

llvm-svn: 355706
2019-03-08 17:09:13 +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
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
Davide Italiano 2f94dcec5a [testsuite] Spring cleaning: this tests `stty`, not `lldb`.
llvm-svn: 355615
2019-03-07 18:05:18 +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
Raphael Isemann a4a167fb75 Remove redundant second os.path.join call [NFC]
llvm-svn: 355548
2019-03-06 20:51:28 +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
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
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
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
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
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