Commit Graph

16626 Commits

Author SHA1 Message Date
Pavel Labath fd2c8d6572 Implement core dump debugging for PPC64le
Summary: Implement core dump debugging for PPC64le.

Reviewers: labath

Reviewed By: labath

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

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

llvm-svn: 318399
2017-11-16 13:38:57 +00:00
Jason Molenda 4f34614beb Fix alignment of arm64 fpu register context structure
so it has the same padding as the kernel's definition
which is written in terms of uint128_t.  Original patch
by Ryan Mansfield.

<rdar://problem/35468499> 

llvm-svn: 318357
2017-11-16 00:50:29 +00:00
Davide Italiano c12c0c5467 [POSIX] Replace assert with llvm_unreachable(). NFCI.
llvm-svn: 318348
2017-11-15 23:39:41 +00:00
Jason Molenda fd6647ecb6 Roll back r318260 because it is causing the windows bot to
break.  The alignas(__uint128_t) is not recognized with MSVC
it looks like.  Zachary, is there a similar type on windows?
I suppose I can go with alignas(16) here but I'd prefer to
specify the type alignment that I want & let the ABI dictate
how much padding is required.

llvm-svn: 318262
2017-11-15 03:41:47 +00:00
Jason Molenda 1f88f4c3bc Two small fixes to handle arm64 fpu register contexts in
a Mach-O file load command correctly, patch by Ryan
Mansfield.

<rdar://problem/35468499> 

llvm-svn: 318260
2017-11-15 03:18:24 +00:00
Jason Molenda 5882359128 Update xcode project file to track ArchSpec.cpp
move and LibCxxBitset.cpp addition.

llvm-svn: 318218
2017-11-14 23:15:35 +00:00
Don Hinton f031e48f45 Add check for self-assignment. NFC
Differential Revision: https://reviews.llvm.org/D39578

llvm-svn: 318164
2017-11-14 18:19:41 +00:00
Pavel Labath 5269875ef9 Add a data formatter for libc++ std::bitset
Reviewers: jingham, EricWF

Subscribers: mgorny, lldb-commits

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

llvm-svn: 318145
2017-11-14 11:15:03 +00:00
Stephane Sezer aaa41ae08e Reformat a comment. NFC.
llvm-svn: 318079
2017-11-13 20:13:25 +00:00
Pavel Labath 2da1b5970c Fix netbsd, freebsd and osx builds for ArchSpec move
llvm-svn: 318052
2017-11-13 16:47:37 +00:00
Pavel Labath 5f19b90783 Move ArchSpec to the Utility module
The rationale here is that ArchSpec is used throughout the codebase,
including in places which should not depend on the rest of the code in
the Core module.

This commit touches many files, but most of it is just renaming of
 #include lines. In a couple of cases, I removed the #include ArchSpec
line altogether, as the file was not using it. In one or two places,
this necessitated adding other #includes like lldb-private-defines.h.

llvm-svn: 318048
2017-11-13 16:16:33 +00:00
Pavel Labath 4ebb64b95f Remove last Host usage from ArchSpec
Summary:
In D39387, I was quick to jump to conclusion that ArchSpec has no
external dependencies. It turns there still was one call to
HostInfo::GetArchitecture left -- for implementing the "systemArch32"
architecture and friends.

Since GetAugmentedArchSpec is the place we handle these "incomplete"
triples that don't specify os or vendor and "systemArch" looks very much
like an incomplete triple, I move its handling there.

After this ArchSpec *really* does not have external dependencies, and
I'll move it to the Utility module as a follow-up.

Reviewers: zturner, clayborg, jingham

Subscribers: lldb-commits

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

