summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[LLDB] Use the llvm microsoft demangler instead of the windows ↵Martin Storsjo2019-09-281-3/+41
| | | | | | | | | dbghelp api. NFC." This reverts SVN r373144, as it changed the demangled output a little, see http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/9306. llvm-svn: 373146
* [LLDB] Use the llvm microsoft demangler instead of the windows dbghelp api. NFC.Martin Storsjo2019-09-281-41/+3
| | | | | | | | | If there's any testcases that only do demangling (I didn't find any), they could be made available for all platforms now. Differential Revision: https://reviews.llvm.org/D68134 llvm-svn: 373144
* Give an error when StepUsingScriptedThreadPlan is passed a bad classname.Jim Ingham2019-09-288-9/+43
| | | | | | Differential Revision: https://reviews.llvm.org/D68173 llvm-svn: 373135
* [Core] Remove unused dependency on clangASTAlex Langford2019-09-282-4/+0
| | | | llvm-svn: 373134
* [debugserver] Add --version/-V command line option to debugserver.Jonas Devlieghere2019-09-271-0/+11
| | | | | | | | | | | When not running under a TTY the output is buffered and not flushed before debugserver exits which makes it impossible to parse the version string. This adds a -V/--version command that just prints the version to stdout and exits with an exit code zero. Differential revision: https://reviews.llvm.org/D68156 llvm-svn: 373127
* refactor: move IOObject::m_should_close_fd into subclassesLawrence D'Anna2019-09-275-19/+20
| | | | | | | | | | | | | | | | | | Summary: m_should_close_fd doesn't need to be in IOObject. It will be useful for my next change to move it down into File and Socket. Reviewers: labath, JDevlieghere, jasonmolenda Reviewed By: JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68152 llvm-svn: 373126
* [Reproducer] Use // in the unit testsJonas Devlieghere2019-09-271-13/+13
| | | | | | This should be a valid absolute path on both POSIX and Windows. llvm-svn: 373124
* [Reproducer] Update the unit tests to specify the path style.Jonas Devlieghere2019-09-271-17/+33
| | | | | | | The unit tests started failing on Windows after my recent patch that ensured we always deal with absolute paths. This should fix that. llvm-svn: 373114
* [CMake] Depend on clang-tablegen-targetsJonas Devlieghere2019-09-271-1/+1
| | | | | | | | The ClangDriverOptions target is not available for standalone builds. Thanks Alex for pointing this out! llvm-svn: 373112
* Revert: [lldb] [testsuite] Remove redundant MAKE_DSYM := NOJan Kratochvil2019-09-2717-0/+22
| | | | | | | | | | Revert: llvm-svn: 373061 It broke OSX testsuite: https://reviews.llvm.org/D67589#1686150 lldb/packages/Python/lldbsuite/test/macosx/function-starts/TestFunctionStarts.py llvm-svn: 373110
* [CMake] Make Core depend on ClangDriverOptions (NFC)Jonas Devlieghere2019-09-271-0/+3
| | | | | | | | ModuleList.cpp includes clang/Driver/Driver.h which depends on clang/Driver/Options.inc. This patch adds the corresponding TableGen target to Core. llvm-svn: 373105
* [Reproducer] Always use absolute paths for capture & replay.Jonas Devlieghere2019-09-273-4/+21
| | | | | | | | | | | The VFS requires files to be have absolute paths. The file collector makes paths relative to the reproducer root. If the root is a relative path, this would trigger an assert in the VFS. This patch ensures that we always make the given path absolute. Thank you Ted Woodward for pointing this out! llvm-svn: 373102
* remove File::SetStream(), make new files instead.Lawrence D'Anna2019-09-2728-255/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch removes File::SetStream() and File::SetDescriptor(), and replaces most direct uses of File with pointers to File. Instead of calling SetStream() on a file, we make a new file and replace it. My ultimate goal here is to introduce a new API class SBFile, which has full support for python io.IOStream file objects. These can redirect read() and write() to python code, so lldb::Files will need a way to dispatch those methods. Additionally it will need some form of sharing and assigning files, as a SBFile will be passed in and assigned to the main IO streams of the debugger. In my prototype patch queue, I make File itself copyable and add a secondary class FileOps to manage the sharing and dispatch. In that case SBFile was a unique_ptr<File>. (here: https://github.com/smoofra/llvm-project/tree/files) However in review, Pavel Labath suggested that it be shared_ptr instead. (here: https://reviews.llvm.org/D67793) In order for SBFile to use shared_ptr<File>, everything else should as well. If this patch is accepted, I will make SBFile use a shared_ptr I will remove FileOps from future patches and use subclasses of File instead. Reviewers: JDevlieghere, jasonmolenda, zturner, jingham, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67891 llvm-svn: 373090
* [lldb] Disable testing entry values as memory locationDjordje Todorovic2019-09-271-0/+3
| | | | | | The D67717 excludes such locations for now. llvm-svn: 373074
* [lldb/cmake] add lldbCore -> clangDriver dependencyPavel Labath2019-09-271-0/+1
| | | | | | | | ModuleList.cpp includes clang/Driver/Driver.h. Reflect that in the build system. Not having this can cause build failures if ModuleList.cpp is built before Driver.inc is generated. llvm-svn: 373073
* Unwind: Add a stack scanning mechanism to support win32 unwindingPavel Labath2019-09-2710-12/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Windows unwinding is weird. The unwind rules do not (always) describe the precise layout of the stack, but rather expect the debugger to scan the stack for something which looks like a plausible return address, and the unwind based on that. The reason this works somewhat reliably is because the the unwinder also has access to the frame sizes of the functions on the stack. This allows it (in most cases) to skip function pointers in local variables or function arguments, which could otherwise be mistaken for return addresses. Implementing this kind of unwind mechanism in lldb was a bit challenging because we expect to be able to statically describe (in the UnwindPlan) structure, the layout of the stack for any given instruction. Giving a precise desription of this is not possible, because it requires correlating information from two functions -- the pushed arguments to a function are considered a part of the callers stack frame, and their size needs to be considered when unwinding the caller, but they are only present in the unwind entry of the callee. The callee may end up being in a completely different module, or it may not even be possible to determine it statically (indirect calls). This patch implements this functionality by introducing a couple of new APIs: SymbolFile::GetParameterStackSize - return the amount of stack space taken up by parameters of this function. SymbolFile::GetOwnFrameSize - the size of this function's frame. This excludes the parameters, but includes stuff like local variables and spilled registers. These functions are then used by the unwinder to compute the estimated location of the return address. This address is not always exact, because the stack may contain some additional values -- for instance, if we're getting ready to call a function then the stack will also contain partially set up arguments, but we will not know their size because we haven't called the function yet. For this reason the unwinder will crawl up the stack from the return address position, and look for something that looks like a possible return address. Currently, we assume that something is a valid return address if it ends up pointing to an executable section. All of this logic kicks in when the UnwindPlan sets the value of CFA as "isHeuristicallyDetected", which is also the final new API here. Right now, only SymbolFileBreakpad implements these APIs, but in the future SymbolFilePDB will use them too. Differential Revision: https://reviews.llvm.org/D66638 llvm-svn: 373072
* Disable the empty string check in TestDataFormatterStdStringPavel Labath2019-09-271-1/+2
| | | | | | | This check was failing since it was added in r372837. It should be possible to re-enable it once D68010 lands. llvm-svn: 373071
* Fix some swig warningsPavel Labath2019-09-275-21/+3
| | | | | | | | | Previously, these were unseen because the wrapper script would swallow them. This fixes the following types of warnings: - methods being declared more than once - swig complained about ignoring operator=, so I just removed it llvm-svn: 373069
* [lldb] [testsuite] Remove redundant MAKE_DSYM := NOJan Kratochvil2019-09-2717-22/+0
| | | | | | | According to a comment by Pavel Labath: https://reviews.llvm.org/D67589#inline-612375 llvm-svn: 373061
* [lldb] Print an error message for an empty subcommandRaphael Isemann2019-09-272-3/+4
| | | | llvm-svn: 373053
* [lldb][NFC] Actually test which method we call in TestCallOverriddenMethodRaphael Isemann2019-09-272-4/+8
| | | | llvm-svn: 373051
* [lldb][NFC] Test CommandObjectMultiword functionalityRaphael Isemann2019-09-271-0/+34
| | | | | | | | A lot of commands are made up of CommandObjectMultiword with subcommands. CommandObjectMultiword actually has some functionality on its own that wasn't tested before. llvm-svn: 373050
* [lldb-vscode] correctly handle multiple sourceMap entriesAlex Langford2019-09-261-2/+2
| | | | | | | | | | | | | | Summary: `lldb-vscode` concatenates a string of sourceMap entries specified in the config, but fails to put a space between each entry, which causes the settings command to fail. This patch adds a space between each mapping. Patch by Richard Howell Differential Revision: https://reviews.llvm.org/D67569 llvm-svn: 373016
* Convert FileSystem::Open() to return Expected<FileUP>Lawrence D'Anna2019-09-2626-208/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch converts FileSystem::Open from this prototype: Status Open(File &File, const FileSpec &file_spec, ...); to this one: llvm::Expected<std::unique_ptr<File>> Open(const FileSpec &file_spec, ...); This is beneficial on its own, as llvm::Expected is a more modern and recommended error type than Status. It is also a necessary step towards https://reviews.llvm.org/D67891, and further developments for lldb_private::File. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67996 llvm-svn: 373003
* SystemInitializer: Define macros for experimental targets tooPavel Labath2019-09-262-0/+4
| | | | llvm-svn: 372998
* [lldb] Code cleanup: Simplify SBCommandReturnObjectJan Kratochvil2019-09-262-84/+51
| | | | | | | | | | | | A simplification for D67589. m_opaque_up can never be nullptr (unless one calls a ctor with nullptr or one uses SetLLDBObjectPtr with nullptr). Also protected SetLLDBObjectPtr is not used anywhere (I haven't found it would ever be used). Differential revision: https://reviews.llvm.org/D68083 llvm-svn: 372976
* [lldb][modern-type-lookup] Fix crash when activating modern-type-lookup on LinuxRaphael Isemann2019-09-261-2/+1
| | | | | | | There is no ClangModulesDeclVendor on Linux so that cast is triggering an assert. Let's just remove it as it just casts the type to itself. llvm-svn: 372974
* [lldb][www] Update bot linksRaphael Isemann2019-09-261-2/+2
| | | | llvm-svn: 372971
* [lldb][modern-type-lookup] Add test for using the ClangModulesDeclVendorRaphael Isemann2019-09-263-0/+36
| | | | llvm-svn: 372965
* Don't stop execution in batch mode when process stops with SIGINT or SIGSTOPTatyana Krasnukha2019-09-266-70/+91
| | | | | | | | Summary: Usually, SIGINT and SIGSTOP don't imply a crash, e.g. SIGSTOP is sent on process launch and attach on some platforms. Differential Revision: https://reviews.llvm.org/D67776 llvm-svn: 372961
* SystemInitializer: Use Targets.def to selectively initialize ABI pluginsPavel Labath2019-09-264-122/+68
| | | | | | | | | | | This avoids having to define additional macros in the cmake file, and and also makes the logic in the cpp files more compact. It is also easily extendible to other plugin types (instruction emulation?) that should only be initialized if the corresponding llvm target is built. Thanks to Ilya Birukov for pointing me to this file. llvm-svn: 372952
* [lldb][NFC] Use AppendEmptyArgument in CompletionRequest constructorRaphael Isemann2019-09-261-7/+3
| | | | | | | | We now have a utility function for this purpose. (Also fixing the typo in the related comment while I'm at it.) llvm-svn: 372946
* [Dwarf] Fix switch cases that take an dw_tag_t.Jonas Devlieghere2019-09-253-0/+10
| | | | | | Now that dw_tag_t is an enum, a default case is required. llvm-svn: 372920
* [lit] Do a better job at parsing unsupported tests.Jonas Devlieghere2019-09-251-0/+5
| | | | | | | | | | | | | When all the tests run by dotest are unsupported, it still reports RESULT: PASSED which we translate to success for lit. We can better report the status as unsupported when we see that there are unsupported tests but no passing tests. This will not affect the situation where there are failures or unexpected passes, because those report a non-zero exit code. Differential revision: https://reviews.llvm.org/D68039 llvm-svn: 372914
* [lldb] Excludes private headers from SWIG dependency.Haibo Huang2019-09-251-0/+6
| | | | | | | | | | | | Reviewers: xiaobai Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68040 llvm-svn: 372905
* [Mangle] Add flag to asm labels to disable '\01' prefixingVedant Kumar2019-09-251-2/+2
| | | | | | | | | | | | | | LLDB synthesizes decls using asm labels. These decls cannot have a mangle different than the one specified in the label name. I.e., the '\01' prefix should not be added. Fixes an expression evaluation failure in lldb's TestVirtual.py on iOS. rdar://45827323 Differential Revision: https://reviews.llvm.org/D67774 llvm-svn: 372903
* [CMake] Add the system debugserver to lldb-test-deps.Jonas Devlieghere2019-09-251-0/+1
| | | | | | | When using the system debugserver we create a target to copy it over. This target has to be added to lldb-test-deps. llvm-svn: 372901
* [CMake] Run the lldb-server tests with system debugserver.Jonas Devlieghere2019-09-251-1/+1
| | | | | | | Now that we no longer build debugserver when LLDB_USE_SYSTEM_DEBUGSERVER is set, we have to change the logic for testing lldb-server. llvm-svn: 372900
* [lldb] Move swig call from python code to cmakeHaibo Huang2019-09-253-629/+24
| | | | | | | | | | | | | | Summary: Elimiates lots of unused code. Reviewers: labath, mgorny Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68007 llvm-svn: 372895
* [Docs] Document forwarding arguments with litJonas Devlieghere2019-09-251-0/+8
| | | | | | Explain how to forward arguments to dotest.py from lit. llvm-svn: 372894
* [Dwarf] Make dw_tag_t a typedef for llvm::dwarf::Tag instead of uint16_t.Jonas Devlieghere2019-09-257-11/+13
| | | | | | | | | | | | Currently dw_tag_t is a typedef for uint16_t. This patch changes makes dw_tag_t a typedef for llvm::dwarf::Tag. This enables us to use the full power of the DWARF utilities in LLVM without having to do the cast every time. With this approach, we only have to do the cast when reading the ULEB value. Differential revision: https://reviews.llvm.org/D68005 llvm-svn: 372891
* Modernize Makefile.Adrian Prantl2019-09-251-1/+1
| | | | llvm-svn: 372890
* [lldb][modern-type-lookup] Add two basic tests for modern-type-lookupRaphael Isemann2019-09-256-0/+69
| | | | | | | | | | | | | | | | | | The story so far: LLDB's modern type lookup mode has no (as in, 0%) test coverage. It was supposed to be tested by hardcoding the default to 'true' and then running the normal LLDB tests, but to my knowledge no one is doing that. As a around 130 tests seem to fail with this mode enabled, we also can't just enable it globally for now. As we touch the surrounding code all the time and also want to refactor parts of it, we should be a bit more ambitious with our testing efforts. So this patch adds two basic tests that enable this mode and do some basic expression parsing which should hopefully be basic enough to not break anywhere but still lets us know if this mode works at all (i.e. setting up the ExternalASTMerger in LLDB, using its basic import functionality to move declarations around and do some lookups). llvm-svn: 372869
* Have ABI plugins vend llvm MCRegisterInfo dataPavel Labath2019-09-2535-76/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I was recently surprised to learn that there is a total of 2 (two) users of the register info definitions contained in the ABI plugins. Yet, the defitions themselves span nearly 10kLOC. The two users are: - dwarf expression pretty printer - the mechanism for augmenting the register info definitions obtained over gdb-remote protocol (AugmentRegisterInfoViaABI) Both of these uses need the DWARF an EH register numbers, which is information that is already available in LLVM. This patch makes it possible to do so. It adds a GetMCRegisterInfo method to the ABI class, which every class is expected to implement. Normally, it should be sufficient to obtain the definitions from the appropriate llvm::Target object (for which I provide a utility function), but the subclasses are free to construct it in any way they deem fit. We should be able to always get the MCRegisterInfo object from llvm, with one important exception: if the relevant llvm target was disabled at compile time. To handle this, I add a mechanism to disable the compilation of ABI plugins based on the value of LLVM_TARGETS_TO_BUILD cmake setting. This ensures all our existing are able to create their MCRegisterInfo objects. The new MCRegisterInfo api is not used yet, but the intention is to make use of it in follow-up patches. Reviewers: jasonmolenda, aprantl, JDevlieghere, tatyana-krasnukha Subscribers: wuzish, nemanjai, mgorny, kbarton, atanasyan, lldb-commits Differential Revision: https://reviews.llvm.org/D67965 llvm-svn: 372862
* [lldb][NFC] Remove CompletionRequest::GetCursorArgument and ↵Raphael Isemann2019-09-253-11/+4
| | | | | | | | | | GetRawLineUntilCursor They both return the same result as another function (GetCursorArgumentPrefix and GetRawLine). They were only added because the old API allowed to look (in theory) behind the cursor position which is no longer possible. llvm-svn: 372861
* [lldb][NFC] Add CompletionRequest::AppendEmptyArgumentRaphael Isemann2019-09-254-21/+14
| | | | | | | | | This is the only legitimate use we currently have for modifying a CompletionRequest. Add a utility function for this purpose and remove the remaining setters which go against the idea of having an immutable CompletionRequest. llvm-svn: 372858
* [lldb][NFC] Remove useless cursor shifting in Options::HandleOptionCompletionRaphael Isemann2019-09-251-4/+1
| | | | | | | | The cursor position is always at the end of the current argument (as the argument cut off after the cursor position). So this code is a no-op and can be removed. llvm-svn: 372851
* Revert r372788 "Host: use the platform identifiers from LLVM (NFC)"Hans Wennborg2019-09-251-5/+4
| | | | | | | | | | | | | | | | > Use symbolic constants for the platform identifiers rather than replicating them > locally. This broke the build of LLDB on Windows, see http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/9182 which fails with e.g. E:\build_slave\lldb-x64-windows-ninja\llvm\include\llvm/BinaryFormat/COFF.h(96): error C2059: syntax error: 'constant' E:\build_slave\lldb-x64-windows-ninja\llvm\include\llvm/BinaryFormat/COFF.h(96): error C3805: 'constant': unexpected token, expected either '}' or a ',' E:\build_slave\lldb-x64-windows-ninja\llvm\include\llvm/BinaryFormat/COFF.h(128): error C2059: syntax error: 'constant' ... llvm-svn: 372847
* [lldb] [test] Add NetBSD to XFAIL list for thread_local testMichal Gorny2019-09-251-1/+2
| | | | llvm-svn: 372840
* [lldb] Test data formatters for empty stringsRaphael Isemann2019-09-254-1/+18
| | | | llvm-svn: 372837
OpenPOWER on IntegriCloud