summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
* 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
* LLDB: Use LLVM's type for minidump ExceptionStream [NFC]Joseph Tremoulet2019-10-187-63/+34
| | | | | | | | | | | | | | | | Summary: The types defined for it in LLDB are now redundant with core types. Reviewers: labath, clayborg Reviewed By: clayborg Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68658 llvm-svn: 375243
* Update MinidumpYAML to use minidump::Exception for exception streamJoseph Tremoulet2019-10-181-1/+4
| | | | | | | | | | | | | | Reviewers: labath, jhenderson, clayborg, MaskRay, grimar Reviewed By: grimar Subscribers: lldb-commits, grimar, MaskRay, hiraditya, llvm-commits Tags: #llvm, #lldb Differential Revision: https://reviews.llvm.org/D68657 llvm-svn: 375242
* Add REQUIRES: x86 to more tests which need the x86 llvm target builtPavel Labath2019-10-184-0/+6
| | | | llvm-svn: 375234
* SystemInitializerCommon fix compilation on linuxPavel Labath2019-10-181-1/+2
| | | | | | | | | | | C++ defines two overloads of std::iscntrl. One in <cctype> and one in <locale>. On linux we seem to include both which makes the std::erase_if call ambiguous. Wrap std::iscntrl call in a lambda to ensure regular overload resolution. llvm-svn: 375221
* [lldb][NFC] Fix typo in DWARFASTParserClang.cppRaphael Isemann2019-10-171-2/+2
| | | | llvm-svn: 375187
* eliminate one form of PythonObject::Reset()Lawrence D'Anna2019-10-173-37/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: I'd like to eliminate all forms of Reset() and all public constructors on these objects, so the only way to make them is with Take<> and Retain<> and the only way to copy or move them is with actual c++ copy, move, or assignment. This is a simple place to start. Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69080 llvm-svn: 375182
* clean up the implementation of PythonCallable::GetNumArgumentsLawrence D'Anna2019-10-173-35/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current implementation of PythonCallable::GetNumArguments is not exception safe, has weird semantics, and is just plain incorrect for some kinds of functions. Python 3.3 introduces inspect.signature, which lets us easily query for function signatures in a sane and documented way. This patch leaves the old implementation in place for < 3.3, but uses inspect.signature for modern pythons. It also leaves the old weird semantics in place, but with FIXMEs grousing about it. We should update the callers and fix the semantics in a subsequent patch. It also adds some tests. Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68995 llvm-svn: 375181
* (NFC) Delete variable made unused by llvm-svn: 375160Sterling Augustine2019-10-171-1/+0
| | | | | | | | | | | | Reviewers: aprantl Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69143 llvm-svn: 375174
* [lldb] X-fail tests that use constructors in expressions on WindowsRaphael Isemann2019-10-172-1/+19
| | | | | | | | | These tests were testing a bug related to constructors. It seems that on Windows the expression command can't construct objects (or at least, call their constructor explicitly which is required for the tests), so this is just x-failing them until Windows actually supports constructor calls. llvm-svn: 375173
* [test] Add a .clang-format file for the shell test.Jonas Devlieghere2019-10-171-0/+3
| | | | | | | | | | | | | | | | | | The API tests have a .clang-format file that disables formatting altogether. While this is needed for some tests, it also leads to inconsistency between test files. The shell tests suffer from a similar problem: a test with a source-file extension (.c, .cpp) will get formatted, potentially breaking up lines and leading to invalid RUN commands. Rather than completely disabling formatting here, I propose to not enforce a line limit instead. That way tests will be consistent, but you can still have long run commands (as is not uncommon in LLVM either) and use breakpoints with patters that extend beyond 80 cols. Differential revision: https://reviews.llvm.org/D69058 llvm-svn: 375172
* Adapt Windows test to API change.Adrian Prantl2019-10-171-3/+2
| | | | llvm-svn: 375170
* Revert "[LLDB] [test] Use %clang_cl instead of build.py in a few tests"Martin Storsjo2019-10-172-5/+4
| | | | | | | This reverts SVN r375156, as it seems to have broken tests when run on macOS: http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/2706/console llvm-svn: 375163
* Modernize the rest of the Find.* API (NFC)Adrian Prantl2019-10-1752-710/+487
| | | | | | | | | | | | This patch removes the size_t return value and the append parameter from the remainder of the Find.* functions in LLDB's internal API. As in the previous patches, this is motivated by the fact that these parameters aren't really used, and in the case of the append parameter were frequently implemented incorrectly. Differential Revision: https://reviews.llvm.org/D69119 llvm-svn: 375160
* [LLDB] [test] Use %clang_cl instead of build.py in a few testsMartin Storsjo2019-10-172-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. Differential Revision: https://reviews.llvm.org/D69031 llvm-svn: 375156
* [lldb] Don't emit artificial constructor declarations as global functionsRaphael Isemann2019-10-175-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | Summary: When we have a artificial constructor DIE, we currently create from that a global function with the name of that class. That ends up causing a bunch of funny errors such as "must use 'struct' tag to refer to type 'Foo' in this scope" when doing `Foo f`. Also causes that constructing a class via `Foo()` actually just calls that global function. The fix is that when we have an artificial method decl, we always treat it as handled even if we don't create a CXXMethodDecl for it (which we never do for artificial methods at the moment). Fixes rdar://55757491 and probably some other radars. Reviewers: aprantl, vsk, shafik Reviewed By: aprantl Subscribers: jingham, shafik, labath, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68130 llvm-svn: 375151
* [Reproducer] Surface error if setting the cwd failsJonas Devlieghere2019-10-171-2/+7
| | | | | | | Make sure that we surface an error if setting the current working directory fails during replay. llvm-svn: 375146
* Disable TestProcessList on windowsWalter Erquinigo2019-10-171-0/+1
| | | | | | | | | | | | | | Summary: `platform process list -v` on windows doesn't show all the process arguments, making this test useless for that platform Reviewers: stella.stamenova Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69114 llvm-svn: 375144
* Fix an inverted condition in test.Adrian Prantl2019-10-171-3/+3
| | | | llvm-svn: 375127
* [ARC] Add SystemV ABITatyana Krasnukha2019-10-175-1/+737
| | | | | | Differential Revision: https://reviews.llvm.org/D55724 llvm-svn: 375123
* [ARC] Basic support in gdb-remote process pluginTatyana Krasnukha2019-10-175-1/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D55718 llvm-svn: 375122
* delete SWIG typemaps for FILE*Lawrence D'Anna2019-10-177-134/+10
| | | | | | | | | | | | | | | | | | Summary: The SWIG typemaps for FILE* are no longer used, so this patch deletes them. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68963 llvm-svn: 375073
* SBCommandReturnObject: change LLDB_RECORD_METHOD(..., FILE *, ...) to use ↵Fangrui Song2019-10-171-11/+10
| | | | | | | | | | | | | | | | | | | LLDB_RECORD_DUMMY POSIX says FILE is a typedef to a structure containing information about a file. The structure is unspecified, i.e. it may be an incomplete type, as is the case on musl (`struct _IO_FILE` is an implementation detail that is not exposed). `LLDB_RECORD_METHOD(..., (FILE *), ...)` transitively uses sizeof(FILE) and requires the structure to be complete. Change it to LLDB_RECORD_DUMMY to fix the build failure on musl (regression of D57475). Reviewed By: JDevlieghere, labath, lawrence_danna Differential Revision: https://reviews.llvm.org/D68872 llvm-svn: 375072
* [CMake] Make it possible to set the RPATH in add_lldb_exectable.Jonas Devlieghere2019-10-171-2/+15
| | | | | | | | | | | | | | Make it possible to pass a build and install RPATH to add_lldb_executable instead of having to call lldb_setup_rpaths after the fact. This fixes a real issue where setting an install RPATH with lldb_setup_rpaths would only affect the symroot installation component. Given that lldb_setup_rpaths sets a target property I would expect this to be orthogonal to installation components. Regardless, it makes sense to integrate this functionality in add_lldb_exectable. llvm-svn: 375068
* [Reproducer] Set the working directory in the VFSJonas Devlieghere2019-10-172-3/+14
| | | | | | | | | Now that the VFS knows how to deal with virtual working directories, we can set the current working directory to the one we recorded during reproducer capture. This ensures that relative paths are resolved correctly during replay. llvm-svn: 375064
* Revert "make ConstString allocate memory in non-tiny chunks"Raphael Isemann2019-10-171-7/+2
| | | | | | | | | | | | As discussed in https://reviews.llvm.org/D68549, the actual issue here seems to be that the BumpPtrAllocator is growing far too slow because of the 256 different StringPools used as the backend for ConstString. At the same time the original patch made ConstString allocate memory in 256MiB slabs for the same reason, meaning that the RSS usage of LLDB increased by a few hundred MiB for all users without bringing any noticeable speedup for most of them. llvm-svn: 375062
* [Reproducer] Support dumping the reproducer CWDJonas Devlieghere2019-10-173-3/+26
| | | | | | | Add support for dumping the current working directory with `reproducer dump -p cwd`. llvm-svn: 375061
* [Reproducer] Add LoadBuffer<> helper (NFC)Jonas Devlieghere2019-10-172-11/+13
| | | | | | | Introduce a helper method named LoadBuffer in the Loader to abstract reading a reproducer file from disk. llvm-svn: 375060
* [Reproducer] Capture the debugger's working directoryJonas Devlieghere2019-10-173-1/+47
| | | | | | | | This patch extends the reproducer to capture the debugger's current working directory. This information will be used later to set the current working directory of the VFS. llvm-svn: 375059
* [LLDB] Use the llvm microsoft demangler instead of the windows dbghelp api. ↵Martin Storsjo2019-10-161-41/+7
| | | | | | | | NFCI. Differential Revision: https://reviews.llvm.org/D68134 llvm-svn: 375034
* Add arm64_32 support to lldb, an ILP32 codegen Jason Molenda2019-10-1636-28/+123
| | | | | | | | | | that runs on arm64 ISA targets, specifically Apple watches. Differential Revision: https://reviews.llvm.org/D68858 llvm-svn: 375032
* [android/process list] support showing process argumentsWalter Erquinigo2019-10-168-126/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The qfProcessInfo and qsProcessInfo packets currently don't set the processes' arguments, however the platform process list -v command tries to print it. In this diff I'm adding the arguments as part of the packet, and now the command shows the arguments just like on mac. On Mac: 507 1 wallace 1876110778 wallace 1876110778 x86_64-apple-macosx /usr/libexec/secd 503 1 wallace 1876110778 wallace 1876110778 x86_64-apple-macosx /usr/libexec/secinitd 501 1 wallace 1876110778 wallace 1876110778 x86_64-apple-macosx /usr/libexec/languageassetd --firstLogin 497 1 wallace 1876110778 wallace 1876110778 x86_64-apple-macosx /usr/libexec/trustd --agent 496 1 wallace 1876110778 wallace 1876110778 x86_64-apple-macosx /usr/libexec/lsd 494 1 wallace 1876110778 wallace 1876110778 x86_64-apple-macosx /System/Library/Frameworks/CoreTelephony.framework/Support/CommCenter -L 491 1 wallace 1876110778 wallace 1876110778 x86_64-apple-macosx /usr/sbin/distnoted agent 489 1 wallace 1876110778 wallace 1876110778 x86_64-apple-macosx /usr/libexec/UserEventAgent (Aqua) 484 1 wallace 1876110778 wallace 1876110778 x86_64-apple-macosx /usr/sbin/cfprefsd agent 483 1 wallace 1876110778 wallace 1876110778 x86_64-apple-macosx /System/Library/Frameworks/LocalAuthentication.framework/Support/coreauthd On android: 1561 1016 root 0 0 aarch64-unknown-linux-android /system/bin/ip6tables-restore--noflush -w -v 1805 982 1000 1000 1000 android:drmService 1811 982 10189 10189 10189 com.qualcomm.embms:remote 1999 1 1000 1000 1000 aarch64-unknown-linux-android /system/bin/tlc_serverCCM 2332 982 10038 10038 10038 com.android.systemui 2378 983 1053 1053 1053 webview_zygote 2448 982 5013 5013 5013 com.sec.location.nsflp2 2465 982 10027 10027 10027 com.google.android.gms.persistent Differential Revision: https://reviews.llvm.org/D68293 llvm-svn: 375029
* [lldb] move more things from python to cmakeHaibo Huang2019-10-162-237/+23
| | | | | | | | | | | | | | Summary: Move the copy of six.py, lldb.py and macosx/heap Reviewers: labath Subscribers: mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69016 llvm-svn: 375024
* update ScriptInterpreterPython to use File, not FILE*Lawrence D'Anna2019-10-164-64/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: ScriptInterpreterPython needs to save and restore sys.stdout and friends when LLDB runs a python script. It currently does this using FILE*, which is not optimal. If whatever was in sys.stdout can not be represented as a FILE*, then it will not be restored correctly when the script is finished. It also means that if the debugger's own output stream is not representable as a file, ScriptInterpreterPython will not be able to redirect python's output correctly. This patch updates ScriptInterpreterPython to represent files with lldb_private::File, and to represent whatever the user had in sys.stdout as simply a PythonObject. This will make lldb interoperate better with other scripts or programs that need to manipulate sys.stdout. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68962 llvm-svn: 374964
* [lldb] Creates _liblldb symlink from cmakeHaibo Huang2019-10-152-283/+37
| | | | | | | | | | | | | | | | | Summary: This is another attempt of D67993. This change removed hard coded relative paths. This way we can generate correct result when get_python_lib() returns a different path, or LLDB_PYTHON_RELATIVE_PATH is specified directly. By moving things out of python, we are also able to correctly process more cross compile situations. E.g. .pyd vs .so for Windows. Subscribers: lldb-commits, mgorny Tags: #lldb Differential Revision: https://reviews.llvm.org/D68858 llvm-svn: 374953
* remove FILE* usage from SBStream.iLawrence D'Anna2019-10-154-3/+59
| | | | | | | | | | | | | | | | | | | | Summary: This patch removes FILE* and replaces it with SBFile and FileSP the SWIG interface for `SBStream.i`. And this is the last one. With this change, nothing in the python API will can access a FILE* method on the C++ side. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68960 llvm-svn: 374924
* eliminate virtual methods from PythonDataObjectsLawrence D'Anna2019-10-152-380/+121
| | | | | | | | | | | | | | | | | | | | | Summary: This patch eliminates a bunch of boilerplate from PythonDataObjects, as well as the use of virtual methods. In my opinion it also makes the Reset logic a lot more clear and easy to follow. The price is yet another template. I think it's worth it. Reviewers: JDevlieghere, jasonmolenda, labath, zturner Reviewed By: JDevlieghere, labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68918 llvm-svn: 374916
* convert SBDebugger::***FileHandle() wrappers to native files.Lawrence D'Anna2019-10-152-27/+75
| | | | | | | | | | | | | | | | | | | | Summary: This patch converts the swig wrappers for SetInputFileHandle() and friends to emulate the old behavior using SetInputFile(). This will clear the way for deleting the FILE* typemaps altogether. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: mehdi_amini, dexonsmith, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68856 llvm-svn: 374912
* SBFile::GetFile: convert SBFile back into python native files.Lawrence D'Anna2019-10-159-26/+200
| | | | | | | | | | | | | | | | | | | | | | Summary: This makes SBFile::GetFile public and adds a SWIG typemap to convert the result back into a python native file. If the underlying File itself came from a python file, it is returned identically. Otherwise a new python file object is created using the file descriptor. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68737 llvm-svn: 374911
* Increase gdbremote_testcase timeouts when running under ASAN.Adrian Prantl2019-10-151-5/+12
| | | | llvm-svn: 374906
OpenPOWER on IntegriCloud