Commit Graph

19190 Commits

Author SHA1 Message Date
Pavel Labath 821263faa5 Fix llvm_unreachable in TestWriteMemory
The test was hitting llvm_unreachable in
Platform::GetSoftwareBreakpointTrapOpcode because it could not figure
out the architecture of the process. Since that is not the purpose of
the test, I change the test to use an explicit
CreateTargetWithFileAndTargetTriple command to specify it.

llvm-svn: 357456
2019-04-02 08:56:22 +00:00
Pavel Labath 1c4ee16012 PDBFPO: Refactor register reference resolution
Summary:
This refactors moves the register name->number resolution out of the
FPOProgramNodeRegisterRef class. Instead I create a special
FPOProgramNodeSymbol class, which holds unresolved symbols, and move the
resolution into the ResolveRegisterRefs visitor.

The background here is that I'd like to use this code for Breakpad
unwind info, which uses similar syntax to describe unwind info. For
example, a simple breakpad unwind program might look like:
    .cfa: $esp 8 + $ebp: .cfa 8 - ^

To be able to do this, I need to be able to customize register
resolving, as that is presently hardcoded to use codeview register
names, but breakpad supports a lot more architectures with different
register names. Moving the resolution into a separate class will allow
each user to use a different resolution logic.

Reviewers: aleksandr.urakov, zturner, amccarth

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 357455
2019-04-02 08:44:24 +00:00
Pavel Labath 155bc16e7f Simplify TestGdbRemoteRegisterState
While reviewing D56233 it became clear to me that this test can be
simplified. There's no need for a start-stop cycle in the inferior -- we
can start fiddling with its registers as soon as it is launched.

llvm-svn: 357451
2019-04-02 07:47:38 +00:00
Jonas Devlieghere dd245c4f8f [CMake] Only the Python scirpt interpreter should link against Python.
This patch removes spurious links against Python.

llvm-svn: 357431
2019-04-01 22:03:04 +00:00
Jonas Devlieghere 533fe617ac [Process] Use early returns in Process::WriteMemory (NFC)
I found the code of Process::WriteMemory particularly hard to follow
when reviewing Ismail's change in D60022. This simplifies the code and
hopefully prevents similar oversights in the future.

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

llvm-svn: 357428
2019-04-01 20:39:03 +00:00
Jorge Gorbe Moya 4665aca8ca [lldb-vscode] Add logic to handle EOF when reading from lldb-vscode stdout.
Summary:
This change prevents the lldb-vscode test harness from hanging up waiting for
new messages when the lldb-vscode subprocess crashes.

Now, when an EOF from the subprocess pipe is detected we enqueue a `None` packet
in the received packets list. Then, during the message processing loop, we can
use this `None` packet to tell apart the case where lldb-vscode has terminated
unexpectedly from the normal situation where no pending messages means blocking
and waiting for more data.

I believe this should be enough to fix the issues with these tests hanging on
multiple platforms. Once this lands, I'll prepare and test a separate change
removing the @skipIfLinux annotations.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 357426
2019-04-01 20:37:22 +00:00
Jonas Devlieghere c791a20b42 [API] Add SBReproducer to LLDB.h
llvm-svn: 357424
2019-04-01 19:56:15 +00:00
Med Ismail Bennani 62bcf73683 [Process] Fix WriteMemory return value
Summary:
In case of a breakpoint site overlapping with the destination address,
the WriteMemory method reported an incorrect memory size.

Instead of returning the right amount of bytes written, it falls through
the scope and returned 0.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Reviewers: jasonmolenda, friss, jingham

Subscribers: JDevlieghere, davide, lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 357420
2019-04-01 19:08:47 +00:00
Michal Gorny d8519f4a7d [lldb] [Process/elf-core] Support aarch64 NetBSD core dumps
Include support for NetBSD core dumps from evbarm/aarch64 system,
and matching test cases for them.

Based on earlier work by Kamil Rytarowski.

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

llvm-svn: 357399
2019-04-01 15:08:24 +00:00
Pavel Labath 38a8241321 [Linux/x86] Fix writing of non-gpr registers on newer processors
Summary:
We're using ptrace(PTRACE_SETREGSET, NT_X86_XSTATE) to write all non-gpt
registers on x86 linux. Unfortunately, this method has a quirk, where
the kernel rejects all attempts to write to this area if one supplies a
buffer which is smaller than the area size (even though the kernel will
happily accept partial reads from it).

This means that if the CPU supports some new registers/extensions that
we don't know about (in my case it was the PKRU extension), we will fail
to write *any* non-gpr registers, even those that we know about.

Since this is a situation that's likely to appear again and again, I add
code to NativeRegisterContextLinux_x86_64 to detect the runtime size of
the area, and allocate an appropriate buffer. This does not mean that we
will start automatically supporting all new extensions, but it does mean
that the new extensions will not prevent the old ones from working.

This fixes tests attempting to write to non-gpr registers on new intel
processors (cca Kaby Lake Refresh).

Reviewers: jankratochvil, davezarzycki

Subscribers: lldb-commits

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

llvm-svn: 357376
2019-04-01 08:11:46 +00:00
David Zarzycki 916709e0be [CMake] Add missing test dep
lit/SymbolFile/NativePDB/globals-bss.cpp needs llvm-readobj

llvm-svn: 357336
2019-03-30 00:00:19 +00:00
Jonas Devlieghere 6f8251fb38 [ScriptInterpreterPython] Fix the unit test after refactor
llvm-svn: 357313
2019-03-29 20:56:52 +00:00
Jonas Devlieghere 63dd5d2518 [Python] Remove Python include from ScriptInterpreterPython.h
This patch limits the scope of the python header to the implementation
of the python script interpreter plugin. ScriptInterpreterPython is now
an abstract interface that doesn't expose any Python specific types, and
is implemented by the ScriptInterpreterPythonImpl.

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

llvm-svn: 357307
2019-03-29 20:17:20 +00:00
Jonas Devlieghere 05f1dd9362 [ScriptInterpreterPython] Remove unused field (NFC)
The m_lldb_module was initialized but not used.

llvm-svn: 357292
2019-03-29 17:58:07 +00:00
Jonas Devlieghere 4d63d8cf75 [CMake] Move link dependencies where they are used.
The utility library shouldn't depend on curses, libedit or python. Move
curses to core, libedit to host and python to the python plugin.

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

