Commit Graph

16602 Commits

Author SHA1 Message Date
Tamas Berghammer cf6bf4c4ba Fix an issue in r317563 causing a clang assert
llvm-svn: 317574
2017-11-07 13:43:55 +00:00
Tamas Berghammer 5976583a30 Support scoped enums in the DWARF AST parser
Subscribers: JDevlieghere

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

llvm-svn: 317563
2017-11-07 10:39:22 +00:00
Pavel Labath 888cc5d50b test: Clean up finalize_build_dictionary
We only support API>=16 now, so we don't need to check the API level of
the android device.

llvm-svn: 317562
2017-11-07 10:36:42 +00:00
Pavel Labath 881fe8ecb2 "Fix" concurrent events test for arm
Summary:
The test incremented an atomic varible to trigger the watchpoint event.
On arm64 this compiled to a ldaxr/stlxr loop, with the watchpoint being
triggered in the middle of the loop. Hitting the watchpoint resets the
exclusive monitor, and forces the process to loop one more time, hitting
the watchpoint again, etc.

While it would be nice if the debugger was able to resume from this
situation, this is not trivial, and is not what this test is about.
Therefore, I propose to change this to a simple store to a normal
variable (which should still trip the watchpoint everywhere, but without
atomic loops) and file a bug to investigate the possibilities of
handling the watchpoints in atomic loops in a more reasonable way.

Reviewers: clayborg

Subscribers: aemerson, kristof.beyls, lldb-commits

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

llvm-svn: 317561
2017-11-07 10:36:36 +00:00
Stephane Sezer d20106b5ec Disable tests in lang/c/shared_lib on Windows
Summary: These fail because `-fPIC` is not supported on Windows.

Reviewers: zturner, jingham, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 317529
2017-11-07 00:14:40 +00:00
Stephane Sezer 972d513a5c Add a dependency from check-lldb on lld
Summary:
This is required when using the in-tree clang for building tests,
because -fuse-ld=lld is used by default.

Subscribers: mgorny

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

llvm-svn: 317501
2017-11-06 19:25:33 +00:00
Pavel Labath a68e048233 Extend android xfail in TestTopLevelExprs
The test fails on API level 19 as well. I'm going to assume that it
fails on every API level below 23.

llvm-svn: 317474
2017-11-06 12:34:27 +00:00
Tamas Berghammer 7cb7df2bbf Improve the posix core file triple detection
Summary:
Posix core files sometime don't contain enough information to correctly
detect the OS. If that is the case we should use the OS from the target
instead as it will contain usable information in more cases and if the
target and the core contain different OS-es then we are already in a
pretty bad state so moving from an unknown OS to a known (but possibly
incorrect) OS will do no harm.

We already had similar code in place for MIPS. This change tries to make
it more generic by using ArchSpec::MergeFrom and extends it to all
architectures but some MIPS specific issue prevent us from getting rid
of special casing MIPS.

Reviewers: clayborg, nitesh.jain

Subscribers: aemerson, sdardis, arichardson, kristof.beyls, lldb-commits

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

llvm-svn: 317411
2017-11-04 18:25:51 +00:00
Pavel Labath a964012cd2 Remove ProcessGdbRemote::m_flags
The member is completely unused. Discussed on lldb-dev.

llvm-svn: 317377
2017-11-03 22:12:50 +00:00
Pavel Labath e6a661053d Add float/vector registers for ppc64le
Summary: Add read and write functions for VSX, VMX and float registers and fix watchpoint size

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: eugene, labath, clayborg, nemanjai, kbarton, JDevlieghere, anajuliapc, gut, lbianc, lldb-commits

Differential Revision: https://reviews.llvm.org/D39487
Patch by: Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br>

llvm-svn: 317329
2017-11-03 15:22:36 +00:00
Don Hinton a6a2910e3d Add type to FileSpec::PathSyntax enum.
Summary:
Add type to FileSpec::PathSyntax enum to decrease size for
FileSpec on systems with 32 bit pointers.

Thanks to @zturner for pointing this out.

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

llvm-svn: 317327
2017-11-03 14:59:36 +00:00
Pavel Labath 6cf1aa5f5f Xfail test_stack_info_in_minidump test
The test has been failing since we enabled the i386 ABI plugin on
windows. See pr35193 for details.

llvm-svn: 317326
2017-11-03 14:42:37 +00:00
Pavel Labath 09bdfb32ef Fix classifications on two concurrent event tests
I have classified one as a watchpoint test even though it wasn't and
vice versa. Fix that.

