summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* PR31214: Make a test tolerate "line 0" when stepping by instruction.Paul Robinson2016-11-301-4/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D27282 llvm-svn: 288282
* Fix handling of consecutive slashes in FileSpec::GetNormalizedPath()Pavel Labath2016-11-302-1/+5
| | | | | | | | | | The core of the function was actually handling them correctly. However, the early exit was being too optimistic and did not give the function a chance to fire if the path did not contain dots as well. Fix that and add a couple of unit tests. llvm-svn: 288247
* Convert most of the Process class to Timeout<>Pavel Labath2016-11-304-91/+64
| | | | | | | | | | | This changes most of the class to use the new Timeout class. The one function left is RunThreadPlan, which I left for a separate change as the function is massive. A couple of things to call out: - I've renamed the affected functions to match the listener interface names. This should also help catch any places I did not convert at compile time. - I've deleted the WaitForState function as it was unused. llvm-svn: 288241
* Fix OSX build for r288238Pavel Labath2016-11-301-2/+3
| | | | llvm-svn: 288239
* Use Timeout<> in the Listener classPavel Labath2016-11-3012-160/+125
| | | | | | | | | | | | | | | | | | | | Summary: Communication classes use the Timeout<> class to specify the timeout. Listener class was converted to chrono some time ago, but it used a different meaning for a timeout of zero (Listener: infinite wait, Communication: no wait). Instead, Listener provided separate functions which performed a non-blocking event read. This converts the Listener class to the new Timeout class, to improve consistency. It also allows us to get merge the different GetNextEvent*** and WaitForEvent*** functions into one. No functional change intended. Reviewers: jingham, clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D27136 llvm-svn: 288238
* Remove a spurious reference to ProcessElfCorePavel Labath2016-11-302-7/+1
| | | | | | | | | | | We were referencing a the process class from a register context, which seems intuitively wrong. Also, the comment above that code is now definitely incorrect, as ProcessElfCore now does support floating point registers. Also, the code wasn't really doing anything, as it was just skipping a zero-initialization of a field that was most likely zero-initialized anyway. Linux elf core FPR test still passes after this. llvm-svn: 288237
* Remove an x86-ism from RegisterInfoInterfacePavel Labath2016-11-306-16/+1
| | | | | | | | | | | | | | | | | Summary: While adding FPR support to x86 elf core files (D26300), we ended up adding a very x86-specific function to the general RegisterInfoInterface class, which I didn't catch in review. This removes that function. The only reason we needed it was to find the offset of the FXSAVE area. This is the same as the offset of the first register within that area, so we might as well use that. Reviewers: clayborg, dvlahovski Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D27222 llvm-svn: 288236
* Add back some of the previous lldb-server dependenciesPavel Labath2016-11-291-0/+5
| | | | | | | | It seems a debug build of lldb-server will not complete without these, as the linker is not able to strip out code that aggressively. Add those back until I can figure out how to break the dependency chains. llvm-svn: 288181
* Remove some OS-specific plugins from lldb-server dependenciesPavel Labath2016-11-291-29/+0
| | | | | | | | I don't believe the code in those plugins could be in any way useful for lldb-server, but I can't be sure if this will break some transitive dependencies. Builtbots should be able to tell us that. llvm-svn: 288169
* Remove assorted other plugins which are not needed by lldb-serverPavel Labath2016-11-291-14/+0
| | | | | | language runtime, structured data, sanitizers, process plugins. llvm-svn: 288166
* Remove dynamic loader, platform and ABI plugins from lldb-server dependenciesPavel Labath2016-11-291-27/+0
| | | | | | These packages are not used on the server. llvm-svn: 288164
* Specify the dependencies of lldb-server manuallyPavel Labath2016-11-291-1/+209
| | | | | | | | | | | | | | | | | | | | | Summary: This basically just inlines the LLDBDependencies.cmake file into lldb-server CMakeLists.txt. The reason is that most of these dependencies are not actually necessary for lldb-server (some of them can't be removed because of cross-dependencies, but most of the plugins can). I intend to start cleaning these up in follow-up commits, but I want to do this first, so the subsequent ones can be easily reverted if they don't build in some configurations. When I cleaned these up locally, I was able to get a 30%--50% improvement in lldb-server size. Reviewers: zturner, beanz, tfiala Subscribers: danalbert, srhines, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D26975 llvm-svn: 288159
* Remove ConnectionSharedMemoryPavel Labath2016-11-294-214/+0
| | | | | | This class is unused. llvm-svn: 288122
* Fix a typo.Hafiz Abid Qadeer2016-11-291-1/+1
| | | | llvm-svn: 288118
* Remove ConnectionMachPortPavel Labath2016-11-294-345/+0
| | | | | | | | | | | | | | Summary: This class is unused, and since the StringRef refactor, it does not even implement the Connection interface. Reviewers: clayborg, jingham Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D27134 llvm-svn: 288117
* [lldb] Fix compilation of SymbolFileDWARF.cpp with ENABLE_DEBUG_PRINTF setAlexander Shaposhnikov2016-11-291-1/+2
| | | | | | | | This diff adds missing semicolon in SymbolFileDWARF.cpp Differential revision: https://reviews.llvm.org/D27177 llvm-svn: 288094
* fix up Xcode build for r287916Todd Fiala2016-11-281-12/+6
| | | | llvm-svn: 288044
* Fix floating point register reads x86_64 linux on targets with no AVX supportPavel Labath2016-11-281-3/+14
| | | | | | | | | | | | | | | | Summary: On for 64-bit targets, the correct register set to read the fxsave are is NT_PRFPREG (only 32-bit targets need NT_PRXFPREG, presumably for historic reasons). Reference: <https://github.com/torvalds/linux/blob/v4.8/arch/x86/kernel/ptrace.c#L1261>. Reviewers: tberghammer, valentinagiusti Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D27161 llvm-svn: 288038
* XFAIL: TestNoreturnUnwind on android x86_64Pavel Labath2016-11-281-0/+1
| | | | llvm-svn: 288032
* skip android in @skipIfHostIncompatibleWithRemotePavel Labath2016-11-281-1/+3
| | | | | | | | | | | | The current implementation of the decorator does not skip if the android target arch is the same as host arch (as in both cases the platform comes out as linux). Nonetheless android x86_64 binaries are not compatible with linux ones. Technically this should be "skip if target is android and host is *not* android", but currently nobody runs lldb test suite on an android host, so we don't even have a way of specifying that the host is android. llvm-svn: 288027
* Fix a crash in ProcessPOSIXLogPavel Labath2016-11-281-2/+2
| | | | | | | We are getting a null pointer for the list of categories here (presumably due to the args refactor). llvm-svn: 288026
* [lldb] Fix typos in file headersAlexander Shaposhnikov2016-11-2659-65/+102
| | | | | | | | | | | | | This diff fixes typos in file headers (incorrect file names). Test plan: Under llvm/tools/lldb/source: find ./* -type f | grep -e '\(cpp\|h\)$' | while read F; do B=$(basename $F); echo $F head -n 1 $F | grep -v $B | wc -l ; done Differential revision: https://reviews.llvm.org/D27115 llvm-svn: 287966
* Fix builds Windows and OSX builds after Connection refactor in r287922Pavel Labath2016-11-254-7/+14
| | | | | | | | | Switch various bits of platform-specific code to chrono that I did not notice when doing a linux build. This exposed a bug that ConnectionGenericFileWindows did not handle the magic UINT32_MAX timeout value (instead it waited for about an hour, which is close enough I guess). Fix that as well. llvm-svn: 287927
* Fix darwin build broken by r287920Pavel Labath2016-11-251-2/+1
| | | | | | I accidentally used the wrong brackets when including llvm headers. llvm-svn: 287923
* Introduce Chrono to the Connection class. NFCI.Pavel Labath2016-11-258-29/+29
| | | | llvm-svn: 287922
* Fix FreeBSD build error in r287920Pavel Labath2016-11-251-2/+4
| | | | | | | The conditional expression is ambiguous there, so help it by explicitly casting. This will go away once we use chrono all the way down. llvm-svn: 287921
* Introduce chrono to the Communication classPavel Labath2016-11-259-60/+113
| | | | | | | | This replaces the raw integer timeout parameters in the class with their chrono-based equivalents. To achieve this, I have moved the Timeout class to a more generic place and added a quick unit test for it. llvm-svn: 287920
* Use Clang for D language support.Johan Engelen2016-11-251-1/+3
| | | | | | Differential revision: https://reviews.llvm.org/D24794 llvm-svn: 287917
* Merge Linux and FreeBSD arm64 register contextsPavel Labath2016-11-258-199/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a test-the-water change about possibilities of reducing duplication in the register context definitions. I've named the new class RegisterInfoPOSIX, as RegisterContextPOSIX was already taken :(. The two files were identical except for a fix by Tamas in D12636, which was applied to the Linux version only, which fixed a discrepancy between the definitions of fpsr and fpcr on one hand, and all other floating point register definitions on the other. Linux test suite still passes after this change. For freebsd, make the floating point register behavior consistent, but I don't know whether it will be consistently fixed, or consistently broken. By eyeballing the code, I have a feeling that a similar fix to D12636 will be required in RegisterContextPOSIXProcessMonitor_arm64::ReadRegister, but I can't be sure as I have no way to test it (the assert in that function should fire upon accessing the registers if it is wrong though). Reviewers: emaste, clayborg Subscribers: aemerson, rengolin, beanz, mgorny, modocache, dmikulin, lldb-commits Differential Revision: https://reviews.llvm.org/D25947 llvm-svn: 287916
* Add a couple of tests for the Listener classPavel Labath2016-11-242-0/+115
| | | | | | | I'm considering doing some refactor there, so I am adding these to guard the current behavior. llvm-svn: 287896
* Fix TestMiExec.test_lldbmi_exec_next_instructionPavel Labath2016-11-241-1/+1
| | | | | | | | The line numbers come out slightly differently when the test is run with gcc-4.9 as a compiler. The test probably should not depend on that, but that is a different story. llvm-svn: 287893
* Enable MiExecTestCase-test_lldbmi_exec_next_instructionPavel Labath2016-11-241-3/+0
| | | | | | Test passes consistently, at least on linux. llvm-svn: 287887
* Enable TestMultithreaded-sb_api_listener_event_process_state on linux/gccPavel Labath2016-11-241-8/+0
| | | | | | Passing consistently now. llvm-svn: 287885
* Enable TestBitfields on linux with clangPavel Labath2016-11-241-7/+0
| | | | | | The test has been passing for a while now. llvm-svn: 287884
* Enable TestRegisterVariables for some configurationsPavel Labath2016-11-241-5/+2
| | | | | | It consistently passes for linux-clang-i386, and linux-gcc-x86_64. llvm-svn: 287883
* Enable WatchpointPythonCommandTestCase-test_continue_in_watchpoint_commandPavel Labath2016-11-241-2/+0
| | | | | | | | This test passes consistently on linux, so I am removing the overall XFAIL. If it fails on your configuration, please put a targeted xfail instead (i'll add them my self if I get any breakage emails). llvm-svn: 287881
* Use more chrono in AdbClientPavel Labath2016-11-243-11/+13
| | | | | | This refactors AdbClient interface in terms of std::chrono. llvm-svn: 287880
* Use chrono in AdbClientPavel Labath2016-11-242-29/+19
| | | | | | | This refactors the class implementations to use chrono. I'll follow this up with a refactor of the class interface. llvm-svn: 287879
* Attempt to fix freebsd build after r287864Pavel Labath2016-11-242-8/+10
| | | | | | | | | | the chrono library there uses long long as the underlying chrono type, but defines int64_t as long (or the other way around, I am not sure). In any case, this caused the implicit conversion to not trigger. This should address that. Also fix up the relevant unit test. llvm-svn: 287867
* Introduce chrono to more gdb-remote functionsPavel Labath2016-11-248-105/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This replaces the usage of raw integers with duration classes in the gdb-remote packet management functions. The values are still converted back to integers once they go into the generic Communication class -- that I am leaving to a separate change. The changes are mostly straight-forward (*), the only tricky part was representation of infinite timeouts. Currently, we use UINT32_MAX to denote infinite timeout. This is not well suited for duration classes, as they tend to do arithmetic on the values, and the identity of the MAX value can easily get lost (e.g. microseconds(seconds(UINT32_MAX)).count() != UINT32_MAX). We cannot use zero to represent infinity (as Listener classes do) because we already use it to do non-blocking polling reads. For this reason, I chose to have an explicit value for infinity. The way I achieved that is via llvm::Optional, and I think it reads quite natural. Passing llvm::None as "timeout" means "no timeout", while passing zero means "poll". The only tricky part is this breaks implicit conversions (seconds are implicitly convertible to microseconds, but Optional<seconds> cannot be easily converted into Optional<microseconds>). For this reason I added a special class Timeout, inheriting from Optional, and enabling the necessary conversions one would normally expect. (*) The other tricky part was GDBRemoteCommunication::PopPacketFromQueue, which was needlessly complicated. I've simplified it, but that one is only used in non-stop mode, and so is untested. Reviewers: clayborg, zturner, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D26971 llvm-svn: 287864
* Remove \x13 (^S) character that was likely added by mistake.Adrian Kuegel2016-11-241-1/+1
| | | | | | | | | r287386 added a \x13 character inside a string literal. Most likely this was by mistake, so remove it. Differential Revision: https://reviews.llvm.org/D26973 llvm-svn: 287862
* Patch for lldb bug 26322 “core load hangs”Howard Hellyer2016-11-244-0/+0
| | | | | | Correct 0 byte core files uploaded by arc. llvm-svn: 287861
* Patch for lldb bug 26322 “core load hangs”Howard Hellyer2016-11-2415-2/+477
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch changes the way ProcessElfCore.cpp handles signal information. The patch changes ProcessElfCore.cpp to use the signal from si_signo in SIGINFO notes in preference to the value of cursig in PRSTATUS notes. The value from SIGINFO seems to be more thread specific. The value from PRSTATUS is usually the same for all threads even if only one thread received a signal. If it cannot find any SIGINFO blocks it reverts to the old behaviour and uses the value from cursig in PRSTATUS. If after that no thread appears to have been stopped it forces the status of the first thread to be SIGSTOP to prevent lldb hanging waiting for any thread from the core file to change state. The order is: - If one or more threads have a non-zero si_signo in SIGINFO that will be used. - If no threads had a SIGINFO block with a non-zero si_signo set all threads signals to the value in cursig in their PRSTATUS notes. - If no thread has a signal set to a non-zero value set the signal for only the first thread to SIGSTOP. This resolves two issues. The first was identified in bug 26322, the second became apparent while investigating this problem and looking at the signal values reported for each thread via “thread list”. Firstly lldb is able to load core dumps generated by gcore where each thread has a SIGINFO note containing a signal number but cursig in the PRSTATUS block for each thread is 0. Secondly if a SIGINFO note was found the “thread list” command will no longer show the same signal number for all threads. At the moment if a process crashes, for example with SIGILL, all threads will show “stop reason = signal SIGILL”. With this patch only the thread that executed the illegal instruction shows that stop reason. The other threads show “stop reason = signal 0”. Reviewers: jingham, clayborg Subscribers: sas, labath, lldb-commits Differential Revision: https://reviews.llvm.org/D26676 llvm-svn: 287858
* Fix a comparison of integers of different signs warning.Taras Tsugrii2016-11-241-1/+1
| | | | | | | | | | source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:403:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] for (int i = 0; i < llvm::array_lengthof (magicks); i++) ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Differential Revision: https://reviews.llvm.org/D27081 llvm-svn: 287848
* Refactor LLDB's Windows process plugin (NFC)Adrian McCarthy2016-11-2325-1764/+1230
| | | | | | | | | | | | | | | | | | | | The Windows process plugin was broken up into multiple pieces a while back in order to share code between debugging live processes and minidumps (postmortem) debugging. The minidump portion was replaced by a cross-platform solution. This left the plugin split into a formerly "common" base classes and the derived classes for live debugging. This extra layer made the code harder to understand and work with. This patch simplifies these class hierarchies by rolling the live debugging concrete classes up to the base classes. Last week I posted my intent to make this change to lldb-dev, and I didn't hear any objections. This involved moving code and changing references to classes like ProcessWindowsLive to ProcessWindows. It still builds for both 32- and 64-bit, and the tests still pass on 32-bit. (Tests on 64-bit weren't passing before this refactor for unrelated reasons.) llvm-svn: 287770
* Re-add "demonstrate new Args API"Zachary Turner2016-11-228-92/+90
| | | | | | This fixes the build breakage due to the use of C++14. llvm-svn: 287647
* Improve detection of global vs local variablesSam McCall2016-11-221-12/+16
| | | | | | | | | | | | | | | | | | Summary: Improve detection of global vs local variables. Currently when a global variable is optimized out or otherwise has an unknown location (DW_AT_location is empty) it gets reported as local. I added two new heuristics: - if a mangled name is present, the variable is global (or static) - if DW_AT_location is present but invalid, the variable is global (or static) Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D26908 llvm-svn: 287636
* Fix build failure on Linux and BSD by reverting r287597Omair Javaid2016-11-228-88/+92
| | | | | | Linux and BSD builds failing after this changes from rev 287597. llvm-svn: 287631
* Turn on LLDB_EDITLINE_USE_WCHAR on FreeBSDEd Maste2016-11-221-1/+1
| | | | llvm-svn: 287609
* Fix a bug caught by adding LLVM_NODISCARD to StringRef.Zachary Turner2016-11-211-1/+1
| | | | llvm-svn: 287598
OpenPOWER on IntegriCloud