summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* [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"
* [LLDB][formatters] ArgInfo::count -> ArgInfo::max_positional_argsLawrence D'Anna2019-10-271-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Move breakpoints from the old, bad ArgInfo::count to the new, better ArgInfo::max_positional_args. Soon ArgInfo::count will be no more. This functionality is tested in `TestFormatters.py`, `TestDataFormatterSynthVal.py`, `TestDataFormatterSynthType.py`. You may notice that the old code was passing 0 arguments when count was 1, and passing 1 argument when count is 2. This is no longer necessary because max_positional_args counts the self pointer correctly. Reviewers: labath, jingham, JDevlieghere Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69469
* fix lldb build with -DLLVM_ENABLE_MODULES=On (missing #include)Luboš Luňák2019-10-261-0/+1
| | | | The error message says to add the #include.
* Correct size_t format specifierShu-Chun Weng2019-10-261-1/+1
| | | | Differential Revision: https://reviews.llvm.org/D69455
* Fix after 738af7a6241c98164625b9cd1ba9f8af4e36f197Adrian McCarthy2019-10-251-1/+5
| | | | Default implementation of a new virtual method wasn't returning a value.
* [LLDB] Fix inline variable only used in assertion. (NFC)Jonas Devlieghere2019-10-251-2/+1
| | | | | | | | | This prevents unused variable warning/error in -DNDEBUG builds. The variable was introduced in 5934cd11ea3e. Patch by: Shu-Chun Weng Differential revision: https://reviews.llvm.org/D69451
* lldb/minidump: Refactor memory region computation codePavel Labath2019-10-259-187/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal of this refactor is to enable ProcessMinidump to take into account the loaded modules and their sections when computing the permissions of various ranges of memory, as discussed in D66638. This patch moves some of the responsibility for computing the ranges from MinidumpParser into ProcessMinidump. MinidumpParser still does the parsing, but ProcessMinidump becomes responsible for answering the actual queries about memory ranges. This will enable it (in a follow-up patch) to augment the information obtained from the parser with data obtained from actual object files. The changes in the actual code are fairly straight-forward and just involve moving code around. MinidumpParser::GetMemoryRegions is renamed to BuildMemoryRegions to emphasize that it does no caching. The only new thing is the additional bool flag returned from this function. This indicates whether the returned regions describe all memory mapped into the target process. Data obtained from /proc/maps and the MemoryInfoList stream is considered to be exhaustive. Data obtained from Memory(64)List is not. This will be used to determine whether we need to augment the data or not. This reshuffle means that it is no longer possible/easy to test some of this code via unit tests, as constructing a ProcessMinidump instance is hard. Instead, I update the unit tests to only test the parsing of the actual data, and test the answering of queries through a lit test using the "memory region" command. The patch also includes some tweaks to the MemoryRegion class to make the unit tests easier to write. Reviewers: amccarth, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D69035
* lldb/COFF: Create a separate "section" for the file headerPavel Labath2019-10-253-38/+45
| | | | | | | | | | | | | | | | | | | | | | | | In an attempt to ensure that every part of the module's memory image is accounted for, D56537 created a special "container section" spanning the entire image. While that seemed reasonable at the time (and it still mostly does), it did create a problem of what to put as the "file size" of the section, because the image is not continuous on disk, as we generally assume (which is why I put zero there). Additionally, this arrangement makes it unclear what kind of permissions should be assigned to that section (which is what my next patch does). To get around these, this patch partially reverts D56537, and goes back to top-level sections. Instead, what I do is create a new "section" for the object file header, which is also being loaded into memory, though its not considered to be a section in the strictest sense. This makes it possible to correctly assign file size section, and we can later assign permissions to it as well. Reviewers: amccarth, mstorsjo Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D69100
* Add the ability to pass extra args to a Python breakpoint callback.Jim Ingham2019-10-2526-137/+467
| | | | | | | | | | | | | | | | | For example, it is pretty easy to write a breakpoint command that implements "stop when my caller is Foo", and it is pretty easy to write a breakpoint command that implements "stop when my caller is Bar". But there's no way to write a generic "stop when my caller is..." function, and then specify the caller when you add the command to a breakpoint. With this patch, you can pass this data in a SBStructuredData dictionary. That will get stored in the PythonCommandBaton for the breakpoint, and passed to the implementation function (if it has the right signature) when the breakpoint is hit. Then in lldb, you can say: (lldb) break com add -F caller_is -k caller_name -v Foo More generally this will allow us to write reusable Python breakpoint commands. Differential Revision: https://reviews.llvm.org/D68671
* [Driver] Force llvm to install its handlers before lldb'sVedant Kumar2019-10-251-0/+19
| | | | | | | | | | | | | | | | | | | | | | Install llvm's signal handlers up front to prevent lldb's handlers from being ignored. This is (hopefully) a stopgap workaround. When lldb invokes an llvm API that installs signal handlers (e.g. llvm::sys::RemoveFileOnSignal, possibly via a compiler embedded within lldb), lldb's signal handlers are overriden if llvm is installing its handlers for the first time. To work around llvm's behavior, force it to install its handlers up front, and *then* install lldb's handlers. In practice this is used to prevent lldb test processes from exiting due to IO_ERR when SIGPIPE is received. Note that when llvm installs its handlers, it 1) records the old handlers it replaces and 2) re-installs the old handlers when its new handler is invoked. That means that a signal not explicitly handled by lldb can fall back to being handled by llvm's handler the first time it is received, and then by the default handler the second time it is received. Differential Revision: https://reviews.llvm.org/D69403
* Fix compilation error in ObjectFileMachO::ParseSymtabVedant Kumar2019-10-251-2/+5
|
* ValueObject: Fix a crash related to children address type computationPavel Labath2019-10-254-45/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes a crash encountered when debugging optimized code. If some variable has been completely optimized out, but it's value is nonetheless known, the compiler can replace it with a DWARF expression computing its value. The evaluating these expressions results in a eValueTypeHostAddress Value object, as it's contents are computed into an lldb buffer. However, any value that is obtained by dereferencing pointers in this object should no longer have the "host" address type. Lldb had code to account for this, but it was only present in the ValueObjectVariable class. This wasn't enough when the object being described was a struct, as then the object holding the actual pointer was a ValueObjectChild. This caused lldb to dereference the contained pointer in the context of the host process and crash. Though I am not an expert on ValueObjects, it seems to me that this children address type logic should apply to all types of objects (and indeed, applying applying the same logic to ValueObjectChild fixes the crash). Therefore, I move this code to the base class, and arrange it to be run everytime the value is updated. The test case is a reduced and simplified version of the original debug info triggering the crash. Originally we were dealing with a local variable, but as these require a running process to display, I changed it to use a global one instead. Reviewers: jingham, clayborg Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D69273
* [TableGen] Add asserts to make sure default values match property typeJonas Devlieghere2019-10-252-0/+18
| | | | | | This adds a few asserts to the property TableGen backend to prevent mismatches between property types and their default values. This would've prevented a copy-paste mistake we discovered downstream.
* [lldb] [Host/netbsd] Set Arg0 for 'platform process list -v'Michał Górny2019-10-251-0/+1
| | | | Differential Revision: https://reviews.llvm.org/D69400
* [CMake] Move LLDB_TEST_BUILD_DIRECTORY into test/CMakeLists.txtJonas Devlieghere2019-10-242-2/+3
| | | | | | The LLDB_TEST_BUILD_DIRECTORY variable only matters to the different test suites. Therefore they belong in test/CMakeLists.txt rather than the top-level CMakeLists.txt.
* [CMake] Move test dependency tracking into test/CMakeLists.txtJonas Devlieghere2019-10-243-91/+88
| | | | | | As the name suggests, the LLDB test dependencies only matter to the different test suites. Therefore they belong in test/CMakeLists.txt rather than the top-level CMakeLists.txt.
* [CMake] Don't set LLDB_TEST_* in the top-level CMakeListsJonas Devlieghere2019-10-242-23/+23
| | | | | All these variables only affect the API tests. Therefore they belong in test/API/CMakeLists.txt rather than the top-level CMakeLists.txt.
* [CMake] Remove unused variable LLDB_TEST_CXX_COMPILERJonas Devlieghere2019-10-244-15/+9
| | | | | | | | | | | | | CMake allows you to set a custom CXX compiler for the API test suite. However, this variable is never used, because dotest uses the same compiler to build C and CXX sources. I'm not sure if this variable was added with the intention of supporting a different compiler or if this is just a remnant of old functionality. Given that this hasn't been working for a while, I assume it's safe to remove. Differential revision: https://reviews.llvm.org/D69401
* Revert "Disable exit-on-SIGPIPE in lldb"Vedant Kumar2019-10-241-10/+0
| | | | | | | This reverts commit 32ce14e55e5a99dd99c3b4fd4bd0ccaaf2948c30. In post-commit review, Pavel pointed out that there's a simpler way to ignore SIGPIPE in lldb that doesn't rely on llvm's handlers.
* [lldb] [Python] Do not attempt to flush() a read-only fdMichal Gorny2019-10-241-5/+7
| | | | | | | | | | | | | | | Summary: When creating a FileSP object, do not flush() the underlying file unless it is open for writing. Attempting to flush() a read-only fd results in EBADF on NetBSD. Reviewers: lawrence_danna, labath, krytarowski Reviewed By: lawrence_danna, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D69320
* [CMake] Split logic across test suite subdirectories (NFC)Jonas Devlieghere2019-10-244-79/+67
| | | | | | | | | The top-level CMake file in the test directory can be simplified by moving relevant configuration options into the corresponding subdirectories. Doing so makes it easier to understand what CMake options are needed by the different test suites. Differential revision: https://reviews.llvm.org/D69394
* [lldb] Add nodebug attribute to import-std-module/sysroot testRaphael Isemann2019-10-231-0/+1
| | | | | | | | | | | | | | | | | | Summary: So far we rely on the default argument and the fact that we don't call this inline function in our actual `main.cpp` to make sure that this function can only be called if LLDB loads this header as a C++ module. This patch just adds the nodebug attribute as yet another measure to make sure LLDB can't call this function without the standard module loaded. Note that the test is already requiring clang for the sysroot setup, so its fine that this is a Clang specific attribute. Reviewers: friss, labath Subscribers: JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68861
* [Mips] Use appropriate private label prefix based on Mips ABIMirko Brkusanin2019-10-233-6/+14
| | | | | | | | | | MipsMCAsmInfo was using '$' prefix for Mips32 and '.L' for Mips64 regardless of -target-abi option. By passing MCTargetOptions to MCAsmInfo we can find out Mips ABI and pick appropriate prefix. Tags: #llvm, #clang, #lldb Differential Revision: https://reviews.llvm.org/D66795
* [lldb] Adjust for the new class_rw_t layout.Jonas Devlieghere2019-10-221-0/+12
| | | | | | | | | The field holding the "ro" will now be a union. If the low bit is set, then it isn't an ro and it needs to be dereferenced once more to get to it. If the low bit isn't set, then it is a proper class_ro_t No dedicated test is needed as this code path will trigger when running the existing Objective-C tests under a current version of the runtime.
* fix PythonDataObjectsTest.TestExceptions on windowsLawrence D'Anna2019-10-221-7/+7
| | | | | | | | | Looks like on windows googlemock regexes treat newlines differently from on darwin. This patch fixes the regex in this test so it will work on both. Fixes: https://reviews.llvm.org/D69214 llvm-svn: 375477
* remove multi-argument form of PythonObject::Reset()Lawrence D'Anna2019-10-2215-868/+453
| | | | | | | | | | | | | | | | | | | | Summary: With this patch, only the no-argument form of `Reset()` remains in PythonDataObjects. It also deletes PythonExceptionState in favor of PythonException, because the only call-site of PythonExceptionState was also using Reset, so I cleaned up both while I was there. Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69214 llvm-svn: 375475
* whitespace cleanupAdrian Prantl2019-10-211-1/+1
| | | | llvm-svn: 375465
* Factor out common test functionality into a helper class. (NFC)Adrian Prantl2019-10-211-81/+91
| | | | llvm-svn: 375464
* XFAIL TestLocalVariables.py on WindowsJonas Devlieghere2019-10-211-0/+1
| | | | | | | | This test has been failing for a while on the Windows bot. https://bugs.llvm.org/show_bug.cgi?id=43752 llvm-svn: 375459
* Found more timeouts to unify.Adrian Prantl2019-10-213-5/+7
| | | | llvm-svn: 375454
* Unify timeouts in gdbserver tests and ensure they are larger if ASAN is enabled.Adrian Prantl2019-10-215-8/+10
| | | | llvm-svn: 375431
* [lldb] Add test for executing static initializers in expression commandRaphael Isemann2019-10-213-0/+45
| | | | llvm-svn: 375422
* [lldb] drop .symtab removal in minidebuginfo testsKonrad Kleine2019-10-213-15/+0
| | | | | | | | | | | | | | | | Summary: After D69041, we no longer have to manually remove the .symtab section once yaml2obj was run. Reviewers: espindola, alexshap Subscribers: emaste, arichardson, MaskRay, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69254 llvm-svn: 375415
* [LLDB] [Windows] Initial support for ARM register contextsMartin Storsjo2019-10-2110-3/+1316
| | | | | | Differential Revision: https://reviews.llvm.org/D69226 llvm-svn: 375392
* eliminate nontrivial Reset(...) from TypedPythonObjectLawrence D'Anna2019-10-194-46/+78
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This deletes `Reset(...)`, except for the no-argument form `Reset()` from `TypedPythonObject`, and therefore from `PythonString`, `PythonList`, etc. It updates the various callers to use assignment, `As<>`, `Take<>`, and `Retain<>`, as appropriate. followon to https://reviews.llvm.org/D69080 Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69133 llvm-svn: 375350
* convert LLDBSwigPythonCallTypeScript to ArgInfo::max_positional_argsLawrence D'Anna2019-10-193-5/+32
| | | | | | | | | | | | | | | | | | | | Summary: This patch converts another user of ArgInfo::count over to use ArgInfo::max_positional_args instead. I also add a test to make sure both documented signatures for python type formatters work. Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69153 llvm-svn: 375334
* [LLDB] bugfix: command script add -f doesn't work for some callablesLawrence D'Anna2019-10-197-19/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When users define a debugger command from python, they provide a callable object. Because the signature of the function has been extended, LLDB needs to inspect the number of parameters the callable can take. The rule it was using to decide was weird, apparently not tested, and giving wrong results for some kinds of python callables. This patch replaces the weird rule with a simple one: if the callable can take 5 arguments, it gets the 5 argument version of the signature. Otherwise it gets the old 4 argument version. It also adds tests with a bunch of different kinds of python callables with both 4 and 5 arguments. Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69014 llvm-svn: 375333
* Move endian constant from Host.h to SwapByteOrder.h, prune includeReid Kleckner2019-10-191-5/+2
| | | | | | | | | | | | | | Works on this dependency chain: ArrayRef.h -> Hashing.h -> --CUT-- Host.h -> StringMap.h / StringRef.h ArrayRef is very popular, but Host.h is rarely needed. Move the IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are more likely to need it. llvm-svn: 375316
* Skip (more) PExpect tests under ASAN, I can't get them to work reliably.Adrian Prantl2019-10-191-0/+3
| | | | llvm-svn: 375312
* [Reproducer] XFAIL TestWorkingDir on WindowsJonas Devlieghere2019-10-181-0/+2
| | | | | | | | I'm having a hard time reproducing this and it's failing on the Windows bot. Temporarily X-failing this test while I continue to try building LLDB on Windows. llvm-svn: 375294
* [Reproducer] Improve reproducer help (NFC)Jonas Devlieghere2019-10-181-2/+12
| | | | | | Provide a little more detail for the reproducer command. llvm-svn: 375292
* Disable exit-on-SIGPIPE in lldbVedant Kumar2019-10-181-0/+10
| | | | | | | | | | | | | | | | | | Occasionally, during test teardown, LLDB writes to a closed pipe. Sometimes the communication is inherently unreliable, so LLDB tries to avoid being killed due to SIGPIPE (it calls `signal(SIGPIPE, SIG_IGN)`). However, LLVM's default SIGPIPE behavior overrides LLDB's, causing it to exit with IO_ERR. Opt LLDB out of the default SIGPIPE behavior. I expect that this will resolve some LLDB test suite flakiness (tests randomly failing with IO_ERR) that we've seen since r344372. rdar://55750240 Differential Revision: https://reviews.llvm.org/D69148 llvm-svn: 375288
* [lldb][NFC] Remove wrong tests in TestCallOverriddenMethodRaphael Isemann2019-10-181-4/+0
| | | | | | | | | We call these tests in the second test function where they are x-failed on Windows. I forgot to remove the tests from the first test function (which is not x-failed on Windows) when extracting these calls into their own test function, so the test is still failing on Windows. llvm-svn: 375271
* [Reproducer] Use ::rtrim() to remove trailing control characters.Jonas Devlieghere2019-10-181-4/+2
| | | | | | | | Pavel correctly pointed out that removing all control characters from the working directory is overkill. It should be sufficient to just strip the last ones. llvm-svn: 375259
* ProcessMinidump: Suppress reporting stop for signal '0'Joseph Tremoulet2019-10-183-3/+50
| | | | | | | | | | | | | | | | | | | | | | | Summary: The minidump exception stream can report an exception record with signal 0. If we try to create a stop reason with signal zero, processing of the stop event won't find anything, and the debugger will hang. So, simply early-out of RefreshStateAfterStop in this case. Also set the UnixSignals object in DoLoadCore as is done for ProcessElfCore. Reviewers: labath, clayborg, jfb Reviewed By: labath, clayborg Subscribers: dexonsmith, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68096 llvm-svn: 375244
OpenPOWER on IntegriCloud