llvm-svn: 317319
2017-11-03 12:13:22 +00:00
Pavel Labath 64b6e5af13 Remove getCategories mechanism of specifying test categories
Summary:
This mechanism was mostly redundant with the file-based .categories
mechanism, and it was interfering with it, as any test which implemented
a getCategories method would not inherit the filesystem categories.

This patch removes it. The existing categories are preserved either by
adding a .categories file, or using the @add_test_categories decorator.

Reviewers: jingham, clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 317277
2017-11-02 22:13:09 +00:00
Pavel Labath 03304427a9 Remove android watchpoint xfails
Now that the wathpoint tests have their own category, we can easily skip
them on devices which don't have watchpoint support. Therefore, we don't
need an android xfail on each of these tests.

llvm-svn: 317276
2017-11-02 22:12:55 +00:00
Pavel Labath eac00c3be6 Fix some warnings found by ToT clang
These fall into two categories:
- unused variables
- (uint8_t *)NULL + X -- changed to reinterpret_cast(X)

llvm-svn: 317270
2017-11-02 21:35:26 +00:00
Stephane Sezer 7a0c218bae Run clang-format on lldb.cpp
llvm-svn: 317219
2017-11-02 16:56:52 +00:00
Stephane Sezer b55c8b1f16 Use LLVM version string
Summary:
macOS builds of LLDB use the bundle version from
`tools/driver/lldb-Info.plist`. That file hasn't been updated since the 4.0
release so the version we print provides no value. I also think that even if it
were up to date, that number has no meaning and displaying the version from the
LLVM tree is more valuable.

I know that Apple folks have some form of override for the clang version to
match the Xcode version, so it'd make sense for them to do the same for LLDB.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 317218
2017-11-02 16:56:19 +00:00
Jason Molenda 2350272187 Revert r317182 for https://reviews.llvm.org/D39128
we're still failing on android.  I'll ask Larry to 
ask Pavel for any tips he might be able to give.

llvm-svn: 317183
2017-11-02 03:17:07 +00:00
Jason Molenda edc2def4a6 Commit Lawrence D'Anna's patch to change
SetOututFileHandle to work with IOBase.

I did make one change after checking with Larry --
I renamed SBDebugger::Flush to FlushDebuggerOutputHandles
and added a short docstring to the .i file to make it
a little clearer under which context programs may need
to use this API.

Differential Revision: https://reviews.llvm.org/D39128
<rdar://problem/34870417> 

llvm-svn: 317182
2017-11-02 02:43:27 +00:00
Jason Molenda 9e27b70a07 Ahhhh roll back that commit, I didn't see that Lawrence had filed
a separate phabracator with the revised change.  This was his
first atttempt which broke on the bots the second time too.

llvm-svn: 317181
2017-11-02 02:33:59 +00:00
Jason Molenda c139a402b2 Commit Lawrence D'Anna's patch to change
SetOututFileHandle to work with IOBase.

I did make one change after checking with Larry --
I renamed SBDebugger::Flush to FlushDebuggerOutputHandles
and added a short docstring to the .i file to make it
a little clearer under which context programs may need
to use this API.

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

llvm-svn: 317180
2017-11-02 02:02:56 +00:00
Davide Italiano 43252d5390 [Core] Comparison for unsigned >= 0 is redundant. NFCI.
llvm-svn: 317145
2017-11-01 23:49:23 +00:00
Davide Italiano 014ef593aa [XML] Simplify lambda removing unused capture. NFCI.
llvm-svn: 317144
2017-11-01 23:48:07 +00:00
Davide Italiano 8e353b90c7 [Interpreter] Remove unused variable usage. NFCI.
llvm-svn: 317143
2017-11-01 23:46:21 +00:00
Pavel Labath cf82cc3d54 dotest: consistently call finalize_build_dictionary in debug info variants
dwarf&dwo versions were doing it, but gmodules and dsym weren't. All
this function does right now is pass OS=Android to make when targeting
android. This enables us to run dotest without manually passing --env
OS=Android.

llvm-svn: 317130
2017-11-01 22:01:03 +00:00
Jason Molenda 813c5f21dd add LibCxxTuple.cpp, LibCxxQueue.cpp to xcode project file.
llvm-svn: 317129
2017-11-01 21:55:35 +00:00
Pavel Labath e0d51846f2 Add data formatter for libc++ std::queue
Summary:
std::queue is just a fancy wrapper around another container, so all we
need to do is to delegate to the it.

