summaryrefslogtreecommitdiffstats
path: root/lldb/source
Commit message (Collapse)AuthorAgeFilesLines
* Break cycle lldb/Commands [3->] lldb/Expression [1->] lldb/CommandsJonas Devlieghere2019-03-092-16/+26
| | | | | | | | | | Inspired by Zachary's mail on lldb-dev, this seemed like low hanging fruit. This patch breaks the circular dependency between commands and expression. Differential revision: https://reviews.llvm.org/D59158 llvm-svn: 355762
* Add parens to force the order of operations in an expression tryingJason Molenda2019-03-091-1/+1
| | | | | | | | | | | to do "databuffer + offset" so that we don't overflow the uint64_t's we're using for addresses when working with high addresses. Found with clang's ubsan while doing darwin kernel debugging. <rdar://problem/48728940> llvm-svn: 355761
* [lldb] [Process] Add proper support for NetBSD core files with threadsMichal Gorny2019-03-082-30/+191
| | | | | | | | | | | | | | Improve the support for processing NetBSD cores. Fix reading process identifier, thread information and associating the terminating signal with the correct thread. Includes test cases for single-threaded program receiving SIGSEGV, and two dual-threaded programs: one where thread receives the signal, and the other one when the whole process is signalled. Differential Revision: https://reviews.llvm.org/D32149 llvm-svn: 355736
* Remove dependency edges from Host to Target/Core.Zachary Turner2019-03-081-1/+0
| | | | | | After recent changes, Host is now dependency-free. llvm-svn: 355730
* [Reproducers] Add missing LLDB_RECORD_DUMMY macrosJonas Devlieghere2019-03-0811-7/+105
| | | | | | | Re-ran lldb-inst on the API folder to insert missing LLDB_RECORD_DUMMY macros. llvm-svn: 355711
* [Reproducers] Add LLDB_RECORD_DUMMYJonas Devlieghere2019-03-081-3/+6
| | | | | | | | | | | | | Add a macro that doesn't actually record anything but still toggles the API boundary. Removing just the register macros for lldb::thread_t wasn't sufficient on NetBSD because the serialization logic needed the underlying type to be complete. This macro should be used by functions that are currently unsupported, as they might trip the API boundary logic. This should be easy using the lldb-instr tool. llvm-svn: 355709
* [lldb-vscode] Report an error if an invalid program is specified.Zachary Turner2019-03-081-92/+96
| | | | | | | | | | | | | | | Previously if an invalid program was specified, there was a bug which, when we attempted to launch the program, would report that the operation succeeded, causing LLDB to then hang while waiting indefinitely to receive some events from the process. After this patch, when an invalid program is specified, we immediately return to vs code with an error message that indicates that the program can not be found. Differential Revision: https://reviews.llvm.org/D59114 llvm-svn: 355656
* [SBAPI] Log from record macroJonas Devlieghere2019-03-0738-3024/+75
| | | | | | | | | | | | | | | | The current record macros already log the function being called. This patch extends the macros to also log their input arguments and removes explicit logging from the SB API. This might degrade the amount of information in some cases (because of smarter casts or efforts to log return values). However I think this is outweighed by the increased coverage and consistency. Furthermore, using the reproducer infrastructure, diagnosing bugs in the API layer should become much easier compared to relying on log messages. Differential revision: https://reviews.llvm.org/D59101 llvm-svn: 355649
* Fix TestPaths.py on windowsAlex Langford2019-03-071-1/+0
| | | | | | | | | | | | I committed an implementation of GetClangResourceDir on windows but forgot to update this test. I merged the tests like I intended to, but I realized that the test was actually failing. After looking into it, it appears that FileSystem::Resolve was taking the path and setting the FileSpec's Directory to "/path/to/lldb/lib/clang/" and the File to "9.0.0" which isn't what we want. So I removed the resolve line from DefaultComputeClangResourceDir. llvm-svn: 355648
* Add an LLVM-style dump method to CompilerType for extra convenience during ↵Adrian Prantl2019-03-072-0/+19
| | | | | | | | | | debugging This change has no effect on Release (NoAsserts) builds. Differential Revision: https://reviews.llvm.org/D59102 llvm-svn: 355632
* [ExpressionParser] Implement ComputeClangResourceDir for WindowsAlex Langford2019-03-074-50/+33
| | | | | | | | | | | | | | | | Summary: This function is useful for expression evaluation, especially when doing swift debugging on windows. Reviewers: aprantl, labath Reviewed By: labath Subscribers: teemperor, jdoerfert, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D59072 llvm-svn: 355631
* [lldb] Fix DW_OP_addrx uses.Ali Tamur2019-03-074-3/+15
| | | | | | | | | | | | | | | | Summary: DW_OP_GNU_addr_index has been renamed as DW_OP_addrx in the standard. clang produces DW_OP_addrx tags and with this change lldb starts to process them. Reviewers: aprantl, jingham, davide, clayborg, serge-sans-paille Reviewed By: aprantl Subscribers: jdoerfert, dblaikie, labath, shafik, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D59004 llvm-svn: 355629
* [Reproducers] Disable registering lldb::thread_t everywhereJonas Devlieghere2019-03-071-11/+0
| | | | | | | | | As discussed on the mailing list, default serialization for thread ids is not correct, even if they're represented as basic types. I'm purposely leaving the corresponding record macros in place so that we don't break the API boundary detection. llvm-svn: 355610
* When disassembling Aarch64 target and vendor Apple, set the cpu toJason Molenda2019-03-071-0/+5
| | | | | | | | | | | | "apple-latest" which llvm uses to indicate the newest supported ISA. Add a unit test; I'm only testing an armv8.1 instruction in this unit test which would already be disassembled correctly because we set the disassembler to ARM v8.2 mode, but it ensures that nothing has been broken by adding this cpu spec. <rdar://problem/38714781> llvm-svn: 355578
* Repair the build when LLDB_DISABLE_PYTHON is setAlex Langford2019-03-071-20/+28
| | | | | | | | | | | Summary: If LLDB_DISABLE_PYTHON is set, some functions are unavailable but SBReproducer assumes they are. Let's conditionally register those functions since they are conditionally declared. Differential Revision: https://reviews.llvm.org/D59056 llvm-svn: 355575
* Promote more debug-only assertions to regular assertions.Adrian Prantl2019-03-075-22/+2
| | | | llvm-svn: 355569
* Promote more debug-only assertions to regular assertions.Adrian Prantl2019-03-072-6/+0
| | | | llvm-svn: 355568
* Remove the warning inJason Molenda2019-03-061-9/+7
| | | | | | | | | | | | | | | | | | DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule which would list every kext that failed to load when doing kernel debugging. Instead, in DynamicLoaderDarwinKernel::ParseKextSummaries, print a summary of how many kexts lldb was unable to load at the end. I want to reduce the amount of output at the start of kernel debug sessions a bit; we'll see if anyone really wanted to see the list of which kexts specifically were unable to be loaded. No functional change, only changing lldb's output at the start of a kernel debug session. <rdar://problem/48654569> llvm-svn: 355565
* Fix Cmake files for ExpressionSourceCode.cpp -> ClangExpressionSourceCode.cpp.Jim Ingham2019-03-062-1/+1
| | | | llvm-svn: 355561
* Factor the clang specific parts of ExpressionSourceCode.{h,cpp} into the ↵Jim Ingham2019-03-067-18/+72
| | | | | | | | | | clang plugin. NFC Differential Revision: https://reviews.llvm.org/D59040 llvm-svn: 355560
* Pass /bigobj for SBReproducer.cpp with MSVCZachary Turner2019-03-061-0/+4
| | | | | | | | | /BIGOBJ is used to bypass certain COFF file format limitations and is used with, unsurprisingly, very big object files. This file has grown large enough that it needs this flag in order to compile successfully. llvm-svn: 355559
* Pass ConstString by value (NFC)Adrian Prantl2019-03-06140-512/+510
| | | | | | | | | | | | | | | | | My apologies for the large patch. With the exception of ConstString.h itself it was entirely produced by sed. ConstString has exactly one const char * data member, so passing a ConstString by reference is not any more efficient than copying it by value. In both cases a single pointer is passed. But passing it by value makes it harder to accidentally return the address of a local object. (This fixes rdar://problem/48640859 for the Apple folks) Differential Revision: https://reviews.llvm.org/D59030 llvm-svn: 355553
* Try again to fix OSX compilation failure.Zachary Turner2019-03-061-1/+4
| | | | llvm-svn: 355536
* Try to fix OSX compilation failure.Zachary Turner2019-03-061-1/+4
| | | | llvm-svn: 355531
* Resubmit "Don't include UnixSignals.h from Host."Zachary Turner2019-03-067-16/+24
| | | | | | | | This was reverted because it breaks the GreenDragon bot, but the reason for the breakage is lost, so I'm resubmitting this now so we can find out what the problem is. llvm-svn: 355528
* Fix core files for 32 bit architectures that are supported in ProcessELFCore.cppGreg Clayton2019-03-061-5/+5
| | | | | | | | | | Core files need to know the size of the PRSTATUS header so that we can grab the register values that follow it. The code that figure out this size was using a hard coded list of architecture cores instead of relying on 32 or 64 bit for most cores. The fix here fixes core files for 32 bit ARM. Prior to this the PRSTATUS header size was being returned as zero and the register values were being taken from the first bytes of the PRSTATUS struct (signo, etc). Differential Revision: https://reviews.llvm.org/D58985 llvm-svn: 355526
* Re-apply "Fix embedded Python initialization according to changes in version ↵Tatyana Krasnukha2019-03-061-1/+13
| | | | | | 3.7" llvm-svn: 355523
* [Reproducers] Guard register macros that take lldb::thread_t on WindowsJonas Devlieghere2019-03-061-0/+4
| | | | | | | | On Windows, lldb::thread_t is just a void*, so the we will try to allocate an object of type void when deserializing. Undef this for now until we support void* arguments. llvm-svn: 355519
* [Reproducers] Don't use VLA in SBReproducer redirectJonas Devlieghere2019-03-061-1/+1
| | | | | | This should unbreak the Windows bot. llvm-svn: 355518
* Move RangeMap.h into UtilityPavel Labath2019-03-069-16/+12
| | | | | | | | | | | | | | Summary: This file implements some general purpose data structures, and so it belongs to the Utility module. Reviewers: zturner, jingham, JDevlieghere, clayborg, espindola Subscribers: emaste, mgorny, javed.absar, arichardson, MaskRay, lldb-commits Differential Revision: https://reviews.llvm.org/D58970 llvm-svn: 355509
* Change the scanning algorithm in ↵Jason Molenda2019-03-062-27/+41
| | | | | | | | | | | | | | | | | | | | | | | DynamicLoaderDarwinKernel::SearchForKernelNearPC. Currently when lldb might be doing a kernel debug session, it scans through memory by taking the current pc value and looking for a kernel at megabyte boundaries, up to 32MB behind $pc. This adjusts the algorithm to scan back at every 16k page boundary and to stop scanning as soon as we hit a memory read error. The addition of stopping at a memory read error saves us from tons of unnecessary packet traffic on generic targets where lldb might look for a kernel binary. I've been trying to think of how to construct a test for this; it's a bit tricky. A gdb-remote protocol test with the contents of a fake tiny kernel mach-o binary would satisify part of it, but this kernel path also directly calls over to dsymForUUID or DebugSymbols framework lookups to find the kernel binary as well. I'll keep thinking about this one, but it's so intertangled with these two external systems that it may be hard to do. <rdar://problem/48578197> llvm-svn: 355476
* Re-commit logging for SBCompileUnit::GetNumLineEntries.Jason Molenda2019-03-061-1/+7
| | | | llvm-svn: 355473
* [ExpressionParser] Fix ComputeClangResourceDirectory for windowsAlex Langford2019-03-061-1/+4
| | | | | | | | The function signature of ComputeClangResourceDirectory for windows wasn't updated when the others changed, causing the windows build to fail. This should fix that. llvm-svn: 355471
* [Reproducers] Enable replay from SBRepro.Jonas Devlieghere2019-03-061-3/+0
| | | | | | | | | Now that the LLDB instrumentation macros are in place, we should use that to test reproducer replay. Differential revision: https://reviews.llvm.org/D58565 llvm-svn: 355470
* [Reproducers] Don't intercept SBDebugger::SetInputFileHandleJonas Devlieghere2019-03-061-3/+1
| | | | | | | With the reproducer logic in place for the command interpreter we no longer need to make SBDebugger::SetInputFileHandle a no-op. llvm-svn: 355469
* Replace debug-only assert with a plain old assert.Adrian Prantl2019-03-061-7/+5
| | | | llvm-svn: 355466
* [ExpressionParser] Test GetClangResourceDirAlex Langford2019-03-062-29/+41
| | | | | | | | | | | | | Summary: I'm doing this because I plan on implementing `ComputeClangResourceDirectory` on windows so that `GetClangResourceDir` will work. Additionally, I made test_paths make sure that the directory member of the returned FileSpec is not none. This will fail on windows since `ComputeClangResourceDirectory` isn't implemented yet. Differential Revision: https://reviews.llvm.org/D58748 llvm-svn: 355463
* [Reproducers] Add SBReproducer macrosJonas Devlieghere2019-03-0666-983/+8842
| | | | | | | | | | This patch adds the SBReproducer macros needed to capture and reply the corresponding calls. This patch was generated by running the lldb-instr tool on the API source files. Differential revision: https://reviews.llvm.org/D57475 llvm-svn: 355459
* [SBAPI] Don't check IsValid in constructorJonas Devlieghere2019-03-0620-150/+136
| | | | | | | | | | | | | | | | | | | | | | | When running the test suite with the instrumentation macros, I noticed two lldb-mi tests regressed. The issue was the copy constructor of SBLineEntry. Without the macros the returned value would be elided, but with the macros the copy constructor was called. The latter using ::IsValid to determine whether the underlying opaque pointer should be set. This is likely a remnant of when ::IsValid would only check the validity of the smart pointer. In SBLineEntry however, it actually forwards to LineEntry::IsValid(). So what happened here was that because of the macros the copy constructor was called. The opaque pointer was valid but the LineEntry didn't consider itself valid. So the copied-to object ended up default initialized. This patch replaces all checks for IsValid in copy (assignment) constructors with checks for the opaque pointer itself. Differential revision: https://reviews.llvm.org/D58946 llvm-svn: 355458
* Remove tautological #ifdefs (NFC)Adrian Prantl2019-03-051-8/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D58838 llvm-svn: 355457
* Revert logging addition to SBCompileUnit::GetNumLineEntries,Jason Molenda2019-03-051-6/+1
| | | | | | causing lldb-mi testsuite failures? llvm-svn: 355449
* Add logging to SBCompileUnit::GetNumLineEntries.Jason Molenda2019-03-051-1/+6
| | | | llvm-svn: 355435
* [DataFormatters] Fix regression in libc++ std::atomic formatter caused by ↵Shafik Yaghmour2019-03-052-6/+64
| | | | | | | | https://reviews.llvm.org/D56913 rdar://problem/48568543 llvm-svn: 355422
* Revert "Fix embedded Python initialization according to changes in version 3.7"Tatyana Krasnukha2019-03-051-13/+1
| | | | | | Testsuite hangs on Windows likely due to these changes. llvm-svn: 355406
* Adds property to force enabling of GDB JIT loader for MacOSYury Delendik2019-03-051-12/+37
| | | | | | | | | | | | | | | | | Summary: Based on https://gist.github.com/thlorenz/30bf0a3f67b1d97b2945#patching-and-rebuilding The functionality was disabled at https://github.com/llvm/llvm-project/commit/521c2278abb16f0148cef1bd061cadb01ef43192 Reviewers: jingham Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D57689 llvm-svn: 355402
* One more UserIDResolver fixPavel Labath2019-03-051-1/+1
| | | | | | | | | | | | | | | | | The intention in r355323 has been to implement a no-op resolver in the HostInfoBase class, which will then be shadowed a an implementation in the HostInfoPosix class. However, I add the shadowing declaration in HostInfoPosix.h, and instead had implemented the HostInfoBase function in HostInfoPosix.cpp. This has lead to undefined symbols on windows, and a subsequent implementation of a no-op resolver in HostInfoWindows (r355329). Since now there is no point on having a no-op resolver in the base class, I just remove the base declaration altogether, and have HostInfoPosix implement the (newly-declared) HostInfoPosix version of that function. llvm-svn: 355398
* [lldb] Fix linux host build after r355342Alexander Kornienko2019-03-051-0/+1
| | | | llvm-svn: 355392
* Fix embedded Python initialization according to changes in version 3.7Tatyana Krasnukha2019-03-051-1/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D58833 llvm-svn: 355388
* [Expression] Remove unused parameter from EvaluateAlex Langford2019-03-053-8/+6
| | | | llvm-svn: 355375
* [Host] Fix the build (and the modules build).Davide Italiano2019-03-051-0/+1
| | | | | | | -> Add a missing include to find the base class. -> Add a missing out-of-line declaration for a member function. llvm-svn: 355353
OpenPOWER on IntegriCloud