llvm-svn: 357287
2019-03-29 17:47:26 +00:00
Jonas Devlieghere ae1cc995e3 [Cmake] Unify python variables
FindPythonInterp and FindPythonLibs do two things, they set some
variables (PYTHON_LIBRARIES, PYTHON_INCLUDE_DIRS) and update the cached
variables (PYTHON_LIBRARY, PYTHON_INCLUDE_DIR) which are also used to
specify a custom python installation.

I believe the canonical way to do this is to use the PYTHON_LIBRARIES
and PYTHON_INCLUDE_DIRS variables instead of the cached ones. However,
since the cached variables are accessible from the cache and GUI, this
is a lot less confusing when you're trying to debug why a variable did
or didn't get the value you expected. Furthermore, as far as I can tell,
the implementation uses the cached variables to set their LIBRARIES/DIRS
counterparts. This is also the reason this works today even though we
mix-and-match.

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

llvm-svn: 357282
2019-03-29 17:35:42 +00:00
Jonas Devlieghere 903a9c74f0 [Python] Remove readline module
Todd added this empty readline module to workaround an issue with an old
version of Python on Ubuntu in 2014 (18841). In the meantime, libedit
seems to have fixed the underlying issue, and indeed, I wasn't able to
reproduce this.

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

llvm-svn: 357277
2019-03-29 17:12:08 +00:00
Jim Ingham cdd4892f12 Use the multi-lockable form of std::lock for operator=
For = operators for lists that have mutexes, we were either
just taking the locks sequentially or hand-rolling a trick
to try to avoid lock inversion.  Use the std::lock mechanism
for this instead.

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

llvm-svn: 357276
2019-03-29 17:07:30 +00:00
Adrian Prantl 515d1306ff Don't abort() in lldb_assert and document why.
rdar://problem/49356014

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

llvm-svn: 357268
2019-03-29 16:12:27 +00:00
Shafik Yaghmour a1f1ff8896 Fix for regression test, since we rely on the formatter for std::vector in the test we need a libc++ category.
See differential https://reviews.llvm.org/D59847 for initial change that this fixes

llvm-svn: 357210
2019-03-28 20:25:57 +00:00
Jim Ingham 43aaafc0e1 Fix the swig typemap for "uint32_t *versions, uint32_t num_versions".
It was making a list of a certain size but not always filling in that
many elements, which would lead to a crash iterating over the list.

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

llvm-svn: 357207
2019-03-28 19:25:54 +00:00
Jonas Devlieghere c712bac78b [NFC] find_first_of/find_last_of -> find/rfind for single char.
For a single char argument, find_first_of is equal to find and
find_last_of is equal to rfind. While playing around with the plugin
stuff this caused an export failure because it always got inlined except
once, which resulted in an undefined symbol.

llvm-svn: 357198
2019-03-28 18:10:14 +00:00
Shafik Yaghmour 0f71a25e98 Regression test to ensure that we handling importing of std::vector of enums correctly
Summary:
https://reviews.llvm.org/D59845 added a fix for the IsStructuralMatch(...) specialization for EnumDecl this test should pass once this fix is committed.

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

llvm-svn: 357188
2019-03-28 17:22:13 +00:00
Jim Ingham 1432b9780b Copy the breakpoint site owner's collection so we can drop
the collection lock before we iterate over the owners calling ShouldStop.

BreakpointSite::ShouldStop can do a lot of work, and might by chance hit the same breakpoint
site again on another thread.  So instead of holding the site's owners lock
while iterating over them calling ShouldStop, I make a local copy of the list, drop the lock 
and then iterate over the copy calling BreakpointLocation::ShouldStop.

It's actually quite difficult to make this cause problems because usually all the
action happens on the private state thread, and the lock is recursive.

I have a report where some code hit the ASAN error breakpoint, went to 
compile the ASAN error gathering expression, in the course of compiling
that we went to fetch the ObjC runtime data, but the state of the program
was such that the ObjC runtime grubbing function triggered an ASAN error and 
we were executing that function on another thread.  

I couldn't figure out a way to reproduce that situation in a test.  But this is an 
NFC change anyway, it just makes the locking strategy more narrowly focused.

<rdar://problem/49074093>

llvm-svn: 357141
2019-03-28 01:51:33 +00:00
Davide Italiano 8ff45859c2 [Process] Reorder declarations and document ReadMemoryFromInferior.
llvm-svn: 357136
2019-03-28 00:07:33 +00:00
Davide Italiano 454e9428db [ObjectFileMachO] Remove another debugging aid.
Pointed out by Jason.

llvm-svn: 357135
2019-03-28 00:07:20 +00:00
Davide Italiano dfbcadf562 [ObjectFileMachO] Disable memory caching for savecore.
Summary:
It's not really useful, and largely increases the footprint.

<rdar://problem/49293525>

Reviewers: jasonmolenda

Subscribers: llvm-commits, lldb-commits

Tags: #llvm

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

llvm-svn: 357134
2019-03-28 00:07:07 +00:00
Nathan Lanza 50a1186381 Teach TypeSystem about PDBASTParser
Currently, only ClangASTContext knows about PDBASTParser. Eventually
we want the TypeSystem to have getters/setters for the base parser
and then have the TypeSystem subclasses know about the proper
PDBASTParser subclasses. This is similar to how DWARFASTParsers work.

llvm-svn: 357131
2019-03-27 23:00:47 +00:00
Jonas Devlieghere 9a6c757252 [Python] Remove unused includes
llvm-svn: 357126
2019-03-27 21:45:11 +00:00
Adrian Prantl 07b74c32b2 Add LLDB_LIBDIR_SUFFIX to Config.h to unbreak the Xcode project
llvm-svn: 357115
2019-03-27 19:22:55 +00:00
Nathan Lanza 1a0a24f110 Kill unused variable m_tu_decl_up in SymbolFilePDB
Summary:
An TranslationUnitDecl was being brought in from the clang::ASTContext
which required clang specific code to exist in SymbolFilePDB.
Since it was unused we can just get rid of it along with the clang
specific code.

Reviewers: rnk, zturner, compnerd

Reviewed By: compnerd

Subscribers: jdoerfert

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