llvm-svn: 318046
2017-11-13 15:57:20 +00:00
Pavel Labath 769b21eaf2 CompilerType: Add ability to retrieve an integral template argument
Summary:
Despite it's name, GetTemplateArgument was only really working for Type
template arguments. This adds the ability to retrieve integral arguments
as well (which I've needed for the std::bitset data formatter).

I've done this by splitting the function into three pieces. The idea is
that one first calls GetTemplateArgumentKind (first function) to
determine the what kind of a parameter this is. Based on that, one can
then use specialized functions to retrieve the correct value. Currently,
I only implement two of these: GetTypeTemplateArgument and
GetIntegralTemplateArgument.

Reviewers: jingham, clayborg

Subscribers: lldb-commits

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

llvm-svn: 318040
2017-11-13 14:26:21 +00:00
Pavel Labath d739636ccf Revert "[lldb] Use OrcMCJITReplacement rather than MCJIT as the underlying JIT for LLDB"
This commit really did not introduce any functional changes (for most
people) but it turns out it's not for the reason we thought it was.

The reason wasn't that Orc is a perfect drop-in replacement for MCJIT,
but it was because we were never using Orc in the first place, as it was
not initialized.

Orc's initialization relies on a global constructor in the LLVMOrcJIT.a.
Since this archive does not expose any symbols referenced from other
object files, it does not get linked into liblldb when linking against
llvm components statically. However, in an LLVM_LINK_LLVM_DYLIB=On
build, LLVMOrcJit.a is linked into libLLVM.so using --whole-archive, so
the global constructor does end up firing.

The result of using Orc jit is pr34194, where lldb fails to evaluate
even very simple expressions. This bug can be reproduced in
non-LLVM_LINK_LLVM_DYLIB builds by making sure Orc jit is linked into
liblldb, for example by #including
llvm/ExecutionEngine/OrcMCJITReplacement.h in IRExecutionUnit.cpp (and
adding OrcJIT as a dependency to the relevant CMakeLists.txt file). The
bug reproduces (at least) on linux and osx.

The root cause of the bug seems to be related to relocation processing.
It seems Orc processes relocations earlier than the system it is
replacing. This means the relocation processing happens before we have
had a chance to remap section load addresses to reflect their address in
the target process memory, so they end up pointing to locations in the
lldb's address space instead.

I am not sure whether this is a bug in Orc jit, or in how we are using
it from lldb, but in any case it is preventing us from using Orc right
now. Reverting this fixes LLVM_LINK_LLVM_DYLIB build, and makes it clear
that we are in fact *not* using Orc, and we never really were.

This reverts commit r279327.

llvm-svn: 318039
2017-11-13 14:03:17 +00:00
Greg Clayton 61eaf8f163 Added a way to dump the full paths to all source files in a module that has debug info.
llvm-svn: 317945
2017-11-10 22:39:07 +00:00
Alexander Shaposhnikov 7fd4a2c477 [lldb] Remove unused method declaration
FindCompleteObjCDefinitionType is not used anywhere and there is no implementation of it, only a declaration.

Test plan: make check-lldb

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

llvm-svn: 317919
2017-11-10 19:40:53 +00:00
Pavel Labath d37349f380 Clean up NativeRegisterContext
Summary:
This commit removes the concrete_frame_idx member from
NativeRegisterContext and related functions, which was always set to
zero and never used.

I also change the native thread class to store a NativeRegisterContext
as a unique_ptr (documenting the ownership) and make sure it is always
initialized (most of the code was already blindly dereferencing the
register context pointer, assuming it would always be present -- this
makes its treatment consistent).

Reviewers: eugene, clayborg, krytarowski

Subscribers: aemerson, sdardis, nemanjai, javed.absar, arichardson, kristof.beyls, kbarton, uweigand, alexandreyy, lldb-commits

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

llvm-svn: 317881
2017-11-10 11:05:49 +00:00
Pavel Labath 1ebc85f86f llgs-tests: Replace the "log+return false" pattern with llvm::Error
Summary:
These tests used to log the error message and return plain bool mainly
because at the time they we written, we did not have a nice way to
assert on llvm::Error values. That is no longer true, so replace this
pattern with a more idiomatic approach.

As a part of this patch, I also move the formatting of
GDBRemoteCommunication::PacketResult values out of the test code, as
that can be useful elsewhere.

Reviewers: zturner, eugene

Subscribers: mgorny, lldb-commits

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

llvm-svn: 317795
2017-11-09 15:45:09 +00:00
Pavel Labath 0ccb256dae Add a unit test for ClangASTContext template arguments handling
I am planning to make changes to this piece of code, so I wrote this
test to add more coverage to it first.

llvm-svn: 317792
2017-11-09 15:06:31 +00:00
Pavel Labath 578a425890 Simplify NativeProcessProtocol::GetArchitecture/GetByteOrder
Summary:
These functions used to return bool to signify whether they were able to
retrieve the data. This is redundant because the ArchSpec and ByteOrder
already have their own "invalid" states, *and* because both of the
current implementations (linux, netbsd) can always provide a valid
result.

This allows us to simplify bits of the code handling these values.

Reviewers: eugene, krytarowski

Subscribers: javed.absar, lldb-commits

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

llvm-svn: 317779
2017-11-09 10:43:16 +00:00
Pavel Labath d9f6f5f44d Xfail TestConcurrentTwoWatchpointsOneSignal on arm
r317561 exposed an interesting bug (pr35228) in handling of simultaneous
watchpoint hits. Disabling the test until we can get that fixed.

llvm-svn: 317683
2017-11-08 11:51:49 +00:00
Pavel Labath d2aab749d1 Log: delimit thread name in log message
The thread name was not followed by a space, which meant it was glued to
the log message. I also align the name as we do that with other log
fields. I align it to 16 chars instead of llvm::max_thread_name(), as
that can be 64 on darwin, which is rather long. If anybody feels
differently about that, we can change it.

llvm-svn: 317679
2017-11-08 10:48:54 +00:00
Pavel Labath 042c752691 Make TestTopLevelExprs more robust in face of linker GC
Summary:
This test was failing in various configurations on linux in a fairly
unpredictible way. The success depended on whether the c++ abi library
was linked in statically or not and how well was the linker able to
strip parts of it. This introduces additional code to the "dummmy" test
executable, which ensures that all parts of the library needed to
evaluate the expressions are always present.

Reviewers: clayborg

Subscribers: srhines, tatyana-krasnukha, davide, lldb-commits

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

llvm-svn: 317678
2017-11-08 10:48:50 +00:00
Pavel Labath 4c0461f8ce Update tuple/list/deque data formatters to work with newest libc++
Summary:
A couple of members of these data structures have been renamed in recent
months. This makes sure they still work with the latest libc++ version.

Reviewers: jingham, EricWF

Subscribers: lldb-commits

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

llvm-svn: 317624
2017-11-07 22:17:29 +00:00
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