summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* [lldb][NFC] Remove Ocaml from TypeSystem::LLVMCastKindRaphael Isemann2019-11-041-1/+0
| | | | Ocaml support was removed.
* [lldb][NFC] Remove unused ExpressionParser::ParseRaphael Isemann2019-11-043-16/+5
| | | | | | | | | | | | | | | Summary: This function is only used internally by ClangExpressionParser. By putting it in the ExpressionParser class all languages that implement ExpressionParser::Parse have to share the same signature (which forces us in downstream to add swift-specific arguments to ExpressionParser::Parse which then propagate to ClangExpressionParser and so on). Reviewers: davide Subscribers: JDevlieghere, lldb-commits Tags: #upstreaming_lldb_s_downstream_patches, #lldb Differential Revision: https://reviews.llvm.org/D69710
* [lldb][NFC] Make test/python_api/module_section test smallerRaphael Isemann2019-11-041-132/+2
| | | | | | | | | | | | | | | | Summary: I don't see why this test needs to compile this rather complicated file for just testing module sections. This just removes all this code with a simple "Hello world!" program which should be faster to compile Reviewers: labath, davide, JDevlieghere Reviewed By: JDevlieghere Subscribers: jfb, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69705
* [lldb] Also disable de-registration of EHFrames in IRExecutionUnitRaphael Isemann2019-11-041-0/+2
| | | | | | | | | | | | | | | | | Summary: We disabled registration by providing an empty `registerEHFrames`, so we should also provide an empty `deregisterEHFrames` in case that function relies on `registerEHFrames` being called before. Currently `deregisterEHFrames` is a no-op anyway as it just iterates over the (empty( list of registered EHFrames and then clear the empty list. Reviewers: davide, JDevlieghere Reviewed By: JDevlieghere Subscribers: JDevlieghere, lldb-commits Tags: #upstreaming_lldb_s_downstream_patches, #lldb Differential Revision: https://reviews.llvm.org/D69713
* [lldb] Provide a getter for m_materializer_up in LLVMUserExpression instead ↵Raphael Isemann2019-11-043-2/+8
| | | | | | | | | | | | | | | | | | of relying on it being accessible. Summary: Motivated by Swift using the materializer in a few places which requires us to add this getter ourselves. We also need a setter, but let's keep this minimal to unblock the downstream reverts in Swift. Reviewers: davide Reviewed By: davide Subscribers: abidh, JDevlieghere, lldb-commits Tags: #upstreaming_lldb_s_downstream_patches, #lldb Differential Revision: https://reviews.llvm.org/D69714
* [lldb] Add trailing dots to comments in Value.cppRaphael Isemann2019-11-041-2/+2
| | | | | | | | | | | | Reviewers: JDevlieghere Reviewed By: JDevlieghere Subscribers: JDevlieghere, lldb-commits Tags: #upstreaming_lldb_s_downstream_patches, #lldb Differential Revision: https://reviews.llvm.org/D69717
* python path should be platform-dependentLuboš Luňák2019-11-021-1/+1
| | | | | | Because one of the installed files is the _lldb.so symlink. Differential Revision: https://reviews.llvm.org/D68910
* Don't assume that __cxa_current_exception_type exists.Jim Ingham2019-11-011-0/+3
| | | | | | | | | Normally you shouldn't be able to have a process with an ItaniumABI plugin that doesn't have this symbol. But if the loader crashes before loading libc++abi.dylib (on MacOS), then the symbol might not be present. So we should check before accessing the pointer. There isn't a good way to write a test for this, but the change is obvious.
* Reapply [LLDB] [test] Use %clang_cl instead of build.py in a few testsMartin Storsjö2019-11-012-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows explicitly specifying the intended target architecture, for tests that aren't supposed to be executed, and that don't require MSVC headers or libraries to be available. (These tests already implicitly assumed to be built for x86; one didn't specify anything, assuming x86_64, while the other specified --arch=32, which only picks the 32 bit variant of the default target architecture). Join two comment lines in disassembly.cpp, to keep row numbers checked in the test unchanged. This fixes running check-lldb on arm linux. Previously when this was applied (in 95980409e6), it broke macos buildbots, as they added "-isysroot <path>" to all %clang* substitutions, and clang-cl didn't support that. Reapplying it without further changes to this patch, after D69619 (9c73925226), because now, such extra parameters are added to %clang_host*, but not to plain %clang_cl. Differential Revision: https://reviews.llvm.org/D69031
* Fix typeo in CPU_TYPE_ARM64_32 for older SDKs.Jason Molenda2019-10-311-1/+1
|
* [Symbol] Change ClangASTContext::GetCXXClassName return typeAlex Langford2019-10-313-22/+20
| | | | | | | | | Summary: Instead of filling out a std::string and returning a bool to indicate success, returning a std::string directly and testing to see if it's empty seems like a cleaner solution overall. Differential Revision: https://reviews.llvm.org/D69641
* [lldb] [test/API] Fix testcases symlinkMichał Górny2019-10-311-1/+1
|
* Upstream diff from swift-lldb.Adrian Prantl2019-10-311-1/+1
| | | | This is very likely untested, but it looks like an obviously correct change.
* minidump: Create memory regions from the sections of loaded modulesPavel Labath2019-10-314-19/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Not all minidumps contain information about memory permissions. However, it is still important to know which regions of memory contain potentially executable code. This is particularly important for unwinding on win32, as the default unwind method there relies on scanning the stack for things which "look like" code pointers. This patch enables ProcessMinidump to reconstruct the likely permissions of memory regions using the sections of loaded object files. It only does this if we don't have a better source (memory info list stream, or linux /proc/maps) for this information, and only if the information in the object files does not conflict with the information in the minidump. Theoretically that last bit could be improved, since the permissions obtained from the MemoryList streams is also only a very rough guess, but it did not seem worthwhile to complicate the implementation because of that because there will generally be no overlap in practice as the MemoryList will contain the stack contents and not any module data. The patch adds a test checking that the module section permissions are entered into the memory region list, and also a test which demonstrate that now the unwinder is able to correctly find return addresses even in minidumps without memory info list streams. There's one TODO left in this patch, which is that the "memory region" output does not give any indication about the "don't know" values of memory region permissions (it just prints them as if they permission bit was set). I address this in a follow up. Reviewers: amccarth, clayborg Subscribers: mgrang, lldb-commits Differential Revision: https://reviews.llvm.org/D69105
* [lldb] Fix offset intersection bug between MPX and AVX registersGuilherme Andrade2019-10-318-4/+103
| | | | | | | | | | | | | | | | | Summary: This change increases the offset of MPX registers (by 128) so they do not overlap with the offset associated with AVX registers. That was causing MPX data in GDBRemoteRegisterContext::m_reg_data to get overwritten. Reviewers: labath Reviewed By: labath Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68874
* [lldb/lit] Introduce %clang_host substitutionsPavel Labath2019-10-3160-69/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch addresses an ambiguity in how our existing tests invoke the compiler. Roughly two thirds of our current "shell" tests invoke the compiler to build the executables for the host. However, there is also a significant number of tests which don't build a host binary (because they don't need to run it) and instead they hardcode a certain target. We also have code which adds a bunch of default arguments to the %clang substitutions. However, most of these arguments only really make sense for the host compilation. So far, this has worked mostly ok, because the arguments we were adding were not conflicting with the target-hardcoding tests (though they did provoke an occasional "argument unused" warning). However, this started to break down when we wanted to use target-hardcoding clang-cl tests (D69031) because clang-cl has a substantially different command line, and it was getting very confused by some of the arguments we were adding on non-windows hosts. This patch avoid this problem by creating separate %clang(xx,_cl)_host substutitions, which are specifically meant to be used for compiling host binaries. All funny host-specific options are moved there. To ensure that the regular %clang substitutions are not used for compiling host binaries (skipping the extra arguments) I employ a little hac^H^H^Htrick -- I add an invalid --target argument to the %clang substitution, which means that one has to use an explicit --target in order for the compilation to succeed. Reviewers: JDevlieghere, aprantl, mstorsjo, espindola Subscribers: emaste, arichardson, MaskRay, jfb, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69619
* [LLDB] [Windows] Fix Windows-specific race condition in LLDB for session ↵Martin Storsjö2019-10-314-10/+95
| | | | | | | | | | | | | | | lifetime This can e.g. happen if the debugged executable exits before the initial stop, e.g. if it fails to load dependent DLLs. Add a virtual destructor to ProcessDebugger and let it clean up the session, and make ProcessWindows::OnExitProcess call ProcessDebugger::OnExitProcess for shared parts. Fix suggestion by Adrian McCarthy. Differential Revision: https://reviews.llvm.org/D69503
* [LLDB] [PECOFF] Fix error handling for executables that object::createBinary ↵Martin Storsjö2019-10-312-6/+90
| | | | | | | | | | | | | | errors out on llvm::object::createBinary returns an Expected<>, which requires not only checking the object for success, but also requires consuming the Error, if one was set. Use LLDB_LOG_ERROR for this case, and change an existing similar log statement to use it as well, to make sure the Error is consumed even if the log channel is disabled. Differential Revision: https://reviews.llvm.org/D69646
* [LLDB] [Windows] Remove a TODO which probably won't be implementedMartin Storsjö2019-10-311-2/+0
| | | | | | | | | | | | | Contrary to WoW64 on x86_64, there's no struct similar to WOW64_CONTEXT defined, for storing and handling the CPU state of an ARM32 process from an ARM64 process. Thus, making an ARM64 lldb-server able to control ARM32 processes seems infeasible at the moment. (The normal CONTEXT struct has a different layout on each architecture. In addition to this, a WOW64_CONTEXT struct always is defined, that can store the CPU state of an x86_32 process, to allow handling it from an x86_64 process. But there's no similar universally available struct for ARM32.)
* [LLDB] [PECOFF] Don't crash in ReadImageDataByRVA for addresses out of rangeMartin Storsjö2019-10-314-1/+133
| | | | | | This can happen e.g. when unwinding doesn't work perfectly. Differential Revision: https://reviews.llvm.org/D69502
* Only ask once if we have no commands. NFC.Jim Ingham2019-10-301-7/+5
|
* Run clang-format on lldb/source/Commands (NFC)Adrian Prantl2019-10-3023-443/+385
| | | | | These files had a lot of whitespace errors in them which was a constant source of merge conflicts downstream.
* DebugServer: be more lenient about the target tripleSaleem Abdulrasool2019-10-301-1/+5
| | | | | | | When building standalone, `LLVM_DEFAULT_TARGET_TRIPLE` may be undefined. Matching against an empty string does not work as desired in CMake, so, fallback to the old behaviour, defaulting `LLDB_DEBUGSERVER_ARCH` to `CMAKE_OSX_ARCHITECTURES`.
* [LLDB][Python] warning fix for LLDBSwigPythonBreakpointCallbackFunctionLawrence D'Anna2019-10-301-0/+5
| | | | | | | | | | | | | | | | | | This is a quick followup to this commit: https://reviews.llvm.org/rGa69bbe02a2352271e8b14542073f177e24c499c1 In that, I #pragma-squelch this warning in `ScriptInterpreterPython.cpp` but we get the same warning in `PythonTestSuite.cpp`. This patch squelches the same warning in the same way as the reviweed commit. I'm submitting it without review under the "obviously correct" rule. At least if this is incorrect the main commit was also incorrect. By the way, as far as I can tell, these functions are extern "C" because SWIG does that to everything, not because they particularly need to be.
* [LLDB][PythonFile] fix dangerous borrow semantics on python2Lawrence D'Anna2019-10-302-17/+15
| | | | | | | | | | | | | | | | | | | | Summary: It is inherently unsafe to allow a python program to manipulate borrowed memory from a python object's destructor. It would be nice to flush a borrowed file when python is finished with it, but it's not safe to do on python 2. Python 3 does not suffer from this issue. Reviewers: labath, mgorny Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69532
* minidump: Rename some architecture constantsPavel Labath2019-10-305-5/+5
| | | | | | | | | | | | | | | | | | | | | The architecture enum contains two kinds of contstants: the "official" ones defined by Microsoft, and unofficial constants added by breakpad to cover the architectures not described by the first ones. Up until now, there was no big need to differentiate between the two. However, now that Microsoft has defined https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info a constant for ARM64, we have a name clash. This patch renames all breakpad-defined constants with to include the prefix "BP_". This frees up the name "ARM64", which I'll re-introduce with the new "official" value in a follow-up patch. Reviewers: amccarth, clayborg Subscribers: lldb-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D69285
* lldb-vscode: Add a forgotten cast to voidPavel Labath2019-10-301-0/+1
| | | | "git push" works even with a dirty working tree. :/
* [lldb-vscod] fix build with NDEBUG on windowsSquallATF2019-10-301-3/+4
| | | | | | | | | | | | | | Summary: _setmode in assert will not run when build with NDEBUG Reviewers: mstorsjo, labath, amccarth Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69612
* COFF: Set section permissionsPavel Labath2019-10-302-3/+13
| | | | | | | | | | | | Summary: This enables us to reason about whether a given address can be executable, for instance during unwinding. Reviewers: amccarth, mstorsjo Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D69102
* [lldb] [test] Mark TestCustomShell XFAIL on *bsd as wellMichał Górny2019-10-301-1/+4
| | | | | All *BSD targets do not implement ShellExpandArguments, so mark the test appropriately.
* [lldbsuite] Remove unused test_event filesJonas Devlieghere2019-10-295-451/+0
| | | | | These files don't appear to be used anywhere and the corresponding tests are not run.
* [lldbsuite] Remove the DumpFormatterJonas Devlieghere2019-10-291-22/+0
| | | | This formatter is never used or referenced.
* [lldbsuite] Remove pre_kill_hook packageJonas Devlieghere2019-10-297-418/+0
| | | | This package was only used by dosep.py which has since been removed.
* [lldbsuite] Remove unused support filesJonas Devlieghere2019-10-292-87/+0
| | | | | To the best of my understanding these files or their content is nowhere referenced.
* [LLDB][breakpoints] ArgInfo::count -> ArgInfo::max_positional_argsLawrence D'Anna2019-10-296-68/+84
| | | | | | | | | | | | | | | | | | | | Summary: Move breakpoints from the old, bad ArgInfo::count to the new, better ArgInfo::max_positional_args. Soon ArgInfo::count will be no more. It looks like this functionality is already well tested by `TestBreakpointCommandsFromPython.py`, so there's no need to write additional tests for it. Reviewers: labath, jingham, JDevlieghere Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69468
* [ValueObjectDisplay] Generalize the description of an option.Davide Italiano2019-10-291-1/+1
|
* [LLDB] Fix for windows bots broken by unsupported testsshafik2019-10-292-0/+4
|
* [LLDB][Python] fix another fflush issue on NetBSDLawrence D'Anna2019-10-294-16/+26
| | | | | | | | | | | | | | | | Summary: Here's another instance where we were calling fflush on an input stream, which is illegal on NetBSD. Reviewers: labath, mgorny Reviewed By: mgorny Subscribers: krytarowski, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69488
* build: make standalone builds work againSaleem Abdulrasool2019-10-291-0/+4
| | | | | | | Apple's greendragon bot uses a standalone build of lldb which would fail to build after a recent change to LLVM as it relied on LLVM setting global flags for its build. Attempt to repair the standalone build for greendragon bot.
* build: workaround stale caches (NFC)Saleem Abdulrasool2019-10-291-1/+1
| | | | | | | | `LLVM_DEFAULT_TARGET_TRIPLE` is a cached variable, which means that it may actually be unset. Furthermore, in standalone builds, the variable may be fully undefined. Apply the regular expression over the empty string in such a case. This should improve the state of the green dragon bot.
* [lldb][NFC] Make LLVMUserExpression::DoExecute return earlyRaphael Isemann2019-10-291-144/+142
| | | | The giant if-else isn't conforming to LLVM code style.
* [LLDB] [PECOFF] Use FindSectionByID to associate symbols to sectionsMartin Storsjö2019-10-292-1/+117
| | | | | | | | The virtual container/header section caused the section list to be offset by one, but by using FindSectionByID, the layout of the section list shouldn't matter. Differential Revision: https://reviews.llvm.org/D69366
* [lldb] move package generation from python to cmakeHaibo Huang2019-10-287-1124/+61
| | | | | | | | | | Summary: This is the last part. And we can remove the python script. Subscribers: lldb-commits, mgorny Tags: #lldb Differential Revision: https://reviews.llvm.org/D69019
* Modernize TestThreadStepOut.pyJim Ingham2019-10-282-51/+37
| | | | | | | | This test was timing out on the swift CI bots. I didn't see any obvious reason for that, and the test hasn't had problems on greendragon. OTOH, it was a bit oddly written, and needed modernizing, so I did that. Differential Revision: https://reviews.llvm.org/D69453
* [debugserver] Detect arch from LLVM_DEFAULT_TARGET_TRIPLEVedant Kumar2019-10-281-3/+17
| | | | | | | | | | | | | | | | The debugserver build needs to conditionally include files depending on the target architecture. Switch on the architecture specified by LLVM_DEFAULT_TARGET_TRIPLE, as the llvm and swift build systems use this variable to identify the target (the latter, indirectly, through LLVM_HOST_TRIPLE). It would be possible to switch on CMAKE_OSX_ARCHITECTURES, but the swift build does not provide it, preferring instead to pass arch-specific CFLAGS etc explicitly. Switching on LLVM_HOST_TRIPLE is also an option, but it breaks down when cross-compiling. Differential Revision: https://reviews.llvm.org/D69523
* [Docs] Repurpose 'sources' page as 'contributing'.Jonas Devlieghere2019-10-284-21/+36
| | | | | | The page describing how to get the sources was more about contributing to LLDB than getting the actual source. This patch moves some things around and repurposes this page as a contributing to LLDB landing page.
* Add support for DW_AT_export_symbols for anonymous structsshafik2019-10-288-14/+122
| | | | | | | | | Summary: We add support for DW_AT_export_symbols to detect anonymous struct on top of the heuristics implemented in D66175 This should allow us to differentiate anonymous structs and unnamed structs. We also fix TestTypeList.py which was incorrectly detecting an unnamed struct as an anonymous struct. Differential Revision: https://reviews.llvm.org/D68961
* [LLDB] Remove incorrect dotest.py invocationJonas Devlieghere2019-10-281-16/+0
| | | | | | | | | | | | | | The invocation shown by dotest.py to re-run a single test is misleading: it ranges from missing arguments (best case scenario) to being totally wrong (worst case scenario). In the past I've tried to get it right, but given the dotest architecture this is harder than it looks. Furthermore, we have pretty good documentation on the website [1] for most use cases. This patch removes the rerun invocation. [1] https://lldb.llvm.org/resources/test.html
* [Docs] Update source code link to GithubJonas Devlieghere2019-10-281-1/+1
|
* [Docs] Disable Python docs when LLDB_DISABLE_PYTHON is setJonas Devlieghere2019-10-281-34/+36
| | | | | | | This leads to a configuration error because we're trying to get a property that doesn't exist: get_target_property() called with non-existent target "swig_wrapper"
OpenPOWER on IntegriCloud