llvm-svn: 357113
2019-03-27 19:15:13 +00:00
Jonas Devlieghere f8819bd510 [Platform] Remove Kalimba Platform
This patch removes the Kalimba platform. For more information please
refer to the corresponding thread on the mailing list.

http://lists.llvm.org/pipermail/lldb-dev/2019-March/014921.html

llvm-svn: 357086
2019-03-27 16:23:50 +00:00
Pavel Labath 9f1a7e559c Rename some variables in the std-module tests
They cause failures on some systems due to an unrelated bug (pr35043).
This works around that.

llvm-svn: 357080
2019-03-27 15:52:11 +00:00
Pavel Labath ee7ceacaca minidump: Add ability to attach (breakpad) symbol files to placeholder modules
This re-commits r354263, which was because it uncovered with handling of
modules with empty (zero) UUIDs. This would cause us to treat two
modules as intentical even though they were not. This caused an assert
in PlaceholderObjectFile::SetLoadAddress to fire, because we were trying
to load the module twice even though it was designed to be only loaded
at a specific address. (The same problem also existed with the previous
implementation, but it had no asserts to warn us about this.) These
issues have now been fixed in r356896.

windows bot. The issue there was that ObjectFilePECOFF vended its base
address through the incorrect interface. SymbolFilePDB depended on that,
which lead to assertion failures when SymbolFilePDB was attempting to
use the placeholder object files as a base. This has been fixed in
r354258

The original commit message was:

The reason this wasn't working was that ProcessMinidump was creating odd
object-file-less modules, and SymbolFileBreakpad required the module to
have an associated object file because it needed to get its base
address.

This fixes that by introducing a PlaceholderObjectFile to serve as a
dummy object file. The general idea for this is taken from D55142, but
I've reworked it a bit to avoid the need for the PlaceholderModule
class. Now that we have an object file, our modules are sufficiently
similar to regular modules that we can use the regular Module class
almost out of the box -- the only thing I needed to tweak was the
Module::CreateModuleFromObjectFile functon to set the module's FileSpec
in addition to it's architecture. This wasn't needed for ObjectFileJIT
(the other user of CreateModuleFromObjectFile), but it shouldn't hurt it
either, and the change seems like a straightforward extension of this
function.

Reviewers: clayborg, lemo, amccarth

Subscribers: lldb-commits

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

llvm-svn: 357060
2019-03-27 10:54:10 +00:00
Pavel Labath ab0f18076b Fix a "memset clearing an object of non-trivial type" warning in DWARFFormValue
This is diagnosed by gcc-8. The ValueType struct already has a default
constructor which performs zero-initialization, so we can just call that
instead of using memset.

llvm-svn: 357056
2019-03-27 10:02:36 +00:00
Pavel Labath cf6c19c2d3 Fix an out-of-bounds error in RegisterContextDarwin_arm64
Summary:
gcc diagnoses this as "array subscript 63 is above array bounds of
'RegisterContextDarwin_arm64::VReg [32]'".

The correct fix seems to be subtracting the fpu register base index, but
I have no way of verifying that this actually works.

Reviewers: jasonmolenda

Subscribers: javed.absar, kristof.beyls, lldb-commits

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

llvm-svn: 357055
2019-03-27 09:39:46 +00:00
Nathan Lanza d0050d1b8b Get the lang from the CompileUnit for ParseCompileUnitFunctionForPDBFunc
Summary:
Instead of assuming that the language is C++ instead check the compunit
for the language it received from the debug info.

Subscribers: aprantl, jdoerfert

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

llvm-svn: 357044
2019-03-27 01:24:03 +00:00
Duncan P. N. Exon Smith 1da7eac87c Frontend: Remove CompilerInstance::VirtualFileSystem, NFC
Remove CompilerInstance::VirtualFileSystem and
CompilerInstance::setVirtualFileSystem, instead relying on the VFS in
the FileManager.  CompilerInstance and its clients already went to some
trouble to make these match.  Now they are guaranteed to match.

As part of this, I added a VFS parameter (defaults to nullptr) to
CompilerInstance::createFileManager, to avoid repeating construction
logic in clients that just wanted to customize the VFS.

https://reviews.llvm.org/D59377

llvm-svn: 357037
2019-03-26 22:18:52 +00:00
Jonas Devlieghere 05495c5d45 [Python] Remove dynamic indirection
Now that the Python plugin relies on the SWIG symbols, we no longer need
to dynamically resolve these functions.

llvm-svn: 357034
2019-03-26 21:57:02 +00:00
Alex Langford 982726ea01 [ExpressionParser] Add swift-lldb case for finding clang resource dir
Summary:
I'm adding this to reduce the difference between swift-lldb and
llvm.org's lldb.

Reviewers: aprantl, davide, compnerd, JDevlieghere, jingham

Subscribers: lldb-commits

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

llvm-svn: 357030
2019-03-26 21:00:42 +00:00
Jorge Gorbe Moya d7aba76783 Add lldb-vscode as a dependency of lldb tests.
Summary:
In the current state, 'ninja check-lldb' runs the lldb-vscode tests, but it
won't rebuild lldb-vscode if any of its sources has changed. This is very
confusing when you fix something and the tests keep failing, or vice versa.

Reviewers: clayborg

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 357016
2019-03-26 18:36:44 +00:00
Davide Italiano 5c4fad0c23 [ScriptInterpreterPython] Try to make the sanitizer bot green again.
Removing a use-after-free error.

llvm-svn: 357006
2019-03-26 16:43:58 +00:00
Serge Guelton 1a12dd70c0 python 2/3 compat: commands vs subprocess
Differential Revision: https://reviews.llvm.org/D59584

llvm-svn: 356995
2019-03-26 14:46:15 +00:00
Pavel Labath 9876addcf4 Remove the TypePair class
Summary:
After D59297, the TypePair class kind of lost its purpose as it was no
longer a "pair". This finishes the job started in that patch and deletes
the class altogether. All usages have been updated to use CompilerType
class directly.

Reviewers: clayborg, jingham, zturner

Subscribers: mehdi_amini, dexonsmith, jdoerfert, lldb-commits

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

llvm-svn: 356993
2019-03-26 13:35:54 +00:00
Pavel Labath f2ffb47ff2 Minidump: Use minidump types defined in llvm
This is the next step in moving the minidump parsing into llvm. I remove
the minidump structures already defined in the llvm Object library and
convert our parser to use those. NFC.

