summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Breakpad: Match the new UUID algorithm in minidumpsPavel Labath2019-04-168-32/+101
| | | | | | | | | | | | | | | D59433 and D60501 changed the way UUIDs are computed from minidump files. This was done to synchronize the U(G)UID representation with the native tools of given platforms, but it created a mismatch between minidumps and breakpad files. This updates the breakpad algorithm to match the one found in minidumps, and also adds a couple of tests which should fail if these two ever get out of sync. Incidentally, this means that the module id in the breakpad files is almost identical to our notion of UUIDs, so the computation algorithm can be somewhat simplified. llvm-svn: 358500
* test/PECOFF: Remove REQUIRES: system-windowsPavel Labath2019-04-162-2/+2
| | | | | | | These tests run fine on non-windows platforms too. Instead I add REQUIRES: lld, as that is what they really require. llvm-svn: 358499
* Fix typo in ArmUnwindInfo::GetUnwindPlanRaphael Isemann2019-04-161-1/+1
| | | | | | | | | | | | | | | | | | | Summary: As reported in LLVM bug 41486, the check `(byte1 & 0xf8) == 0xc0` is wrong. We want to check for `11010nnn`, so the proper value we want to compare against is `0xd0` (`0xc0` would check for the value `11000nnn` which we already checked for above as described in the bug report). Reviewers: #lldb, jasonmolenda Reviewed By: #lldb, jasonmolenda Subscribers: jasonmolenda, javed.absar, kristof.beyls, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D60655 llvm-svn: 358479
* Correctly check if a warning message lacks a trailing new lineRaphael Isemann2019-04-161-3/+3
| | | | | | | | | | | | | | | | Summary: Fixes LLVM bug 41489. Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D60653 llvm-svn: 358477
* [ASTImporter] Regression test to ensure that we handling importing of ↵Shafik Yaghmour2019-04-153-0/+36
| | | | | | | | | | | | | anonymous enums correctly Summary: https://reviews.llvm.org/D51633 added error handling in the ASTImporter.cpp which uncovered an underlying bug in which we used the wrong name when handling naming conflicts. This could cause a segmentation fault when attempting to cast an int to an enum during expression parsing. This test should pass once https://reviews.llvm.org/D59665 is committed. Differential Revision: https://reviews.llvm.org/D59667 llvm-svn: 358462
* Prevent unnecessary conversion from StringRef to C-string [NFC]Raphael Isemann2019-04-141-1/+1
| | | | | | | | | There is an alternative method to GetConstCStringWithLength that takes a StringRef. GetConstCStringWithLength also calls this method in the end, so directly calling the StringRef saves us from a unnecessary conversion to a C-string. llvm-svn: 358357
* [lldb] [lit/SymbolFile] Avoid -nostdlib in target-symbols-add-unwind.testMichal Gorny2019-04-132-6/+6
| | | | | | | | | | | | | Do not use -nostdlib in target-symbols-add-unwind.test. NetBSD uses startup files to provide obligatory ELF notes in executables, and therefore using -nostdlib requires providing specially tailored input. Otherwise, kernel rejects the result as invalid executable. The replacement was suggested by Pavel Labath. Differential Revision: https://reviews.llvm.org/D60648 llvm-svn: 358329
* Fix compiler warning introduced by r358261Pavel Labath2019-04-121-0/+2
| | | | | | Add a virtual destructor to the class with virtual methods. llvm-svn: 358284
* Make TestPrintStackTraces deterministicPavel Labath2019-04-122-158/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This test contained an incredibly complicated inferior, but in reality, all it was testing was that we can backtrace up to main and see main's arguments. However, the way this was implemented (setting a breakpoint on a separate thread) meant that each time the test would run, it would stop in a different location on the main thread. Most of the time this location would be deep in some libc function, which meant that the success of this test depended on our ability to backtrace out of a random function of the c library that the user happens to have installed. This makes the test unpredictable. Backtracing out of a libc function is an important functionality, but this is not the way to test it. Often it is not even our fault that we cannot backtrace out because the C library contains a lot of assembly routines that may not have correct unwind info associated with them. For this reason the test has accumulated numerous @expectedFail/Flaky decorators. In this patch, I replace the inferior with one that does not depend on libc functions. Instead I create a couple of stack frames of user code, and have the test verify that. I also simplify the test by using lldbutil.run_to_source_breakpoint. llvm-svn: 358266
* [lldb-server] Update tests to use std::thread/mutex for all platformsAaron Smith2019-04-121-86/+81
| | | | | | | | | | | | | | | | | | Summary: Some cleanup suggested when bringing up lldb-server on Windows. Thanks to Hui Huang for the patch. Reviewers: zturner, labath, jfb, Hui Reviewed By: labath Subscribers: clayborg, dexonsmith, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D60496 llvm-svn: 358265
* PDBFPO: Improvements to the AST visitorPavel Labath2019-04-121-138/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch attempts to solve two issues made this code hard to follow for me. The first issue was that a lot of what these visitors do is mutate the AST. The visitor pattern is not particularly good for that because by the time you have performed the dynamic type dispatch, it's too late to go back to the parent node, and change its pointer. The previous code dealt with that relatively elegantly, but it still meant that one had to perform manual type checks, which is what the visitor pattern is supposed to avoid. The second issue was not being able to return values from the Visit functions, which meant that one had to store function results in member variables (a common problem with visitor patterns). Here, I solve both problems by making the visitor use a type switch instead of going through double dispatch on the visited object. This allows one to parameterize the visitor based on the return type and pass function results as function results. The mutation is fascilitated by having each Visit function take two arguments -- a reference to the object itself (with the correct dynamic type), and a reference to the parent's pointer to this object. Although this wasn't my explicit goal here, the fact that we're not using virtual dispatch anymore allows us to make the AST nodes trivially destructible, which is a good thing, since we were not destroying them anyway. Reviewers: aleksandr.urakov, amccarth Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D60410 llvm-svn: 358261
* [IRMemoryMap] Fix -Wimplicit-fallthrough in -DLLVM_ENABLE_ASSERTIONS=off buildFangrui Song2019-04-121-1/+1
| | | | llvm-svn: 358249
* [lldb] [lit/Register] XFAIL on DarwinMichal Gorny2019-04-111-0/+1
| | | | llvm-svn: 358224
* [test] Fix & re-enable CommandScriptImmediateOutputFile on WindowsJonas Devlieghere2019-04-112-4/+5
| | | | | | | Apparently the shlex module produces garbage on Windows. I've added a hand rolled split instead that should suffice for this test. llvm-svn: 358216
* [test] Disable CommandScriptImmediateOutputFile on WindowsJonas Devlieghere2019-04-111-0/+2
| | | | | | | | | | | | | | | | | | | Somehow the path gets messed up. The command looks correct, but the python path is not. (lldb) mywrite E:\build_slave\lldb-x64-windows-ninja\build\tools\lldb\lit\Commands\ CommandScriptImmediateOutput\Output\ CommandScriptImmediateOutputFile.test.tmp.read.txt r No such file or directory: 'E:build_slavelldb-x64-windows-ninjabuildtoolslldblitCommands CommandScriptImmediateOutputOutput CommandScriptImmediateOutputFile.test.tmp.read.txt' Maybe the shlex module is escaping it? llvm-svn: 358213
* [lldb] [lit/Register] Mark x86-mm-xmm-read XFAIL on WindowsMichal Gorny2019-04-111-0/+1
| | | | llvm-svn: 358188
* [lldb] [lit/Register] Fix test to use %clangxxMichal Gorny2019-04-111-1/+1
| | | | llvm-svn: 358184
* [test] Convert CommandScriptImmediateOutput from pexpect to litJonas Devlieghere2019-04-114-101/+62
| | | | | | | | | This converts the CommandScriptImmediateOutput test from a python test using pexpect to a lit test. Differential revision: https://reviews.llvm.org/D60566 llvm-svn: 358180
* [lldb] [Process/NetBSD] Fix wrongly mapping mm* registersMichal Gorny2019-04-113-2/+79
| | | | | | | | | | | | | Fix mistake that mapped mm* registers into the space for xmm* registers, rather than the one shared with st* registers. In other words, 'register read mmN' now correctly shows the mmN register rather than part of xmmN. Includes a minimal lit regression test. Differential Revision: https://reviews.llvm.org/D60325 llvm-svn: 358178
* Minidump: extend UUID byte-swapping to windows platformPavel Labath2019-04-113-40/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: D59433 added code to swap bytes UUIDs coming from minidump files, but only enabled it for apple platforms. Based on my research, I believe this is the correct thing to do for windows as well, as the natural way of printing U(G)UIDs on this platforms is to print the first three components as (4 or 2)-byte integers printed in natural (big-endian) order. This makes the UUID string coming out of lldb match the strings produced by other windows tools. The decision to byte-swap the age field is somewhat arbitrary, because the age field is usually printed separately from the file GUID (and often in decimal). However, for our purposes (telling whether two files are identical), including it in the UUID is correct, and printing it in big-endian makes it easier to recognize the age value. This also makes the UUIDs generated here (almost) match up with the UUIDs computed for breakpad symbol files (BreakpadRecords.cpp:parseModuleId), which already implemented the byte-swapping. The "almost" is here because ObjectFileBreakpad does not swap the age field, but I'll fix that in a follow-up. There is no UUID support in ObjectFileCOFF at the moment, but ideally the algorithms used here and in ObjectFileCOFF should be in sync so that object file matching works correctly. Reviewers: clayborg, amccarth, markmentovai, asmith Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D60501 llvm-svn: 358169
* Fix undefined behavior in DWARFASTParser::ParseChildArrayInfo()Adrian Prantl2019-04-102-3/+5
| | | | | | | PR40827: https://bugs.llvm.org/show_bug.cgi?id=40827 <rdar://problem/48729057> llvm-svn: 358137
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-10889-10287/+0
| | | | | | | | | | | | | | | | | | | | | | | A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
* [testsuite] Split Obj-C foundation testJonas Devlieghere2019-04-104-142/+154
| | | | | | | | TestObjCMethods2.py was the third-longest running test on Darwin. By splitting it up, lit can exploit parallelism to reduce the total wall clock time. llvm-svn: 358088
* Minidump: Use llvm parser for reading the ModuleList streamPavel Labath2019-04-106-133/+58
| | | | | | | | In this patch, I just remove the structure definitions for the ModuleList stream and the associated parsing code. The rest of the code is converted to work with the definitions in llvm. NFC. llvm-svn: 358070
* Docstringify some comments in the swig interface filesPavel Labath2019-04-103-4/+8
| | | | | | Without these, the comments don't end up in the generated python code. llvm-svn: 358055
* [lldb-server] Introduce Socket::Initialize and Terminate to simply WSASocket ↵Aaron Smith2019-04-108-50/+55
| | | | | | | | | | | | | | | | setup Reviewers: zturner, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D60440 llvm-svn: 358044
* Remove unneeded #ifdef SWIGsPavel Labath2019-04-099-58/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Some of these were present in files which should never be read by swig (and we also had one in the interface file, which is only read by swig). They are probably leftovers from the time when we were running swig over lldb headers directly. While writing this patch, I noticed that some of the #ifdefs were guarding public functions that were operating on lldb_private data types. While it wasn't strictly necessary for this patch, I made these private, as nobody should really be accessing them. This can potentially break existing code if it happened to use these methods, though it will only break at build time -- if someone builds against an old header, he should still be able to link to a new lldb library, since the functions are still there. We could keep these public for backward compatbility, but I would argue that if anyone was actually using these functions for anything, his code is already broken. Reviewers: JDevlieghere, clayborg, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D60400 llvm-svn: 357984
* Fix doxygen warning about function argumentJonas Devlieghere2019-04-091-6/+6
| | | | | | | | | | | | | | | | | | This fixes the following doxygen warning when building the lldb-cpp-doc target. This commit fixes: SBStructuredData.h:94 warning: Found unknown command `\dst' SBStructuredData.h:97 warning: Found unknown command `\dst' SBStructuredData.h:98 warning: Found unknown command `\dst' SBStructuredData.h:100 warning: Found unknown command `\dst' SBStructuredData.h:104 warning: Found unknown command `\dst' Patch by: Konrad Kleine Differential revision: https://reviews.llvm.org/D60443 llvm-svn: 357983
* Add missing space between \btrueJonas Devlieghere2019-04-091-1/+1
| | | | | | | | | | | | | | | | | There was a space missing in some the documentation for lldb::BreakpointsWriteToFile. This fixes the following doxygen error when building the lldb-cpp-doc target: llvm-project/lldb/include/lldb/API/SBTarget.h:775 warning: Found unknown command `\btrue' Patch by: Konrad Kleine Differential revision: https://reviews.llvm.org/D60442 llvm-svn: 357980
* Minidump: use string parsing functionality from llvmPavel Labath2019-04-096-151/+104
| | | | llvm-svn: 357977
* Breakpad: Parse Stack CFI recordsPavel Labath2019-04-095-10/+91
| | | | | | | | | | | | | | | | | Summary: This patch adds support for parsing STACK CFI records from breakpad files. The expressions specifying the values of registers are not parsed.The idea is that these will be handed off to the postfix expression -> dwarf compiler, once it is extracted from the internals of the NativePDB plugin. Reviewers: clayborg, amccarth, markmentovai Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D60268 llvm-svn: 357975
* Get the run locker before you ask if your thread is valid.Jim Ingham2019-04-091-3/+3
| | | | | | | | | | | | | | | I have occasional crashes coming from SBThread::GetExtendedBacktraceThread. The symptom is that we got true back from HasThreadScope - so we should have a valid live thread, but then when we go to use the thread, it is not good anymore and we crash. I can't spot any obvious cause for this crash, but in looking for same I noticed that in the current code we check that the thread is valid, THEN we take the stop locker. We really should do that in the other order, and ensure that the process will stay stopped before we check our thread is still good. That's what this patch does. <rdar://problem/47478205> llvm-svn: 357963
* Rename Target::GetSharedModule to Target::GetOrCreateModule.Jason Molenda2019-04-0819-68/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a flag to control whether the ModulesDidLoad notification is called when a module is added. If the notifications are disabled, the caller must call ModulesDidLoad after adding all the new modules, but postponing this notification until they're all batched up can allow for better efficiency than notifying one-by-one. Change the name of the ModuleList notifier functions that a subclass can implement to start with 'Notify' to make it clear what they are. Add a NotifyModulesRemoved. Add header documentation for the changed/updated methods. Added defaulted-value 'notify' argument to ModuleList Append, AppendIfNeeded, and Remove because callers working with a local ModuleList don't have an obvious idea of what notify means in this context. When the ModuleList is a part of the Target class, the notify behavior matters. DynamicLoaderDarwin has been updated so that libraries being added/removed are correctly batched up before notifications are sent. Added the TestModuleLoadedNotifys.py test to run on Darwin to test this. <rdar://problem/48293064> Differential Revision: https://reviews.llvm.org/D60172 llvm-svn: 357955
* Experiment with a larger packet timeout.Adrian Prantl2019-04-081-2/+2
| | | | | | | | This is a follow-up to r357829 (https://reviews.llvm.org/D60340) to see whether increasing the packet timeout for non-asan builds could also positively affect the stability of non-asan bots. llvm-svn: 357954
* Fix a stack buffer overflow found by ASAN.Adrian Prantl2019-04-081-5/+6
| | | | | | | | | | llvm::StringRef host_and_port is not guaranteed to be null-terminated. Generally, it is not safe at all to convert a StringRef into a char * by calling data() on it. <rdar://problem/49698580> llvm-svn: 357948
* MinidumpParser: parse SystemInfo stream via llvmPavel Labath2019-04-083-21/+63
| | | | | | | I also update the tests for SystemInfo parsing to use the yaml2minidump capabilities in llvm instead of relying on checked-in binaries. llvm-svn: 357896
* PDBFPO: add dyn_cast supportPavel Labath2019-04-081-7/+25
| | | | | | | This adds the necessary glue so we can use llvm::dyn_cast, instead of doing a manual type-check followed by a cast. NFC. llvm-svn: 357895
* Fix signed-unsigned comparison warning in Driver.cppPavel Labath2019-04-081-1/+1
| | | | llvm-svn: 357893
* modify-python-lldb.py: Remove ifdef SWIG-removing codePavel Labath2019-04-081-13/+4
| | | | | | | | | There are no patterns like that in the generated swig files (there probably were some back in the days when we were running swig over the header files directly), so this is dead code and has no effect on the generated file. llvm-svn: 357890
* Unify random timeouts throughout LLDB and make them configurable.Adrian Prantl2019-04-0516-49/+43
| | | | | | | | | | | | | | | | | Since these timeouts guard against catastrophic error in debugserver, I also increased all of them to the maximum value among them. The motivation for this test was the observation that an asanified LLDB would often exhibit seemingly random test failures that could be traced back to debugserver packets getting out of sync. With this path applied I can no longer reproduce the one particular failure mode that I was investigating. rdar://problem/49441261 Differential Revision: https://reviews.llvm.org/D60340 llvm-svn: 357829
* [testsuite] Split Objective-C new syntax testJonas Devlieghere2019-04-055-204/+225
| | | | | | | This splits the second longest test into separate test cases. Similar to what we did for the Objective-C data formatters in r357786. llvm-svn: 357824
* [CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone buildsAlex Langford2019-04-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | Summary: This line is unnecessary because add_llvm_executable will handle linking the correct LLVM libraries for you. LLDB standalone builds are totally fine without this. In the best case, having this line here is harmless. In the worst case it can cause link issues. If you build lldb-server for android using the standalone build, this line will cause LLVM_LIBRARY_DIR to be the first place you look for libraries. This is an issue because if you built libc++, it will try to link against that one instead of the one from the android NDK. Meanwhile, the LLVM libraries you're linking against were linked against the libc++ from the NDK. Ideally, we would take advantage of the AFTER option for link_directories(), but that was not available in LLDB's minimum supported version of CMake (CMake 3.4.3). Differential Revision: https://reviews.llvm.org/D60180 llvm-svn: 357817
* [Test] Remove no_debug_info_test decorator from Obj-C data formatters.Jonas Devlieghere2019-04-0511-11/+0
| | | | | | As discussed in https://reviews.llvm.org/D60300. llvm-svn: 357813
* Add .noindex to the gitignoreJonas Devlieghere2019-04-051-0/+1
| | | | | | | | The .noindex suffix is used on macOS to prevent Spotlight from indexing its contents. These folders contain test output from dotest.py and should be ignored when dotest is run from the LLDB source directory. llvm-svn: 357787
* [testsuite] Split Objective-C data formatterJonas Devlieghere2019-04-0514-530/+584
| | | | | | | | | | | | | The testcase for objective-c data formatters is very big as it checks a bunch of stuff. This is annoying when using the lit test driver, because it prevents us from running the different cases in parallel. As a result, it's always one of the last few tests that complete. This patch splits the test into multiple files that share a common base class. This way lit can run the different tests in parallel. Differential revision: https://reviews.llvm.org/D60300 llvm-svn: 357786
* modify-python-lldb.py: Insert initialization code with swig insteadPavel Labath2019-04-052-7/+10
| | | | | | | | This is the last functional change to the generated python module being done by modify-python-lldb.py. The remaining code just deals with reformatting of comments. llvm-svn: 357755
* MinidumpParser: use minidump parser in llvm/ObjectPavel Labath2019-04-0510-154/+59
| | | | | | | | | | | | | | | | | | This patch removes the lower layers of the minidump parsing code from the MinidumpParser class, and replaces it with the minidump parser in llvm. Not all functionality is already avaiable in the llvm class, but it is enough for us to be able to stop enumerating streams manually, and rely on the minidump directory parsing code from the llvm class. This also removes some checked-in binaries which were used to test error handling in the parser, as the error handling is now done (and tested) in llvm. Instead I just add one test that ensures we correctly propagate the errors reported by the llvm parser. The input for this test can be written in yaml instead of a checked-in binary. llvm-svn: 357748
* TestVCCode_step: replace assertTrue with more specific assertionsPavel Labath2019-04-051-10/+10
| | | | | | | | | When this test fails (flakes) all we get is an error message like "False is not True". This replaces patterns like assertTrue(a == b) with assertEqual(a, b), so we get a better error message (and hopefully a hint as to why the test is flaky). llvm-svn: 357747
* PDBFPO: Use references instead of pointers, where possiblePavel Labath2019-04-051-65/+63
| | | | | | | | | | | | | | | | | | | Summary: The code was passing pointers around, expecting they would be not null. In c++ it is possible to convey this notion explicitly by using a reference instead. Not all uses of pointers could be converted to references (e.g. one can't store references in a container), but this will at least make it locally obvious that code is dealing with nonnull pointers. Reviewers: aleksandr.urakov, amccarth Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D60271 llvm-svn: 357744
* Breakpad: Refine record classification codePavel Labath2019-04-047-38/+76
| | | | | | | | | | | | | | | | | Previously we would classify all STACK records into a single bucket. This is not really helpful, because there are three distinct types of records beginning with the token "STACK" (STACK CFI INIT, STACK CFI, STACK WIN). To be consistent with how we're treating other records, we should classify these as three different record types. It also implements the logic to put "STACK CFI INIT" and "STACK CFI" records into the same "section" of the breakpad file, as they are meant to be read together (similar to how FUNC and LINE records are treated). The code which performs actual parsing of these records will come in a separate patch. llvm-svn: 357691
OpenPOWER on IntegriCloud