summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Document that LLDB_LOG macros use the format_providers.Jim Ingham2019-07-261-0/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D65293 llvm-svn: 367132
* [CMake] Fix find_python_libs_windowsJonas Devlieghere2019-07-261-0/+1
| | | | | | | Exporting PYTHON_INCLUDE_DIR to the Python scope somehow got lost in my last change. Add it back again. This should fix the Windows bot! llvm-svn: 367127
* [CMake] Print Python version on WindowsJonas Devlieghere2019-07-261-2/+2
| | | | | | Trying to figure out what's causing the Windows bot to fail. llvm-svn: 367125
* [CMake] Loosen Python version check and ignore patch versionJonas Devlieghere2019-07-261-10/+36
| | | | | | | | | Some versions of macOS report a different patch version for the system provided interpreter and libraries. Differential revision: https://reviews.llvm.org/D65230 llvm-svn: 367115
* [lldb][NFC] Remove eDiagnosticOriginGoRaphael Isemann2019-07-261-2/+0
| | | | | | This enum value is unused as we removed Go support. llvm-svn: 367110
* DWARF: Improve type safety or range lists parsingPavel Labath2019-07-265-16/+10
| | | | | | | | | Delete the abstract GetOffset function, which is only defined for rnglists entries. Instead fix up entries which refer to the range list classes so that one can statically know that he is dealing with the rnglists section and call the function that way. llvm-svn: 367106
* [lldb] Don't dynamically allocate the posix option validator.Raphael Isemann2019-07-264-24/+21
| | | | | | | | We dynamically allocate the option validator which means we can't mark this list of OptionDefinitions as constexpr. It's also more complicated than necessary. llvm-svn: 367102
* Fix some "control reaches end of non-void function" warningsPavel Labath2019-07-261-0/+2
| | | | llvm-svn: 367095
* ObjectFileELF: Use llvm::JamCRC to refactor CRC32 computationFangrui Song2019-07-261-67/+9
| | | | | | | | Reviewed By: labath Differential Revision: https://reviews.llvm.org/D65318 llvm-svn: 367090
* SymbolVendor: Move Symtab construction into the SymbolFilePavel Labath2019-07-2612-43/+38
| | | | | | | | | | | | | | | Summary: Instead of having SymbolVendor coordinate Symtab construction between Symbol and Object files, make the SymbolVendor function a passthrough, and put all of the logic into the SymbolFile. Reviewers: clayborg, JDevlieghere, jingham, espindola Subscribers: emaste, mgorny, arichardson, MaskRay, lldb-commits Differential Revision: https://reviews.llvm.org/D65208 llvm-svn: 367086
* [dotest] Remove dead codeJonas Devlieghere2019-07-265-51/+3
| | | | | | Remove some dead code that I ran into when preparing D65311. llvm-svn: 367079
* [Tests] Split inferior crashing testsJonas Devlieghere2019-07-264-196/+359
| | | | | | | | We noticed that TestInferiorCrashing.py and TestRecursiveInferior.py are the second and third slowest tests in the test suite. Splitting them up allows lit to schedule them more effectively. llvm-svn: 367077
* [CMake] Add TableGen dependency to lldbInterpreter.Jonas Devlieghere2019-07-251-0/+2
| | | | | | lldbInterpreter depends on LLDBPropertiesGen and LLDBPropertiesEnumGen. llvm-svn: 367073
* [Docs] Remove reproducers from the project page.Jonas Devlieghere2019-07-251-22/+7
| | | | | | Jim pointed out that this was still open on the website. llvm-svn: 367066
* [Tablegen] Fix issues caused by incorrect escaping.Jonas Devlieghere2019-07-252-8/+8
| | | | | | | | The printEscapedString would escape newlines by their ASCII values instead of prefixing them with a `\`. Remove the escaping logic and escape the strings in the definition file. llvm-svn: 367065
* Mention adding predicates to settings in the projects page.Jim Ingham2019-07-251-0/+14
| | | | llvm-svn: 367059
* Let tablegen generate property definitionsJonas Devlieghere2019-07-2538-569/+906
| | | | | | | | | | | | | | | | | | | | | | | | | | Property definitions are currently defined in a PropertyDefinition array and have a corresponding enum to index in this array. Unfortunately this is quite error prone. Indeed, just today we found an incorrect merge where a discrepancy between the order of the enum values and their definition caused the test suite to fail spectacularly. Tablegen can streamline the process of generating the property definition table while at the same time guaranteeing that the enums stay in sync. That's exactly what this patch does. It adds a new tablegen file for the properties, building on top of the infrastructure that Raphael added recently for the command options. It also introduces two new tablegen backends: one for the property definitions and one for their corresponding enums. It might be worth mentioning that I generated most of the tablegen definitions from the existing property definitions, by adding a dump method to the struct. This seems both more efficient and less error prone that copying everything over by hand. Only Enum properties needed manual fixup for the EnumValues and DefaultEnumValue fields. Differential revision: https://reviews.llvm.org/D65185 llvm-svn: 367058
* Remove a project that was completed.Jim Ingham2019-07-251-6/+0
| | | | llvm-svn: 367057
* [dotest] Set environment variables after potentialy clearing others.Jonas Devlieghere2019-07-251-3/+4
| | | | | | | | | Dotest contains code to clear DYLD_LIBRARY_PATH for the inferior to not propagate sanitized builds. However, it's possible that we want to inject a different library path with `--inferior-env`. To make that work correctly, we need to do that *after* clearing DYLD_LIBRARY_PATH. llvm-svn: 367054
* [LLDB] Find debugserver in Command Line Tools as wellAntonio Afonso2019-07-251-50/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This might be an edge case in regular use but if you're shipping an lldb version with no debugserver lldb will try to use the System one. However, lldb only knows how to find the Xcode one and not the Command Line Tools one. This diff fixes that. We try to find debugserver with `PlatformDarwin::LocateExecutable("debugserver")`, we call `xcode-select -p` to get the path and then assume this path is of Xcode. The changes I did are: * Change `PlatformDarwin::LocateExecutable` to also add the Command Line Tools directory to the list of paths to search for debugserver. * Created a new function to find the Command Line Tools directory named `GetCommandLineToolsLibraryPath`. * Refactored the code that calls `xcode-select -p` into its own function `GetXcodeSelectPath()`. There were 2 identical pieces of code for this so I reduced it to one and used this function everywhere instead. * I also changed `PlatformDarwin::GetSDKDirectoryForModules` to use the `SDKs` directory that exists in the Command Line Tools installation. I'm not sure how to create tests for this. PlatformDarwinTest is really limited and I couldn't find how to mock Filesystem::Instance() so I could create a virtual file system. Reviewers: clayborg, JDevlieghere Reviewed By: clayborg, JDevlieghere Subscribers: jasonmolenda, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65171 llvm-svn: 367052
* [lldb] [Process/NetBSD] Report stopped process on SIGSTOPMichal Gorny2019-07-256-6/+1
| | | | | | | | | | | | | Mark the process as stopped when SIGSTOP arrives. This is necessary for lldb-server to generate correct response to 'process interrupt', and therefore to prevent the whole stack crashing when process is stopped. Thanks to Pavel Labath for the tip. Differential Revision: https://reviews.llvm.org/D65289 llvm-svn: 367047
* Correctly use GetLoadedModuleList to take advantage of libraries-svr4Antonio Afonso2019-07-257-89/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Here's a replacement for D62504. I thought I could use LoadModules to implement this but in reality I can't because there are at few issues with it: * The LoadModules assumes that the list returned by GetLoadedModuleList is comprehensive in the sense that reflects all the mapped segments, however, this is not true, for instance VDSO entry is not there since it's loaded manually by LoadVDSO using GetMemoryRegionInfo and it doesn't represent a specific shared object in disk. Because of this LoadModules will unload the VDSO module. * The loader (interpreter) module might have also been loaded using GetMemoryRegionInfo, this is true when we launch the process and the rendezvous structure is not yet available (done through LoadInterpreterModule()). The problem here is that this entry will point to the same file name as the one found in /proc/pid/maps, however, when we read the same module from the r_debug.link_map structure it might be under a different name. This is true at least on CentOS where the loader is a symlink. Because of this LoadModules will unload and load the module in a way where the rendezvous breakpoint is unresolved but not resolved again (because we add the new module first and remove the old one after). The symlink issue might be fixable by first unloading the old and loading the news (but sounds super brittle), however, I'm not sure how to fix the VDSO issue. Since I can't trust it I'm just going to use GetLoadedModuleList directly with the same logic that we use today for when we read the linked list in lldb. The only safe thing to do here is to only calculate differences between different snapshots of the svr4 packet itself. This will also cut the dependency this plugin has from LoadModules. I separated the 2 logics into 2 different functions (remote and not remote) because I don't like mixing 2 different logics in the same function with if/else's. Two different functions makes it easier to reason with I believe. However, I did abstract away the logic that decides if we should take a snapshot or add/remove modules so both functions could reuse it. The other difference between the two is that on the UpdateSOEntriesFromRemote I take the snapshot only once when state = Consistent because I didn't find a good reason to always update that, as we already got the list from state = Add | Remove. I probably should use the same logic on UpdateSOEntries though I don't see a reason not to since it's really using the same data, just read in different places. Any thoughts here? It might also be worthwhile to add a test to make sure we don't unload modules that were not actually "unloaded" like the vdso. I haven't done this yet though. This diff is also missing the option for svr4 like proposed in https://reviews.llvm.org/D62503#1564296, I'll start working on this but wanted to have this up first. Reviewers: labath, jankratochvil, clayborg, xiaobai Reviewed By: labath Subscribers: srhines, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D64013 llvm-svn: 367020
* [lldb] Tablegenify expr/frame/log/register/memoryRaphael Isemann2019-07-256-70/+161
| | | | llvm-svn: 367009
* [lldb][CMake] Fix framework-enabled build detail for XcodeStefan Granitz2019-07-251-1/+1
| | | | | | If debugserver or any other framework tool gets built first, its post-build copy operation was using 'Resources' as the file name instead of the destination directory. It was not a problem with Ninja, because here the framework structure was alreaady created at configuration time. With this fix, both generators are happy. llvm-svn: 367005
* SymbolFile: Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds ↵Fangrui Song2019-07-251-0/+1
| | | | | | after D65089/r366791 llvm-svn: 367001
* SymbolVendor: Remove the type list memberPavel Labath2019-07-2515-65/+23
| | | | | | | | | | | | | | | | | | | | | Summary: Similarly to the compile unit lists, the list of types can also be managed by the symbol file itself. Since the only purpose of this list seems to be to maintain an owning reference to all the types a symbol file has created (items are only ever added to the list, never retrieved), I remove the passthrough functions in SymbolVendor and Module. I also tighten the interface of the function (return a reference instead of a pointer, make it protected instead of public). Reviewers: clayborg, JDevlieghere, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D65135 llvm-svn: 366994
* LLGS: fix tracking execve on linuxPavel Labath2019-07-253-79/+16
| | | | | | | | | | | | | | | | | | | Summary: Due to a logic error, lldb-server ended up asserting/crashing every time the debugged process attempted an execve(). This fixes the error, and extends TestExec to work on other platforms too. The "extension" consists of avoiding non-standard posix_spawn extensions and using the classic execve() call, which should be available on any platform that actually supports re-execing. I change the test decorator from @skipUnlessDarwin to @skipIfWindows. Reviewers: clayborg, jasonmolenda Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D65207 llvm-svn: 366985
* cli-wrapper-mpxtable.cpp: fix file headerFangrui Song2019-07-251-2/+1
| | | | llvm-svn: 366983
* [TableGen] Fix comments/headers referencing clang (NFC)Jonas Devlieghere2019-07-253-6/+7
| | | | | | | Remove references to clang's TableGen implementation. Presumably these files were originally copied over. llvm-svn: 366982
* [FileCollector] Remove LLDB shim around llvm::FileCollector (NFC)Jonas Devlieghere2019-07-255-56/+15
| | | | | | | | The FileCollector got lifted into LLVM and a shim was introduced in LLDB to keep the old API that takes FileSpecs. This patch removes that shim and converts the arguments in place. llvm-svn: 366975
* [FileSystem] Fix ambiguous symbol on Windows.Jonas Devlieghere2019-07-251-1/+1
| | | | | | | The using declarations make FileCollector ambiguous. Specify that FileSystem takes an lldb_private::FileCollector. llvm-svn: 366974
* [FileCollector] Change coding style from LLDB to LLVM (NFC)Jonas Devlieghere2019-07-254-11/+11
| | | | | | | | This patch changes the coding style of the FileCollector from the LLDB to the LLVM coding style. Alex recently lifted it into LLVM and I volunteered to do the conversion. llvm-svn: 366966
* [Support] move FileCollector from LLDB to llvm/SupportAlex Lorenz2019-07-245-447/+13
| | | | | | | | | The file collector class is useful for creating reproducers, not just for LLDB, but for other tools as well in LLVM/Clang. Differential Revision: https://reviews.llvm.org/D65237 llvm-svn: 366956
* [Symbol] Fix some botched logic in Variable::GetLanguageAlex Langford2019-07-241-5/+5
| | | | | | | | | | | | | | Summary: I messed up the logic for this. Fixing with some improvements suggested by Pavel. Reviewers: labath, jdoerfert Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D65165 llvm-svn: 366950
* [Logging] Replace Log::Printf with LLDB_LOG macro (NFC)Jonas Devlieghere2019-07-24190-5934/+5364
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces explicit calls to log::Printf with the new LLDB_LOGF macro. The macro is similar to LLDB_LOG but supports printf-style format strings, instead of formatv-style format strings. So instead of writing: if (log) log->Printf("%s\n", str); You'd write: LLDB_LOG(log, "%s\n", str); This change was done mechanically with the command below. I replaced the spurious if-checks with vim, since I know how to do multi-line replacements with it. find . -type f -name '*.cpp' -exec \ sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" + Differential revision: https://reviews.llvm.org/D65128 llvm-svn: 366936
* [lldb] Configure debugserver_vers.c from CMakeStefan Granitz2019-07-242-0/+4
| | | | llvm-svn: 366932
* [AIX][lit] Don't depend on psutil on AIXDavid Tenty2019-07-241-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: On AIX psutil can run into problems with permissions to read the process tree, which causes problems for python timeout tests which need to kill off a test and it's children. This patch adds a workaround by invoking shell via subprocess and using a platform specific option to ps to list all the descendant processes so we can kill them. We add some checks so lit can tell whether timeout tests are supported with out exposing whether we are utilizing the psutil implementation or the alternative. Reviewers: hubert.reinterpretcast, andusy, davide, delcypher Reviewed By: delcypher Subscribers: davide, delcypher, christof, lldb-commits, libcxx-commits, llvm-commits Tags: #lldb, #libc, #llvm Differential Revision: https://reviews.llvm.org/D64251 llvm-svn: 366912
* Fix @skipIfSanitized decoratorPavel Labath2019-07-241-2/+4
| | | | | | | To run the test the decorator function should return None, not False. Returning anything other than None skips the test. llvm-svn: 366903
* [lldb] Fix build errors from tablegenify platform commitRaphael Isemann2019-07-242-9/+9
| | | | | | Forgot to stage some changes... llvm-svn: 366892
* [lldb][NFC] Tablegenify platformRaphael Isemann2019-07-242-46/+112
| | | | llvm-svn: 366891
* Revert "Revert "[lldb] [Process/NetBSD] Fix constructor after r363707""Michal Gorny2019-07-241-1/+1
| | | | | | The relevant changes have been reapplied, and broke build again. llvm-svn: 366889
* [lldb] Remove Xcode project legacyStefan Granitz2019-07-2414-1775/+0
| | | | | | | | | | | | | | Summary: Since D65109 removed the manually maintained Xcode project, there's a few things we don't need anymore. Anything here we should keep or anything more to remove? Reviewers: JDevlieghere, jasonmolenda, clayborg, jingham, lanza, teemperor Subscribers: mgorny, lldb-commits, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D65155 llvm-svn: 366879
* [lldb] Fix enum value descriptionJonas Devlieghere2019-07-231-1/+1
| | | | llvm-svn: 366863
* [lldb][test_suite] Update tests with unexpected pass on Android aarch64Alex Langford2019-07-2314-18/+37
| | | | | | | | | | Summary: update some test decorates that can actually pass on andriod aarch64 Patch by Wanyi Ye <kusmour@gmail.com> Differential Revision: https://reviews.llvm.org/D64767 llvm-svn: 366858
* [ExpressionParser] Handle llvm::Expected resultJonas Devlieghere2019-07-231-2/+10
| | | | | | | | | | This fixes the unchecked-error assertion at runtime. Expected<T> must be checked before access or destruction. Expected<T> value was in success state. (Note: Expected<T> values in success mode must still be checked prior to being destroyed). llvm-svn: 366853
* [ExpressionParser] Fix formatting and whitespace (NFC)Jonas Devlieghere2019-07-231-32/+32
| | | | | | Fix formatting and whitespace before making changes to this file. llvm-svn: 366852
* [lldb] Fix occasional hangs of VSCode testcasesJan Kratochvil2019-07-231-7/+1
| | | | | | | | | | | | | | | | | | | | | | On slower machines the vscode testcases were sometimes hanging: 1910 ? Sl 0:00 | \_ /usr/bin/python .../llvm/tools/lldb/test/dotest.py ... -p TestVSCode_setBreakpoints.py 2649 ? Sl 0:00 | \_ .../build/bin/lldb-vscode 2690 ? S 0:00 | \_ .../build/bin/lldb-server gdbserver --fd=9 --native-regs --setsid 2708 ? t 0:00 | \_ .../build/lldb-test-build.noindex/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.test_functionality/a.out A reproducer of the racy bug for send_recv(): # self.send_packet(command) #+ import time #+ time.sleep(1) # done = False I guess `request_continue` was probably originally intended to be synchronous but then it isn't and this code has been leftover there. Differential revision: https://reviews.llvm.org/D65163 llvm-svn: 366850
* Revert "Revert "Add ReadCStringFromMemory for faster string reads""Antonio Afonso2019-07-235-7/+136
| | | | | | This reverts commit 9c10b620c0619611dfe062216459431955ac4801. llvm-svn: 366848
* Revert "Revert "Implement xfer:libraries-svr4:read packet""Antonio Afonso2019-07-2316-5/+366
| | | | | | This reverts commit 08c38f77c5fb4d3735ec215032fed8ee6730b3db. llvm-svn: 366847
* [utils] Remove sync-source (with SVN)Jonas Devlieghere2019-07-237-646/+0
| | | | llvm-svn: 366833
OpenPOWER on IntegriCloud