llvm-svn: 356992
2019-03-26 13:23:01 +00:00
Jonas Devlieghere 282890d711 [Python] Define empty SWIG wrapper for unit testin"
The python plugin uses wrappers generated by swig. For the symbols to be
available, we'd need to link against liblldb, which is not an option
because the symbols could conflict with the static library we are
testing. Instead we define the symbols ourselves in the unit test.

llvm-svn: 356971
2019-03-26 01:11:15 +00:00
Jonas Devlieghere 1d1f1ba3d2 [Python] Move SWIG wrapper dependency into the plugin
This should fix the Windows bot (fingers crossed).

llvm-svn: 356967
2019-03-25 23:36:12 +00:00
Michal Gorny c5d7bc86b8 [lldb] [Process/NetBSD] Use nullptr to fix template arg deduction
llvm-svn: 356960
2019-03-25 22:29:29 +00:00
Jonas Devlieghere e3959de268 [PythonTestSuite] Fix usage of InitializePrivate in PythonTestSuite
llvm-svn: 356950
2019-03-25 21:07:53 +00:00
Jonas Devlieghere b29d82ebaf [ScriptInterpreterPython] Make SWIG callback private (NFC)
With the initialization taking place inside the Python script
interpreter, these function no longer need to be public. The exception
is the g_swig_init_callback which is used from the RAII object.

llvm-svn: 356944
2019-03-25 20:39:08 +00:00
Jonas Devlieghere b01b10877d [ScriptInterpreterPython] Move SWIG initialization into the Python plugin (NFC)
Abstract initialization of the Python SWIG support in the Python plugin.

llvm-svn: 356942
2019-03-25 20:14:31 +00:00
Jonas Devlieghere 7d3225c4b4 [Args] Handle backticks to prevent crash.
Currently LLDB crashes when autocompleting a command that ends with a
backtick because the quote character wasn't handled. This fixes that and
adds a unit test for this function.

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

llvm-svn: 356927
2019-03-25 17:27:14 +00:00
Adrian Prantl 040f94cc7e Update the lldb driver to support the -O and -S options when passing --repl
At the moment when --repl is passed to lldb it silently ignores any
commands passed via the options below:

--one-line-before-file <command>
                     Tells the debugger to execute this one-line lldb command before any file provided on the command line has been loaded.
--one-line <command>
                     Tells the debugger to execute this one-line lldb command after any file provided on the command line has been loaded.
--source-before-file <file>
                     Tells the debugger to read in and execute the lldb commands in the given file, before any file has been loaded.
--source <file>
                     Tells the debugger to read in and execute the lldb commands in the given file, after any file has been loaded.
-O <value>           Alias for --one-line-before-file
-o <value>           Alias for --one-line
-S <value>           Alias for --source-before-file
-s <value>           Alias for --source

The -O and -S options are quite useful when writing tests for the REPL
though, e.g. to change settings prior to entering REPL mode. This
patch updates the driver to still respect the commands supplied via -O
and -S when passing --repl instead of silently ignoring them. As -s
and -o don't really make sense in REPL mode, commands supplied via
those options are still ignored, but the driver now emits a warning to
make that clear to the user.

Patch by Nathan Hawes!

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

llvm-svn: 356911
2019-03-25 15:38:18 +00:00
Serge Guelton 3a22c3cc2b Python 2/3 compat: StringIO
Differential Revision: https://reviews.llvm.org/D59582

llvm-svn: 356910
2019-03-25 15:23:34 +00:00
Serge Guelton 6ee3804613 Python 2/3 compat: tkinter
Differential Revision: https://reviews.llvm.org/D59586

llvm-svn: 356909
2019-03-25 15:22:41 +00:00
Serge Guelton 0bc1447845 Python 2/3 compat: str vs basestring
Differential Revision: https://reviews.llvm.org/D59589

llvm-svn: 356908
2019-03-25 15:21:29 +00:00
Serge Guelton b833c6af59 Python 2/3 compat: queue vs Queue
Differential Revision: https://reviews.llvm.org/D59590

llvm-svn: 356906
2019-03-25 15:14:56 +00:00
Serge Guelton cdfcbbd348 Python 2/3 compat: unichr vs chr
llvm-svn: 356904
2019-03-25 15:12:48 +00:00
Pavel Labath d2b4888867 Minidump: Use minidump constants defined in llvm
This patch begins the process of migrating the "minidump" plugin to the
minidump parser in llvm. The llvm parser is not fully finished yet, but
even now, a lot of things can be switched over. The gradual migration
process will allow us to easier detect if things break than doing a big
one-step migration. Doing it early will allow us to make sure that the
llvm parser fits the use case that we need in lldb.

In this patch I start with the various minidump constants, which have
their llvm equivalent. It doesn't contain any functional changes. The
diff just reflects the different naming of things in llvm.

llvm-svn: 356898
2019-03-25 14:09:27 +00:00
Pavel Labath 2ef15d82e9 Reapply minidump changes reverted in r356806
The changes were reverted due to ubsan errors (unaligned accesses). Here
I fix those errors by first copying the data into aligned storage.
Besides fixing alignment issues, this also fixes reading of minidump
strings on big-endian systems.

llvm-svn: 356896
2019-03-25 14:02:16 +00:00
Hafiz Abid Qadeer de9d736495 Fix a broken comment line. NFC.
Just checking that commit access is working after licensing changes.

llvm-svn: 356876
2019-03-25 09:41:49 +00:00
Jonas Devlieghere 528ce4dd98 [Reproducers] Fix GDB remote flakiness during replay
This fixes the flakiness of the GDB remote reproducer during replay. It
was caused by a combination sending one ACK to many from the replay
server and the code that "flushes" any queued GDB remote packets in
GDBRemoteCommunicationClient::HandshakeWithServer.

The spurious ACK was the result of combining both implicit and explicit
handling of ACKs in the replay server. The handshake consists of an ACK
followed by an QStartNoAckMode. As long as we haven't seen any
QStartNoAckMode, we were sending implicit acknowledgments. So the first
ACK got acknowledged twice, once implicitly, and once as part of the
replay.