Reviewers: jingham, EricWF

Subscribers: srhines, mgorny, lldb-commits, eugene

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

llvm-svn: 317099
2017-11-01 15:52:08 +00:00
Pavel Labath 333739d0e2 Add data formatter for libc++ std::tuple
Reviewers: jingham, EricWF

Subscribers: srhines, eugene, lldb-commits, mgorny

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

llvm-svn: 317095
2017-11-01 15:19:52 +00:00
Pavel Labath b38c02047a Remove uint32_t assignment operator from Status
Summary:
It is not presently used, and it's quite dangerous to use -- it assumes the
integer is an osx kern_return_t, but very few of the integers we have lying
around are mach kernel error codes. The error can still be used to a
mach error using a slightly longer (but more explicit) syntax.

Reviewers: jingham

Subscribers: lldb-commits

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

llvm-svn: 317093
2017-11-01 15:00:58 +00:00
Jason Molenda 6418bff2f3 Remove Sean Callanan from the CODE_OWNERS, he won't have time
to participate in lldb going forward.  Jim Ingham is adopting
the areas he was responsible for.

llvm-svn: 317067
2017-11-01 01:38:42 +00:00
Jim Ingham dccb1db1af Modernize the example cmdtemplate.py.
This version relies on a newer and more convenient way
to use a class to implement a command.  It has been in place
since early 2015, so it should be pretty safe to use.

llvm-svn: 317043
2017-10-31 22:38:24 +00:00
Pavel Labath 22e71a030e Add a "watchpoint" test category and annotate tests appropriately
Most of the watchpoint tests are organized into subtrees, so we can use the
file-based .categories approach to annotate them. The exception are the
concurrent_events tests, which needed to be annotated on a per-test basis.

The motivation behind this is to provide an easy way to disable watchpoint
tests on systems where the watchpoint functionality is not present/unreliable.

llvm-svn: 317004
2017-10-31 15:27:19 +00:00
Pavel Labath f753bfeeec Fix LLVM_LINK_LLVM_DYLIB build (pr35053)
Summary:
r316368 broke this build when it introduced a reference to a pthread
function to the Utility module. This caused cmake to generate an
incorrect link line (wrong order of libs) because it did not see the
dependency from Utility to the system libraries. Instead these libraries
were being manually added to each final target.

This changes moves the dependency management from the individual targets
to the lldbUtility module, which is consistent with how llvm does it.
The final targets will pick up these libraries as they will be a part of
the link interface of the module.

Technically, some of these dependencies could go into the host module,
as that's where most of the os-specific code is, but I did not try to
investigate which ones.

Reviewers: zturner, sylvestre.ledru

Subscribers: lldb-commits, mgorny

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

llvm-svn: 316997
2017-10-31 13:23:19 +00:00
Pavel Labath aee3e26c72 Increase AdbClient read timeout
The previous value was not sufficient for Pixel 2 phones. One would have
hoped that the newer phones are faster, but that does not seem to be the
case here.

llvm-svn: 316993
2017-10-31 12:27:46 +00:00
Pavel Labath 89ac0c7d32 Add data formatter for libc++'s forward_list
Summary:
This adds a data formatter for the implementation of forward_list in
libc++. I've refactored the existing std::list data formatter a bit to
enable more sharing of code (mainly the loop detection stuff).

Reviewers: jingham, EricWF

Subscribers: srhines, eugene, lldb-commits

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

llvm-svn: 316992
2017-10-31 12:27:43 +00:00
Pavel Labath e443564291 Fix mac build broken in r316987
Forgot one occurence of ArchSpec::SetTriple in mac-specific code.

llvm-svn: 316990
2017-10-31 11:48:33 +00:00
Pavel Labath 7263f1bda6 Invert ArchSpec<->Platform dependency
Summary:
ArchSpec::SetTriple was taking a Platform as an argument, and used it to
fill in missing pieces of the specified triple. I invert the dependency
by moving this code to other classes. For this purpose, I've created
three new functions.
- HostInfo::GetAugmentedArchSpec: fills in the triple using the host
  platform (this used to be implemented by passing a null platform
  pointer). By putting this code in the Host module, we can provide a
  way to anyone who does not have a platform instance (lldb-server) an
  easy way to get Host data.
- Platform::GetAugmentedArchSpec: if you have a platform instance, you
  can call this to let it fill in the triple.
- static Platform::GetAugmentedArchSpec: implements the "if platform ==
  0 then use_host() else use_platform()" part.

