summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* [NativePDB] Add support for S_CONSTANT records.Zachary Turner2018-11-136-8/+1249
| | | | | | | | | | | | | | | | | clang-cl does not emit these, but MSVC does, so we need to be able to handle them. Because clang-cl does not generate them, it was a bit hard to write a test. So what I had to do was get an PDB file with some S_CONSTANT records in using cl and link, dump it using llvm-pdbutil dump -globals -sym-data to get the bytes of the records, generate the same object file using clang-cl but with -S to emit an assembly file, and replace all the S_LDATA32 records with the bytes of the S_CONSTANT records. This way, we can compile the file using llvm-mc and link it with lld-link. Differential Revision: https://reviews.llvm.org/D54452 llvm-svn: 346787
* [NativePDB] Improved support for nested type reconstruction.Zachary Turner2018-11-133-4/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a previous patch, we pre-processed the TPI stream in order to build the reverse mapping from nested type -> parent type so that we could accurately reconstruct a DeclContext hierarchy. However, there were some issues. An LF_NESTTYPE record is really just a typedef, so although it happens to be used to indicate the name of the nested type and referring to the global record which defines the type, it is also used for every other kind of nested typedef. When we rebuild the DeclContext hierarchy, we want it to be as accurate as possible, which means that if we have something like: struct A { struct B {}; using C = B; }; We don't want to create two CXXRecordDecls in the AST each with the exact same definition. We just want to create one for B and then define C as an alias to B. Previously, however, it would not be able to distinguish between the two cases and it would treat A::B and A::C as being two classes each with separate definitions. We address the first half of improving the pre-processing logic so that only actual definitions are treated this way. Later, in a followup patch, we can handle the case of nested typedefs since we're already going to be enumerating the field list anyway and this patch introduces the general framework for distinguishing between the two cases. Differential Revision: https://reviews.llvm.org/D54357 llvm-svn: 346786
* [Cocoa] Implement formatter for the new NSDate representation.Davide Italiano2018-11-131-1/+63
| | | | | | <rdar://problem/46002786> llvm-svn: 346783
* Add GDB remote packet reproducer.Jonas Devlieghere2018-11-1332-260/+1599
| | | | llvm-svn: 346780
* Since ABI's now hold a process WP, they should be handedJim Ingham2018-11-1312-48/+12
| | | | | | | | out one per process rather than keeping a single global instance. Differential Revision: https://reviews.llvm.org/D54460 llvm-svn: 346775
* [lldb] Add synthetic frontend for _NSCallStackArrayKuba Mracek2018-11-123-3/+45
| | | | | | | | An Obj-C array type _NSCallStackArray is used in NSException backtraces. This patch adds a synthetic frontend for _NSCallStackArray, which now correctly returns frame PCs. Differential Revision: https://reviews.llvm.org/D44081 llvm-svn: 346708
* Re-land "Extract construction of DataBufferLLVM into FileSystem"Jonas Devlieghere2018-11-1218-73/+94
| | | | | | This fixes some UB in isLocal detected by the sanitized bot. llvm-svn: 346707
* [lldb] Extract more fields from NSException valuesKuba Mracek2018-11-124-8/+172
| | | | | | | | This patch teaches LLDB about more fields on NSException Obj-C objects, specifically we can now retrieve the "name" and "reason" of an NSException. The goal is to eventually be able to have SB API that can provide details about the currently thrown/caught/processed exception. Differential Revision: https://reviews.llvm.org/D43884 llvm-svn: 346695
* Revert "Extract construction of DataBufferLLVM into FileSystem"Davide Italiano2018-11-1218-94/+73
| | | | | | It broke the lldb sanitizer bots. llvm-svn: 346694
* Remove the last CURRENT_ARCH reference in Xcode's build scripts.Frederic Riss2018-11-121-1/+1
| | | | | | In the same spirit as r346443. llvm-svn: 346684
* [lldb] Refactor ObjC/NSException.cpp (cleanup, avoid code duplication). NFC.Kuba Mracek2018-11-121-75/+47
| | | | | | | | | | - Refactor reading of NSException fields into ExtractFields method to avoid code duplication. - Remove "m_child_ptr" field, as it's not used anywhere. - Clang-format. Differential Revision: https://reviews.llvm.org/D44073 llvm-svn: 346679
* [lldb] Fix "code requires global destructor" warning in g_architecture_mutexKuba Mracek2018-11-121-4/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D44060 llvm-svn: 346673
* [PDB] Fix `vbases.test` requirementAleksandr Urakov2018-11-121-1/+1
| | | | | | Differential revision: https://reviews.llvm.org/D53506 llvm-svn: 346672
* [ClangASTContext] Extract VTable pointers from C++ objectsAleksandr Urakov2018-11-126-102/+160
| | | | | | | | | | | | | | | | | | This patch processes the case of retrieving a virtual base when the object is already read from the debuggee memory. To achieve that ValueObject::GetCPPVTableAddress was removed and was reimplemented in ClangASTContext (because access to the process is needed to retrieve the VTable pointer in general, and because this is the only place that used old version of ValueObject::GetCPPVTableAddress). This patch allows to use real object's VTable instead of searching virtual bases by offsets restored by MicrosoftRecordLayoutBuilder. PDB has no enough info to restore VBase offsets properly, so we have to read real VTable instead. Differential revision: https://reviews.llvm.org/D53506 llvm-svn: 346669
* [CMake] Allow version overrides with -DLLDB_VERSION_MAJOR/MINOR/PATCH/SUFFIXStefan Granitz2018-11-122-4/+15
| | | | | | | | | | | | | | Summary: This follows the approach in Clang. If no overrides are given, LLDB_VERSION_* is inferred from LLVM_VERSION_*. This mimics the current behaviour (PACKAGE_VERSION itself is generated from LLVM_VERSION_*). For in-tree builds LLVM_VERSION_* will be defined at this point already. For standalone builds, LLDBConfig.cmake is included after LLDBStandalone.cmake which includes LLVMConfig.cmake. Reviewers: labath, xiaobai Subscribers: mgorny, friss, aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D54333 llvm-svn: 346668
* [CMake] Fix: add_host_subdirectory source/Host/macosxStefan Granitz2018-11-121-1/+1
| | | | | | | | | | | | Summary: Typo introduced with https://reviews.llvm.org/D47929 Reviewers: teemperor Subscribers: mgorny, friss, lldb-commits Differential Revision: https://reviews.llvm.org/D54335 llvm-svn: 346667
* Fix an unused variable warning. NFCAlexander Kornienko2018-11-121-0/+2
| | | | llvm-svn: 346651
* Remove header grouping comments.Jonas Devlieghere2018-11-11733-2684/+26
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* Remove comments after header includes.Jonas Devlieghere2018-11-11168-936/+932
| | | | | | | | | | This patch removes the comments following the header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. Differential revision: https://reviews.llvm.org/D54385 llvm-svn: 346625
* Add missing includeJonas Devlieghere2018-11-101-0/+1
| | | | llvm-svn: 346599
* Extract construction of DataBufferLLVM into FileSystemJonas Devlieghere2018-11-1018-73/+94
| | | | | | | | | | This moves construction of data buffers into the FileSystem class. Like some of the previous refactorings we don't translate the path yet because the functionality hasn't been landed in LLVM yet. Differential revision: https://reviews.llvm.org/D54272 llvm-svn: 346598
* Unbreak the linux bot from the previous commit. Fred needed to useJason Molenda2018-11-101-0/+6
| | | | | | | | | some of the macros from mach/exc_resource.h to decode EXC_RESOURCE, but that header doesn't exist on non-apple platforms and StopInfoMachException.cpp needs to build on those systems. EXC_RESOURCE won't be decoded when lldb is built on non-darwin systems. llvm-svn: 346573
* Add extra diagnostics to testAdrian Prantl2018-11-101-0/+4
| | | | llvm-svn: 346572
* Enable listening for EXC_RESOURCE events, and format machJason Molenda2018-11-102-19/+81
| | | | | | | | | | | | | | | | | | | | event as a thread stop reason if we receive one, using some macros to decode the payload. Patch originally written by Fred Riss, with a few small changes by myself. Writing a test for this is a little tricky because the mach exception data interpretation relies on header macros or function calls - it may change over time and writing a gdb_remote_client test for this would break as older encoding interpretation is changed. I'll tak with Fred about this more, but neither of us has been thrilled with the kind of tests we could write for it. <rdar://problem/13097323>, <rdar://problem/40144456> llvm-svn: 346571
* Work with a gdb-remote target that doesn't handle theJason Molenda2018-11-093-2/+77
| | | | | | | | | | | | | | | | | | | | | | | | | qWatchpointSupportInfo packet correctly. In GDBRemoteCommunicationClient::GetWatchpointSupportInfo, if the response to qWatchpointSupportInfo does not include the 'num' field, then we did not get an answer we understood, mark this target as not supporting that packet. In Target.cpp, rename the very confusingly named CheckIfWatchpointsExhausted to CheckIfWatchpointsSupported, and check the error status returned by Process::GetWatchpointSupportInfo. If we cannot determine what the number of supported watchpoints are, assume that they will work. We'll handle the failure later when we try to create/enable the watchpoint if the Z2 packet isn't supported. Add a gdb_remote_client test case. <rdar://problem/42621432> llvm-svn: 346561
* Remove llvm include from debugserver, change Jason Molenda2018-11-092-5/+3
| | | | | | | | LLVM_FALLTHROUGH's to [[clang::fallthrough]] - debugserver is only ever compiled on darwin systems with clang. llvm-svn: 346553
* Add missing includeAdrian Prantl2018-11-091-0/+1
| | | | llvm-svn: 346527
* Add missing includeAdrian Prantl2018-11-091-0/+1
| | | | llvm-svn: 346525
* Annotate switch with LLVM_FALLTHROUGHAdrian Prantl2018-11-092-2/+3
| | | | llvm-svn: 346519
* [NativePDB] Fix completion of enum types.Zachary Turner2018-11-092-1/+3
| | | | | | | | | | | | | This was originally submitted in a patch which fixed two unrelated bugs at the same time. This portion of the fix was reverted because it broke several other things. However, the fix employed originally was totally wrong, and attempted to change something in the ValueObject printer when actually the bug was in the NativePDB plugin. We need to mark forward enum decls as having external storage, otherwise we won't be asked to complete them when the time comes. This patch implements the proper fix, and updates tests accordingly. llvm-svn: 346517
* [NativePDB] Add support for bitfield records.Zachary Turner2018-11-093-4/+86
| | | | | | | | | Bitfields are represented as LF_MEMBER records whose TypeIndex points to an LF_BITFIELD record that describes the bit width, bit offset, and underlying type of the bitfield. All we need to do is resolve these when resolving record types. llvm-svn: 346511
* Resubmit "Fix bug in PE/COFF plugin."Zachary Turner2018-11-094-7/+49
| | | | | | | | | | The original commit was actually 2 unrelated bug fixes, but it turns out the second bug fix wasn't quite correct, so the entire patch was reverted. Resubmitting this half of the patch by itself, then will follow up with a new patch which fixes the rest of the issue in a more appropriate way. llvm-svn: 346505
* revert rL346478Kadir Cetinkaya2018-11-091-2/+2
| | | | | | | | | | Summary: Reviewers: Subscribers: llvm-svn: 346502
* [lldb] Fix signature in test to match rL346453Kadir Cetinkaya2018-11-091-2/+2
| | | | llvm-svn: 346478
* Revert "[FileSystem] Make use of FS in TildeExpressionResolver"Jonas Devlieghere2018-11-0911-43/+21
| | | | | | | | The whole point of this change was making it possible to resolve paths without depending on the FileSystem, which is not what I did here. Not sure what I was thinking... llvm-svn: 346466
* Fix a test whose output changed.Zachary Turner2018-11-091-2/+2
| | | | | | | | | A previous commit fixed an issue with our AST generation where we were outputting enum decls incorrectly. But we forgot to update the test output. This patch updates the test output accordingly. llvm-svn: 346459
* [FileSystem] Make use of FS in TildeExpressionResolverJonas Devlieghere2018-11-0911-21/+43
| | | | | | | | In order to call real_path from the TildeExpressionResolver we need access to the FileSystem. Since the resolver lives under utility we have to pass in the FS. llvm-svn: 346457
* Fix CMake build when building with -fmodules-local-submodule-visibility.Adrian Prantl2018-11-091-0/+2
| | | | llvm-svn: 346456
* Update FileSpec constructor signatureJonas Devlieghere2018-11-081-2/+5
| | | | llvm-svn: 346449
* Revert "Fix bug in PE/COFF plugin and ValueObjectVariable."Davide Italiano2018-11-085-61/+11
| | | | | | It breaks some tests on MacOS. llvm-svn: 346444
* Change $CURRENT_ARCH settings in xcode project file to hardcodedJason Molenda2018-11-081-6/+6
| | | | | | | "x86_64" - used for finding the llvm build directory. Newer Xcodes do not define CURRENT_ARCH. llvm-svn: 346443
* [lldb] Silence unhandled enums warning.Jorge Gorbe Moya2018-11-081-0/+14
| | | | | | | | | | | | The warning was introduced by r346392, which introduces new builtin types (to support cl_intel_device_side_avc_motion_estimation OpenCL extension). Note that this patch only inserts empty cases to silence the warning and unblock our integrate, does not aim to add support for the new types in lldb. llvm-svn: 346441
* [lldb] Fix initialization order warnings.Jorge Gorbe Moya2018-11-081-1/+1
| | | | | | | | | | | | | | | Moved the declaration of m_kind below the declaration of cvclass, cvunion and cvenum. This order is necessary because in one of the constructors the initialization of m_kind depends on the value of cvclass. third_party/llvm/llvm/tools/lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp:50:7: error: field 'cvclass' will be initialized after field 'm_kind' [-Werror,-Wreorder] : cvclass(std::move(c)), ^ third_party/llvm/llvm/tools/lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp:51:14: error: field 'cvclass' is uninitialized when used here [-Werror,-Wuninitialized] m_kind(cvclass.Kind == TypeRecordKind::Struct ? Struct : Class) {} llvm-svn: 346435
* Fix bug in PE/COFF plugin and ValueObjectVariable.Zachary Turner2018-11-085-11/+61
| | | | | | | | | | | | | | | | | | There are two bugs here. The first is that MSVC and clang-cl emit their bss section under the name '.data' instead of '.bss' but with the size and file offset set to 0. ObjectFilePECOFF didn't handle this, and would only recognize a section as bss if it was actually called '.bss'. The effect of this is that if we tried to print the value of a variable that lived in BSS we would fail. The second bug is that ValueObjectVariable was only returning the forward type, which is insufficient to print the value of an enum. So we bump this up to the layout type. Differential Revision: https://reviews.llvm.org/D54241 llvm-svn: 346430
* [NativePDB] Higher fidelity reconstruction of AST from Debug Info.Zachary Turner2018-11-0810-36/+496
| | | | | | | | | | | | | | | | | | | | | | | | | In order to accurately put a type into the correct location in the AST we construct from debug info, we need to be able to determine what DeclContext (namespace, global, nested class, etc) that it goes into. PDB doesn't contain this mapping. It does, however, contain the reverse mapping. That is, for a given class type T, you can determine all classes Q1, Q2, ..., Qn that are nested inside of T. We need to know, for a given class type Q, what type T is it nested inside of. This patch builds this map as a pre-processing step when we first load the PDB by scanning every type. Initial tests show that while this can be slow in debug builds of LLDB, it is quite fast in release builds (less than 2 seconds for a ~1GB PDB, and it only needs to happen once). Furthermore, having this pre-processing step in place allows us to repurpose it for building up other kinds of indexing to it down the line. For the time being, this gives us very accurate reconstruction of the DeclContext hierarchy. Differential Revision: https://reviews.llvm.org/D54216 llvm-svn: 346429
* Refactor ClangASTContext::AddEnumerationValueToEnumerationType() to remove ↵Shafik Yaghmour2018-11-088-47/+117
| | | | | | | | | | redundant parameter which can be calculated from other parameter. rdar://problem/43822994 Differential Revision: https://reviews.llvm.org/D54003 llvm-svn: 346428
* [FileSystem] Add convenience method to check for directories.Jonas Devlieghere2018-11-0817-28/+44
| | | | | | | | | | | Replace calls to LLVM's is_directory with calls to LLDB's FileSytem class. For this I introduced a new convenience method that, like the other methods, takes either a path or filespec. This still uses the LLVM functions under the hood. Differential revision: https://reviews.llvm.org/D54135 llvm-svn: 346375
* Re-commit regularization of the lldb-gtest-build target.Jason Molenda2018-11-071-0/+8
| | | | llvm-svn: 346347
* Adjust some id bit shifts to fit inside 32 bit integersNathan Lanza2018-11-074-6/+107
| | | | | | | | | | | | | | | Summary: The DAP on vscode uses a JavaScript `number` for identifiers while the Visual Studio version uses a C# `Int` for identifiers. lldb-vscode is bit shifting identifiers 32 bits and then bitwise ORing another 32 bit identifier into a 64 bit id to form a unique ID. Change this to a a partitioning of the 32 bits that makes sense for the data types. Reviewers: clayborg Differential Revision: https://reviews.llvm.org/D53599 llvm-svn: 346346
* Revert r346285 until I can make it work correctlyJason Molenda2018-11-071-68/+8
| | | | | | the way the bots build lldb. llvm-svn: 346342
OpenPOWER on IntegriCloud