The reason we didn't notice this was the code in HandshakeWithServer
that "waits for any responses that might have been queued up in the
remote GDB server and flush them all". A 10ms timeout is used to move on
when no packets are left. If the second ACK didn't make it within those
10ms, all packets were offset by one.

llvm-svn: 356825
2019-03-22 23:33:17 +00:00
Davide Italiano 4f9cb26063 [ScriptInterpreter] Remove a warning and reformat comments.
llvm-svn: 356819
2019-03-22 22:38:49 +00:00
Davide Italiano 386f00db75 [ScriptInterpreter] Make sure that PYTHONHOME is right.
Summary:
For the only version of Python actually supported on Darwin.

<rdar://problem/40961425>

Reviewers: jingham, friss, JDevlieghere, aprantl, jasonmolenda

Subscribers: jdoerfert, llvm-commits, lldb-commits

Tags: #llvm

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

llvm-svn: 356816
2019-03-22 22:19:57 +00:00
Jonas Devlieghere f261638c10 Revert minidump changes
This reverts the following two commits:

Revert "Extend r356573 (minidump UUID handling) to cover elf build-ids too"
Revert "Fix UUID decoding from minidump files"

Greg's original commit broke the sanitizer bot which has been red for
several days now.

http://green.lab.llvm.org/green/view/LLDB/job/lldb-sanitized/

llvm-svn: 356806
2019-03-22 20:46:46 +00:00
Pavel Labath 4c2ef9a02b Revert "Move the rest of the sections over to DWARFContext."
This reverts commit r356682 because it breaks the DWO flavours of some
tests:
    lldb-Suite :: lang/c/const_variables/TestConstVariables.py
    lldb-Suite :: lang/c/local_variables/TestLocalVariables.py
    lldb-Suite :: lang/c/vla/TestVLA.py

llvm-svn: 356773
2019-03-22 16:07:58 +00:00
Pavel Labath 3285c0f065 Extend r356573 (minidump UUID handling) to cover elf build-ids too
Breakpad (but not crashpad) will insert an empty (all-zero) build-id
record for modules which do not have a build-id. This tells lldb to
treat such records as empty/invalid uuids.

llvm-svn: 356751
2019-03-22 14:03:59 +00:00
Jonas Devlieghere 4c6615568b [Reproducers] Fix log statements
This isn't python where you can omit the index inside `{}`.

llvm-svn: 356725
2019-03-21 23:58:51 +00:00
Adrian Prantl 74f0e2cc39 Makefile.rules: Normalize use of trailing slashes in path variables.
llvm-svn: 356711
2019-03-21 20:36:23 +00:00
Michal Gorny 2819136f0a [lldb] Add missing EINTR handling
Differential Revision: https://reviews.llvm.org/D59606

llvm-svn: 356703
2019-03-21 19:35:55 +00:00
Serge Guelton 525cd59f5a Python 2/3 compatibility: from __future__ import print_function
Differential Revision: https://reviews.llvm.org/D59580

llvm-svn: 356695
2019-03-21 18:27:40 +00:00
Zachary Turner b4fe87d0c9 Move the rest of the sections over to DWARFContext.
This is mostly mechanical, and just moves the remaining non-DWO
related sections over to DWARFContext.

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

llvm-svn: 356682
2019-03-21 16:34:58 +00:00
Serge Guelton ce54fa1855 Workaround items/iteritems difference between Python2 and Python3
Differential Revision: https://reviews.llvm.org/D59588

llvm-svn: 356673
2019-03-21 14:47:40 +00:00
Serge Guelton 468219b387 Workaround Python's map difference between Python2/3
When the output of map is not used, using a list comprehension or an explicit
call to list looks awkward.

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

llvm-svn: 356672
2019-03-21 14:44:58 +00:00
Serge Guelton bfb779188f Portable int/long conversion across Python 2 / Python 3
Differential Revision: https://reviews.llvm.org/D59585

llvm-svn: 356671
2019-03-21 14:41:34 +00:00
Serge Guelton 3577da7667 Portable exception value access across Python 2 / Python 3
Differential Revision: https://reviews.llvm.org/D59583

llvm-svn: 356670
2019-03-21 14:39:55 +00:00
Serge Guelton 32cffcf1ab Use list comprehension instead of map/filter to prepare Python2/3 compat
Differential Revision: https://reviews.llvm.org/D59579

llvm-svn: 356647
2019-03-21 07:19:09 +00:00
Jonas Devlieghere a262531dd2 [Reproducers] Properly handle QEnvironment packets
On Linux, a QEnvironment packet is sent for every environment variable.
This breaks replay when the number of environment variables is different
then during capture. The solution is to always reply with OK.

llvm-svn: 356643
2019-03-21 04:08:31 +00:00
Jonas Devlieghere e3ea27b640 [Reproducers] Log inconsistencies during replay (NFC)
Make debugging of the GDB remote packet aspect of reproducers easier by
logging both requests and replies. This enables some sanity checking
during replay.

llvm-svn: 356638
2019-03-21 01:57:33 +00:00
Jason Molenda 9d760a0a76 Change the logging on ptrace(PT_KILL) in MachProcess::Kill to log
if LOG_PROCESS is enabled or if there was an error making that call.

<rdar://problem/49036508> 

llvm-svn: 356626
2019-03-20 22:59:16 +00:00
Jason Molenda db5edebea2 Update DWARF files.
llvm-svn: 356625
2019-03-20 22:57:33 +00:00
Zachary Turner 6e66512758 Introduce DWARFContext.
LLVM's DWARF parsing library has a class called DWARFContext which holds
all of the various DWARF data sections and lots of other information.
LLDB's on the other hand stores all of this directly in SymbolFileDWARF
/ SymbolFileDWARFDwo and passes this interface around through the
parsing library. Obviously this is incompatible with a world where the
low level interface does not depend on the high level interface, so we
need to move towards a model similar to LLVM's - i.e. all of the context
needed for low level parsing should be in a single class, and that class
gets passed around.

This patch is a small incremental step towards achieving this. The
interface and internals deviate from LLVM's for technical reasons, but
the high level idea is the same. The goal is, eventually, to remove all
occurrences of SymbolFileDWARF from the low level parsing code.