Reviewers: zturner, jingham, clayborg

Subscribers: mgorny, javed.absar, lldb-commits

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

llvm-svn: 316987
2017-10-31 10:56:03 +00:00
Pavel Labath 7344790005 Android.rules: build with "unified android headers"
Unified headers will be the only way to build applications in NDK r16,
and it also works with NDK r15.

This also bumps the minimum supported android version to 16.

llvm-svn: 316985
2017-10-31 10:33:03 +00:00
Pavel Labath 64325c51ad Split makefile for TestTopLevelExprs
this test was using a single makefile to build two executables. This
setup, although not supported by Makefile.rules, happened to
work in most configurations, except when building with the android ndk
r16.

Here I move the building of the second executable to a separate
makefile, which is the solution other tests use for multiple targets.

llvm-svn: 316982
2017-10-31 10:01:30 +00:00
Jim Ingham 205e5f656b Remove a stray space.
llvm-svn: 316954
2017-10-30 20:44:45 +00:00
Pavel Labath f93591b0be Fix windows build broken in r316915
I accidentally left a linux-specific include in generic code.

llvm-svn: 316919
2017-10-30 16:21:18 +00:00
Pavel Labath 3703310834 MainLoop: work around an android libc bug
Versions of android before kitkat implemented pselect non-atomically,
which caused flakyness, as we were relying on it atomically setting the
signal mask to implement waiting for signals.

This patch implements a direct call to the the pselect kernel syscall,
which does not suffer from this problem. The code itself is not very
pretty, but fortunately the uglyness is contained in the
android version of the MainLoop::RunImpl::Poll function.

llvm-svn: 316915
2017-10-30 16:00:13 +00:00
Davide Italiano 4ab13cda81 [CMake] Build clang as dependency when using in-tree clang for tests.
Discussed with Zachary Turner and Pavel Labath on lldb-dev.
Let's hope this doesn't break anything :)

llvm-svn: 316800
2017-10-27 21:22:57 +00:00
Pavel Labath c51ad4834c Add specific ppc64le hardware watchpoint handler
Summary: Add hardware watchpoint funcionality for ppc64le

Reviewers: clayborg, zturner

Reviewed By: clayborg

Subscribers: eugene, clayborg, zturner, lbianc, gut, nemanjai, alexandreyy, kbarton, lldb-commits

Differential Revision: https://reviews.llvm.org/D38897
Patch by Ana Julia Caetano <ana.caetano@eldorado.org.br>

llvm-svn: 316772
2017-10-27 17:02:32 +00:00
Pavel Labath ae7dd12a30 Fix a use-after-free in lldb-server
UriParser::Parse is returning a StringRef pointing the the parsed
string, but we were calling it with a temporary string. Change this to a
local variable to make sure the string persists as long as we need it.

llvm-svn: 316740
2017-10-27 04:53:24 +00:00
Pavel Labath 7e17fc5e09 Default to using in-tree clang for building test executables
Summary:
Using the in-tree clang should be the default test configuration as that
is the one compiler that we can be sure everyone has (better
reproducibility of test results). Also, it should hopefully reduce the
impact of pr35040.

This also reduces the number of settings which control the compiler
used. LLDB_TEST_C_COMPILER is used for C files and
LLDB_TEST_CXX_COMPILER for C++ files. Both of the settings default to
the in-tree clang.

Reviewers: zturner

Subscribers: mgorny, davide, lldb-commits

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

llvm-svn: 316728
2017-10-27 02:24:04 +00:00
Jason Molenda 6908fdb0eb Add Arm Architecture plugin to the xcode project file.
llvm-svn: 316727
2017-10-27 02:21:55 +00:00
Pavel Labath 86cf0856ae Fix TestMinidump for r316673
The test was asserting that we can only find one frame in the minidump.
Now that we have the default unwind plan from the ABI plugin, we are
able to find 5 more frames using the frame pointer chaining. Correct the
expectation in the test.

llvm-svn: 316688
2017-10-26 19:08:34 +00:00
Stephane Sezer 4ffbeeba92 Allow SysV-i386 ABI on everything other than Apple targets
Summary:
This matches other SysV ABIs that are different on Apple and non-Apple targets,
like `ABISysV_arm.cpp` for instance.

Reviewers: clayborg, emaste

Subscribers: aemerson, kristof.beyls, lldb-commits

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

llvm-svn: 316673
2017-10-26 17:04:20 +00:00