For now I've chosen a very simple section - the .debug_aranges section
to move into DWARFContext while leaving everything else unchanged. In
the short term this is a bit confusing because now the information you
need might come from either of 2 different locations. But it's a huge
refactor to do this all at once and runs a much higher risk of breaking
things. So I think it would be wise to do this in very small pieces.

TL;DR - No functional change

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

llvm-svn: 356612
2019-03-20 20:49:25 +00:00
Raphael Isemann 5e3a7698e8 Remove the unused return value in ASTImporter::Imported [NFC]
Summary:
`ASTImporter::Imported` currently returns a Decl, but that return value is not used by the ASTImporter (or anywhere else)
nor is it documented.

Reviewers: balazske, martong, a.sidorin, shafik

Reviewed By: balazske, martong

Subscribers: rnkovacs, cfe-commits

Tags: #clang

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

llvm-svn: 356592
2019-03-20 19:00:25 +00:00
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
Zachary Turner 611d1f98c5 Delete more dead code.
All of this is code that is unreferenced.  Removing as much of
this as possible makes it more easy to determine what functionality
is missing and/or shared between LLVM and LLDB's DWARF interfaces.

llvm-svn: 356509
2019-03-19 20:08:56 +00:00
Zachary Turner 2face4f68b Remove some dead DWARF enum -> string conversion functions.
llvm-svn: 356495
2019-03-19 18:32:43 +00:00
Zachary Turner aea0985814 Delete dead code.
Most of these are Dump functions that are never called, but there
is one instance of entire unused classes (DWARFDebugMacinfo and
DWARFDebugMacinfoEntry) which are also unreferenced in the codebase).

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

llvm-svn: 356490
2019-03-19 18:06:32 +00:00
Davide Italiano 60be633a47 [ScriptInterpreterPython] Remove dead code.
llvm-svn: 356487
2019-03-19 17:35:40 +00:00
Davide Italiano b137c3570a [StackFrameRecognizer] Remove unneeded LLDB_DISABLE_PYTHON.
llvm-svn: 356486
2019-03-19 17:35:37 +00:00
Michal Gorny ae211ece6a [lldb] [Reproducer] Move SBRegistry registration into declaring files
Move SBRegistry method registrations from SBReproducer.cpp into files
declaring the individual APIs, in order to reduce the memory consumption
during build and improve maintainability.  The current humongous
SBRegistry constructor exhausts all memory on a NetBSD system with 4G
RAM + 4G swap, therefore making it impossible to build LLDB.

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

llvm-svn: 356481
2019-03-19 17:13:13 +00:00
Zachary Turner 66158c00f9 Remove a couple of log statements.
These log statements have questionable value, and hinder the effort
of separating the high and low level DWARF parsing interfaces inside
of LLDB.  Removing them for now, and if/when we need such log statements
again in the future, we can add them back (if possible) or introduce a
mechanism for logging from the low-level interface in such a way that it
isn't coupled to the high level interface.

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

llvm-svn: 356469
2019-03-19 16:26:08 +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 06453b0619 Fix a "memset clearing an object of non-trivial type" warning in EmulateInstruction
This is a new warning which started appearing as of gcc-8. The Opcode
class has a non-trivial constructor, so the idea of the warning is that
code should use that to initialize the object instead of using memset
(which can perturb class invariants set up by the constructor). In this
case, the Opcode default constructor was already clearing the object's
fields so we can just drop the memset call.

While I'm touching the EmulateInstruction constructor, I also move the
initialization of other members into the class declaration.

llvm-svn: 356459
2019-03-19 15:05:55 +00:00
Jason Molenda 2d5e7adf26 A target definition file that may work for
Aarch32 Cortex-M target processor debugging.

<rdar://problem/48448564> 

llvm-svn: 356416
2019-03-18 21:39:54 +00:00
Alex Langford b4a3b29d16 [CMake] Set LLVM_DEFAULT_EXTERNAL_LIT in standalone build correctly on windows
LLVM installed llvm-lit with a .py suffix on windows. Let's match that
behavior here.

llvm-svn: 356412
2019-03-18 21:32:31 +00:00
Davide Italiano 65dc65216e [API] Remove unneded LLDB_DISABLE_PYTHON markers.
llvm-svn: 356401
2019-03-18 20:02:27 +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 370e5dbacd Fix some "variable 'foo' set but not used" warnings
gcc-8 diagnoses these.

llvm-svn: 356378
2019-03-18 16:04:46 +00:00
Pavel Labath 22457e66c5 Fix libstdc++ data formatters for python3
Use floor-division for consistentcy across python versions. This fixes a
couple of libstdc++ data formatter tests.

llvm-svn: 356377
2019-03-18 15:42:08 +00:00
Pavel Labath 58e9ef139d Fix TestCommandScriptImmediateOutput for python3
s/iteritems/items

llvm-svn: 356370
2019-03-18 14:13:12 +00:00
Pavel Labath f92ddfed5a Fix "type qualifiers ignored on cast result type" warnings
These warnings start to get emitted with gcc-8.

llvm-svn: 356362
2019-03-18 10:50:46 +00:00
Pavel Labath dec963921b Reinitialize UnwindTable when the SymbolFile changes
Summary:
This is a preparatory step to enable adding of unwind plans by symbol
file plugins.

Although at the surface it seems that currently symbol files have
nothing to do with unwinding, this isn't entirely correct even now. The
mere act of adding a symbol file can have the effect of making more
sections (typically .debug_frame) available to the unwinding machinery,
so that it can have more unwind strategies to choose from.

Up until now, we've had a bug, which went largely unnoticed, where
unwind info in the manually added symbols files (target symbols add) was
being ignored during unwinding. Reinitializing the UnwindTable fixes
that bug too.

Reviewers: clayborg, jasonmolenda, alexshap

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 356361
2019-03-18 10:45:02 +00:00
Zachary Turner 98661d0221 Abbreviation declarations are required to have non-null tags.
Treat a null tag as an error.

llvm-svn: 356284
2019-03-15 18:00:43 +00:00
Zachary Turner 1cbbab9277 Return Error and Expected from more DWARF interfaces.
This continues the work of introducing Error and Expected into
the DWARF parsing interfaces, this time for the DWARFCompileUnit
and DWARFDebugAranges classes.

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

llvm-svn: 356278
2019-03-15 17:32:05 +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
Davide Italiano bbcda82e21 [DataFormatters] Remove LLDB_DISABLE_PYTHON from TypeCategory.
llvm-svn: 356271
2019-03-15 16:55:51 +00:00
Pavel Labath 1de5a2ef96 Fix a typo in FindLibEdit.cmake
The package name is LibEdit, so we should use that name in the call to
find_package_handle_standard_args. Failing to do so results in the
standard_args (such as the one telling us whether REQUIRED was used in
the find_package invocation) not being handled.

llvm-svn: 356263
2019-03-15 14:03:52 +00:00
Pavel Labath a933d6c7c0 Delete type_sp member from TypePair
Summary:
As discussed in the review of D59217, this member is unnecessary since
always the first thing we do is convert it to a CompilerType.

This opens up possibilities for further cleanups (e.g. the whole
TypePair class now loses purpose, since we can just pass around
CompilerType everywhere), but I did not want to do that yet, because I
am not sure if this will not introduce breakages in some of the
platforms/configurations that I am not testing on.

Reviewers: clayborg, zturner, jingham

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 356262
2019-03-15 14:02:35 +00:00
Jorge Gorbe Moya 717b1c804b [lldb-vscode] Fix dangling pointer in request_evaluate.
SBError::GetCString() returns a pointer to a string owned by the SBError
object. The code here was calling GetCString on a temporary and using
the returned pointer after the temporary was destroyed.

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

llvm-svn: 356227
2019-03-15 01:46:50 +00:00
Davide Italiano 71560b5e2b [DataFormatters] Remove LLDB_DISABLE_PYTHON from FormatManager.
And DataVisualization. One step closer.

llvm-svn: 356225
2019-03-15 00:45:57 +00:00
Davide Italiano 3772796aaa [ObjCLanguage] Remove LLDB_DISABLE_PYTHON markers from the formatters.
llvm-svn: 356210
2019-03-14 22:12:59 +00:00
Zachary Turner bb26a7eb11 Return llvm::Error and llvm::Expected from DWARF parsing code.
The goal here is to improve our error handling and error recovery while
parsing DWARF, while at the same time getting us closer to being able to
merge LLDB's DWARF parser with LLVM's. To this end, I've udpated several
of the low-level parsing functions in LLDB to return llvm::Error and
llvm::Expected.

For now, this only updates LLDB parsing functions and not LLVM. In some
ways, this actually gets us *farther* from parity with the two
interfaces, because prior to this patch, at least the parsing interfaces
were the same (i.e. they all just returned bools, and now with this
patch they're diverging). But, I chose to do this for two primary
reasons.

LLDB has error logging code engrained deep within some of its parsing
functions. We don't want to lose this logging information, but obviously
LLVM has no logging mechanism at all. So if we're to merge the
interfaces, we have to find a way to still allow LLDB to properly report
parsing errors while not having the reporting code be inside of LLVM.
LLDB (and indeed, LLVM) overload the meaning of the false return value
from all of these extraction functions to mean both "We reached the null
entry at the end of a list of items, therefore everything was
successful" as well as "something bad and unrecoverable happened during
parsing". So you would have a lot code that would do something like:
while (foo.extract(...)) {
  ...
}

But when the loop stops, why did it stop? Did it stop because it
finished parsing, or because there was an error? Because of this, in
some cases we don't always know whether it is ok to proceed, or how to
proceed, but we were doing it anyway.

In this patch, I solve the second problem by introducing an
enumeration called DWARFEnumState which has two values MoreItems and
Complete. Both of these indicate success, but the latter indicates
that we reached the null entry. Then, I return this value instead of
bool, and convey parsing failure separately.

To solve the first problem (and convey parsing failure) these
functions now return either llvm::Error or llvm::Expected<DWARFEnumState>.
Having this extra bit of information allows us to properly convey all 3 of
"error, bail out", "success, call this function again", and "success,
don't call this function again".

In subsequent patches I plan to extend this pattern to the rest of the
parsing interfaces, which will ultimately get all of the log statements
and error reporting out of the low level parsing code and into the high
level parsing code (e.g. SymbolFileDWARF, DWARFASTParserClang, etc).

Eventually, these same changes will have to be backported to LLVM's
DWARF parser, but diverging in the short term is the easiest way to
converge in the long term.

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

llvm-svn: 356190
2019-03-14 19:05:55 +00:00
Davide Italiano 1dbbf2de33 [DataFormatters] Delete unused code. Not even exposed in the API.
I stumbled upon this while removing LLDB_DISABLE_PYTHON when
not needed.

llvm-svn: 356176
2019-03-14 17:41:29 +00:00
Raphael Isemann d63c1dbd4b Safer casting in ClangExpressionParser code completion
Summary:
Makes the code a bit safer in the unlikely situation that we don't get a ClangUserExpression
when doing code completion.

Reviewers: aprantl, jingham

Reviewed By: aprantl

Subscribers: labath, jdoerfert, lldb-commits

Tags: #lldb

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

llvm-svn: 356174
2019-03-14 17:39:39 +00:00
Davide Italiano f6a84ed30b [Python] Start eradicating unneeded LLDB_DISABLE_PYTHON guards.
While we don't have a bot, I'm testing by hand that this configuration
compiles. We'll probably set up one once I'm done flensing.

llvm-svn: 356171
2019-03-14 17:23:08 +00:00
Jonas Devlieghere fa3f6401da [Reproducers] Fix data race found by tsan
This fixes a data race uncovered by tsan during destruction of the
GDBRemoteReplay server. The solution is to lock the thread state mutex
when receiving packets.

llvm-svn: 356168
2019-03-14 17:19:34 +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
Jorge Gorbe Moya d383a342aa [lldb-vscode] Don't try to launch an invalid program.
If an invalid program is specified, lldb-vscode will send back a
response with "success" = false, but then will continue executing the
rest of request_launch(), try to launch the program anyway and try to
send another response (possibly using the `response` object after it was
moved).

This change adds a return statement so we stop executing the handler
after producing the first failing response.

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

llvm-svn: 356110
2019-03-13 23:50:35 +00:00
Jason Molenda 97866d74db Reorder the operations in
DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule a
bit so that we only read the binaries out of memory once we've
determined that we can find a real binary on the local system.  

Previously, lldb would read all of the kext binaries out of memory
and then determine if it had the local copy.  The kext table gives
us most the information we need (address, name, uuid) so lldb only
needs the actual in-memory load commands when it comes time to set
the section load addresses.  Delay reading until that point for all
the kexts.

NFC; doing the operations in a different order.


<rdar://problem/41181173> 

llvm-svn: 356108
2019-03-13 23:34:20 +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
Adrian Prantl 7e34d78da1 Fix an invalid static cast in ClangExpressionParser.cpp
This was found by the green dragon sanitizer bot.

rdar://problem/48536644

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

llvm-svn: 356090
2019-03-13 19:46:30 +00:00
Alex Langford be9f3b636e [ExpressionParser] Restore removed intance of FileSystem::Resolve while resolving clang resource dir
I committed a change that removed this line, but I meant to restore it
befor committing.

llvm-svn: 356079
2019-03-13 18:51:22 +00:00
Jason Molenda 6a5fa552c7 Update.
llvm-svn: 356073
2019-03-13 18:24:42 +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
Adrian Prantl 81d03f3a8f Make sure FileSystem::Resolve preserves the path/file distinction.
This should finally fix TestPaths.py.

llvm-svn: 356057
2019-03-13 15:54:18 +00:00
Pavel Labath 01b595c0cb Fix/unify SBType comparison
Summary:
In my next step at cleaning up modify-python-lldb.py, I started focusing
on equality comparison. To my surprise, I found out that both python and
c++ versions of the SBType class implement equality comparison, but each
one does it differently. While the python version was implemented in
terms of type name equality, the C++ one used a deep comparison on the
underlying objects.

Removing the python version caused one test to fail (TestTypeList). This
happened because the c++ version of operator== boiled down to
TypePair::operator==, which contains two items: the compiler_type and
type_sp. In this case, the compiler_type was identical, but one of the
objects had the type_sp field unset.

I tried fixing the code so that both objects keep their type_sp member,
but it wasn't easy, because there are so many operations which just work
with the CompilerType types, and so any operation on the SBType (the
test in question was doing GetPointeeType on the type of one variable
and expecting it to match the type of another variable), cause that
second member to be lost.

So instead, here I relax the equality comparison on the TypePair
class. Now, this class ignores the type_sp for the purposes of
comparison, and uses the CompilerType only. This seems reasonable, as
each TypeSP is able to convert itself to a CompilerType.

Reviewers: clayborg, aprantl, serge-sans-paille

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 356048
2019-03-13 13:45:14 +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 22c660cc13 Update the macOS implementation of ComputeClangResourceDirectory to
comply with the more pedantic TestPaths.py

llvm-svn: 355994
2019-03-12 23:59:02 +00:00
Jim Ingham e62366bf1e This test is failing on and off on the bots.
Disable it for now till I can figure out what's going wrong.

llvm-svn: 355992
2019-03-12 23:15:48 +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
Jason Liu a03ae73c29 Add XCOFF triple object format type for AIX
This patch adds an XCOFF triple object format type into LLVM.
This XCOFF triple object file type will be used later by object file and assembly generation for the AIX platform.

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

llvm-svn: 355989
2019-03-12 22:01:10 +00:00
Adrian Prantl 8ef3da494c Temporarily add more logging to TestBatchMode
llvm-svn: 355986
2019-03-12 21:30:50 +00:00
Adrian Prantl 3552b86cbc Add more logging to ClangModulesDeclVendor.cpp
llvm-svn: 355985
2019-03-12 21:30:47 +00:00
Zachary Turner 7e44a8440c Remove support for DWARF64.
LLVM doesn't produce DWARF64, and neither does GCC.  LLDB's support
for DWARF64 is only partial, and if enabled appears to also not work.
Finally, it's untested.  Removing this makes merging LLVM and
LLDB's DWARF parsing implementations simpler.

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

llvm-svn: 355975
2019-03-12 20:51:05 +00:00
Zachary Turner 0eaa6d5b01 Remove DWARFDIECollection.
This is a very thin wrapper over a std::vector<DWARFDIE> and does
not seem to provide any real value over just using a container
directly.

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

llvm-svn: 355974
2019-03-12 20:50:46 +00:00
Zachary Turner d5364dfa6d Move ElaboratingDIEIterator into implementation file.
This is not used outside of the private implementation of the class,
so hiding in the implementation file is a nice way of simplifying
the external interface.

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

llvm-svn: 355973
2019-03-12 20:50:29 +00:00
Davide Italiano 4be269e604 [lldb/thirdparty] Remove unneeded files, asked by Jonas.
llvm-svn: 355969
2019-03-12 20:41:36 +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
Davide Italiano 205fd03a27 [third-party] Update pexpect to 4.6.
Reviewers: labath, jdevlieghere

Subscribers: lldb-commits

Tags: #llvm

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

llvm-svn: 355967
2019-03-12 20:41:24 +00:00
Jonas Devlieghere a54d580350 Fix compiler warning
Fixes warning: comparison of integers of different signs.

llvm-svn: 355963
2019-03-12 20:24:13 +00:00
Jason Molenda c02b95e4f9 Rework how lldb warngs about kexts that failed to load in a
darwin kernel debug session.

Originally, the kext name & uuid were emitted in the middle of the
kext-loading period's.  Last week I decided to try not printing
any details about kexts that failed to load, only printing a summary
of how many failed to load.  

This time I'm print different progress characters depending on whether
the kext loaded or not ("-" for not), then at the end I will print a 
summary of how many kexts failed to load and a sorted list of the
kexts with the bundle ID and the uuid.  It's a lot more readable.

<rdar://problem/48654569> 

llvm-svn: 355958
2019-03-12 19:42:34 +00:00
Jim Ingham 027bf7603f Check the result of creating a node from __next_ in the std::list formatter.
There's a single report of a crash coming from this current_sp being NULL.  I don't
have a repro case, and I couldn't get it to happen by hand-corrupting a list.  We
always get an error instead.  So I don't have a test case.  But checking for null
is clearly right here.

<rdar://problem/48503320>

llvm-svn: 355957
2019-03-12 19:27:39 +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
Jim Ingham 85c2955f45 Fix the project for r355939 (ASTUtils.{h,c})
llvm-svn: 355951
2019-03-12 18:48:58 +00:00