summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
Commit message (Collapse)AuthorAgeFilesLines
...
* iwyu fixes on lldbUtility.Zachary Turner2017-04-061-0/+1
| | | | | | | | | | | | | This patch makes adjustments to header file includes in lldbUtility based on recommendations by the iwyu tool (include-what-you-use). The goal here is to make sure that all files include the exact set of headers which are needed for that file only, to eliminate cases of dead includes (e.g. someone deleted some code but forgot to delete the header includes that that code necessitated), and to eliminate the case where header includes are picked up transitively. llvm-svn: 299676
* Some old mach-o core files have an LC_IDENT load command Jason Molenda2017-04-061-3/+38
| | | | | | | | and there's a string in there that can be helpful in locating the kernel binary. Use it. <rdar://problem/31444711> llvm-svn: 299612
* Fix a typo introduce in r299200.Nitesh Jain2017-04-051-1/+1
| | | | llvm-svn: 299527
* Verify memory address range validity in GDBRemoteCommunicationClientStephane Sezer2017-03-311-7/+12
| | | | | | | | | | | | | | | | | | | | | Summary: This aims to verify the validity of the response from the debugging server in GDBRemoteCommunicationClient::GetMemoryRegionInfo. I was working with ds2 (https://github.com/facebook/ds2) and encountered a bug that caused the server's response to have a 'size' value of 0, which caused lldb to behave incorrectly. Reviewers: k8stone, labath, clayborg Reviewed By: labath, clayborg Subscribers: clayborg, sas, lldb-commits Differential Revision: https://reviews.llvm.org/D31485 Change by Alex Langford <apl@fb.com> llvm-svn: 299239
* [LLDB][MIPS] Core Dump Support.Nitesh Jain2017-03-3114-244/+442
| | | | | | | | | | Reviewers: labath, emaste Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D30457 llvm-svn: 299200
* [LLDB][MIPS] Fix Core file Architecture and OS information.Nitesh Jain2017-03-311-2/+17
| | | | | | | | | | Reviewers: labath, clayborg Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D31280 llvm-svn: 299199
* Battery of NetBSD support improvementsKamil Rytarowski2017-03-3010-52/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Include initial support for: - single step mode (PT_STEP) - single step trap handling (TRAP_TRACE) - exec() trap (TRAP_EXEC) - add placeholder interfaces for FPR - initial code for NetBSD core(5) files - minor tweaks While there improve style of altered elf-core/ files. This code raises the number of passing tests on NetBSD to around 50% (600+/1200+). The introduced code is subject to improve afterwards for additional features and bug fixes. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, emaste, kettenis Reviewed By: labath Subscribers: srhines, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31450 llvm-svn: 299109
* Add support for tracing hello-world application on NetBSDKamil Rytarowski2017-03-289-5/+1803
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is a stripped down from features a NetBSD process code (patch is kept under 2k LOC). This code has assumption that there is only one thread within a debugged process. The only debugger trap supported is software breakpoint (TRAP_BRKPT). The generic platform code requires to add dummy function for watchpoints etc. These functions are currently empty. This code is not the final platform support as is and it's treated as a base to extend, refactor and address issues afterwards. Supported features: - handle software breakpoints, - correctly attach to a tracee, - support NetBSD specific ptrace(2), - monitor process termination, - monitor SIGTRAP events, - monitor SIGSTOP events, - monitor other signals events, - resume the whole process, - get memory region info perms, - read memory from tracee, - write memory to tracee, - read ELF AUXV, - x86_64 GPR read and write code For the generic framework include: - halt, - detach, - signal, - kill, - allocatememory, - deallocatememory, - update threads, - getarchitecture, - getfileloadaddress, - and others. This code has preliminary AddThread code. Out of interest in this patch: - exec() traps, - hardware debug register traps, - single step trap, - thread creation/termination trap, - process fork(2), vfork(2) and vfork(2) done traps, - syscall entry and exit trap, - threads, - FPR registers, - retrieving tracee's thread name, - non x86_64 support. This code can be used to start a hello world application and trace it. This code can be used by other BSD systems as a starting point to get similar capabilities. Sponsored by <The NetBSD Foundation> Reviewers: emaste, joerg, kettenis, labath Subscribers: mgorny, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31374 llvm-svn: 298953
* [LLDB] OpenBSD supportKamil Rytarowski2017-03-267-0/+307
| | | | | | | | | | | | | | | | | | | | Summary: Add basic OpenBSD support. This is enough to be able to analyze core dumps for OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386. Note that part of the changes to source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp fix a bug that probably affects other platforms as well. The GetProgramHeaderByIndex() interface use 1-based indices, but in some case when looping over the headers the, the loop starts at 0 and misses the last header. This caused problems on OpenBSD since OpenBSD core dumps have the PT_NOTE segment as the last program header. Reviewers: joerg, labath, krytarowski Reviewed By: krytarowski Subscribers: aemerson, emaste, rengolin, srhines, krytarowski, mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D31131 llvm-svn: 298810
* Fix warnings from clang build on macOS.Bruce Mitchener2017-03-232-1/+1
| | | | | | | | | | Reviewers: lldb-commits Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31279 llvm-svn: 298585
* Delete some more dead includes.Zachary Turner2017-03-224-4/+0
| | | | | | | This breaks the cycle between Target and PluginLanguageC++, reducing the overall cycle count from 43 to 42. llvm-svn: 298561
* Move FileSpec from Host -> Utility.Zachary Turner2017-03-229-9/+9
| | | | llvm-svn: 298536
* Reuse appropriate Launch and Attach on NetBSDKamil Rytarowski2017-03-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD ships with NativeProcessNetBSD inherited from NativeProcessProtocol. Link Plugins/Process/gdb-remote with lldbPluginProcessNetBSD in order to resolve correctly the linking to Launch and Attach from the NetBSD plugin. Sponsored by <The NetBSD Foundation> Reviewers: kettenis, labath, emaste, joerg Reviewed By: labath, emaste Subscribers: mgorny, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31231 llvm-svn: 298524
* Break the cycle between Host and PluginProcessUtility.Zachary Turner2017-03-225-2/+87
| | | | | | | | | | | There are only two users of NativeRegisterContextRegisterInfo, and both are in process plugins. Moving this code from Host to Plugins/Process/Utility thus makes sense, and as it is the only dependency from Host -> PluginProcessUtility, it also breaks this cycle, reducing LLDB's overall cycle count from 45 to 44. llvm-svn: 298466
* Move StringList from Core -> Utility.Zachary Turner2017-03-212-2/+2
| | | | llvm-svn: 298412
* Add stub for PluginProcessNetBSDKamil Rytarowski2017-03-218-0/+233
| | | | | | | | | | | | | | | | | | | | | Summary: This is the base for introduction of further features to support Process Tracing on NetBSD, in local and remote setup. This code is also a starting point to synchronize the development with other BSDs. Currently NetBSD is ahead and other systems can catch up. Sponsored by <The NetBSD Foundation> Reviewers: emaste, joerg, kettenis, labath Reviewed By: labath Subscribers: mgorny, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31138 llvm-svn: 298408
* Enable AUXV and QPassSignals in gdb-remote for NetBSDKamil Rytarowski2017-03-212-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: NetBSD is an ELF platform and it uses Elf Auxiliary Vector like Linux and other modern BSDs. While there enable QPassSignals for the NetBSD port as well. Sponsored by <The NetBSD Foundation> Reviewers: labath, kettenis, joerg, emaste Reviewed By: labath Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31146 llvm-svn: 298407
* Remove ProcFileReaderPavel Labath2017-03-214-167/+25
| | | | | | | This removes the last usage of ProcFileReader from NativeProcessLinux and then deletes the class itself. llvm-svn: 298374
* Resubmit r298334 after fixing OSX build errors.Zachary Turner2017-03-211-7/+8
| | | | | | | Hopefully this works, I can't test since I don't have Mac hardware, however. llvm-svn: 298340
* Revert r298334 until Zachary has a chance to fix the buildbot failureJason Molenda2017-03-211-8/+7
| | | | | | on macosx. llvm-svn: 298338
* Delete various lldb FileSystem functions.Zachary Turner2017-03-211-7/+8
| | | | | | | | Use LLVM's equivalent versions instead. Differential Revision: https://reviews.llvm.org/D31111 llvm-svn: 298334
* Delete LLDB's MD5 code. Use LLVM instead.Zachary Turner2017-03-201-7/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D31108 llvm-svn: 298325
* Remove FileSystem::Get/SetFilePermissionsZachary Turner2017-03-191-2/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D31089 llvm-svn: 298205
* Remove FileSystem::MakeDirectory.Zachary Turner2017-03-191-1/+1
| | | | | | | | Have callers use llvm::sys::fs::create_directory() instead. Differential Revision: https://reviews.llvm.org/D31086 llvm-svn: 298203
* Fix FreeBSD build broken by r298066Pavel Labath2017-03-171-2/+4
| | | | llvm-svn: 298069
* Move GetAuxvData from Host to relevant process pluginsPavel Labath2017-03-175-50/+52
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: GetAuxvData was causing dependencies from host to target and linux process modules. It also does not fit netbsd use case, as there we can only read the auxiliary vector with ptrace, which is better done in the process plugin, with the other ptrace calls. I resolve these issues by moving the freebsd and linux versions into the relevant process plugins. In case of linux, this required adding an interface in NativeProcessProtocol. The empty definitions on other platforms can simply be removed. To get the code compiling I had to add ProcessGdbRemote -> ProcessLinux dependency, which was not caught before because we depended on it transitively. Reviewers: zturner, emaste Subscribers: srhines, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D31031 llvm-svn: 298066
* One more attempt to fix FreeBSDPavel Labath2017-03-171-0/+4
| | | | | | | | It seems sysctl.h is not self-contained, as I get missing symbols in the header itself now. I am going to include all files that the file I moved this from included, and hope that is enough. llvm-svn: 298063
* Speculative build fix for FreeBSDPavel Labath2017-03-171-1/+3
| | | | | | broken by r298058. llvm-svn: 298061
* Remove HostThreadLinux/Free/NetBSDPavel Labath2017-03-172-12/+42
| | | | | | | | | | | | | | | | | | | | | | Summary: These classes existed only because of the GetName() static function, which can be moved to a more natural place anyway. I move the linux version to NativeProcessLinux (and get rid of ProcFileReader), the freebsd version to ProcessFreeBSD (and fix a bug where it was using the current process ID, instead of the inferior pid), and remove the NetBSD version (which was probably incorrect anyway, as it assumes the current process instead of the inferior. I also add an llgs test to that verifies thread names are read correctly. Reviewers: zturner, krytarowski, emaste Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D30981 llvm-svn: 298058
* Fix windows&darwin builds broken by r297812Pavel Labath2017-03-152-2/+0
| | | | llvm-svn: 297819
* Remove lldb streams from the Log class completelyPavel Labath2017-03-151-1/+0
| | | | | | | | | | | | | | | | | | | | | Summary: previously we switched to llvm streams for log output, this completes the switch for the error streams. I also clean up the includes and remove the unused argument from DisableAllLogChannels(). This required adding a bit of boiler plate to convert the output in the command interpreter, but that should go away when we switch command results to use llvm streams as well. Reviewers: zturner, eugene Subscribers: lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D30894 llvm-svn: 297812
* Resubmit FileSystem changes.Zachary Turner2017-03-083-7/+10
| | | | | | | | | | This was originall reverted due to some test failures in ModuleCache and TestCompDirSymlink. These issues have all been resolved and the code now passes all tests. Differential Revision: https://reviews.llvm.org/D30698 llvm-svn: 297300
* Make LLDB skip server-client roundtrip for signals that don't require any ↵Eugene Zemtsov2017-03-074-1/+80
| | | | | | | | | | | | | | actions If QPassSignals packaet is supported by lldb-server, lldb-client will utilize it and ask the server to ignore signals that don't require stops or notifications. Such signals will be immediately re-injected into inferior to continue normal execution. Differential Revision: https://reviews.llvm.org/D30520 llvm-svn: 297231
* Revert "Use LLVM for all stat-related functionality."Pavel Labath2017-03-073-10/+7
| | | | | | | | | | | | | | | this reverts r297116 because it breaks the unittests and TestCompDirSymlink. The ModuleCache unit test is trivially fixable, but the CompDirSymlink failure is a symptom of a deeper problem: llvm's stat functionality is not a drop-in replacement for lldb's. The former is based on stat(2) (which does symlink resolution), while the latter is based on lstat(2) (which does not). This also reverts subsequent build fixes (r297128, r297120, 297117) and r297119 (Remove FileSpec dependency on FileSystem) which builds on top of this. llvm-svn: 297139
* Fix FreeBSD build.Zachary Turner2017-03-071-2/+3
| | | | llvm-svn: 297120
* Use LLVM for all stat-related functionality.Zachary Turner2017-03-073-6/+8
| | | | | | | | | | This deletes LLDB's FileType enumeration and replaces all users, and all calls to functions that check whether a file exists etc with corresponding calls to LLVM. Differential Revision: https://reviews.llvm.org/D30624 llvm-svn: 297116
* Remove dependency from FileSpec to ArchSpec.Zachary Turner2017-03-061-3/+4
| | | | | | | All it really needs is the llvm::Triple, so make FileSpec take the Triple directly instead of the ArchSpec. llvm-svn: 297096
* Remove FileSpec::ReadFileContents.Zachary Turner2017-03-063-4/+8
| | | | | | | | | | | | | | | | This functionality is subsumed by DataBufferLLVM, which is also more efficient since it will try to mmap. However, we don't yet support mmaping writable private sections, and in some cases we were using ReadFileContents and then modifying the buffer. To address that I've added a flag to the DataBufferLLVM methods that allow you to map privately, which disables the mmaping path entirely. Eventually we should teach DataBufferLLVM to use mmap with writable private, but that is orthogonal to this effort. Differential Revision: https://reviews.llvm.org/D30622 llvm-svn: 297095
* Move many other files from Core -> Utility.Zachary Turner2017-03-065-5/+5
| | | | llvm-svn: 297043
* Delete LLDB's code for getting / setting thread name.Zachary Turner2017-03-042-4/+4
| | | | | | | This is now functionality in LLVM, and all callers have already been updated to use the LLVM functions. llvm-svn: 296946
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-0453-72/+72
| | | | llvm-svn: 296943
* Move UUID from Core -> Utility.Zachary Turner2017-03-042-2/+2
| | | | llvm-svn: 296941
* Fix the macOS build all the way after r296909.Jim Ingham2017-03-041-72/+91
| | | | llvm-svn: 296938
* Fix DataExtractor failures.Zachary Turner2017-03-031-8/+5
| | | | | | | Some code that doesn't get compiled on Windows had some references that needed updating, and I missed those. llvm-svn: 296930
* Move Log from Core -> Utility.Zachary Turner2017-03-0342-43/+43
| | | | | | | | | All references to Host and Core have been removed, so this class can now safely be lowered into Utility. Differential Revision: https://reviews.llvm.org/D30559 llvm-svn: 296909
* Fix various warnings. NFCZachary Turner2017-03-022-7/+6
| | | | llvm-svn: 296717
* Merge Linux and FreeBSD arm register contextsPavel Labath2017-02-278-195/+32
| | | | | | | | | | | | | | Summary: These two register contexts were identical, so this shouldn't cause any regressions, but I'd appreciate it if you can check that this at least compiles. Reviewers: emaste, sas Subscribers: aemerson, rengolin, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D27126 llvm-svn: 296335
* Delete DataBufferMemoryMap.Zachary Turner2017-02-241-9/+15
| | | | | | | | | | | | | | | After a series of patches on the LLVM side to get the mmaping code up to compatibility with LLDB's needs, it is now ready to go, which means LLDB's custom mmapping code is redundant. So this patch deletes it all and uses LLVM's code instead. In the future, we could take this one step further and delete even the lldb DataBuffer base class and rely entirely on LLVM's facilities, but this is a job for another day. Differential Revision: https://reviews.llvm.org/D30054 llvm-svn: 296159
* Hardware breakpoints for Linux on Arm/AArch64 targetsOmair Javaid2017-02-249-114/+330
| | | | | | | | Please look at below differential link for upstream discussion. Differential revision: https://reviews.llvm.org/D29669 llvm-svn: 296119
* Implement QPassSignals GDB package in lldb-serverPavel Labath2017-02-245-5/+48
| | | | | | | | | | | | | | | Summary: QPassSignals package allows lldb client to tell lldb-server to ignore certain types of signals and re-inject them back to inferior without stopping execution. Reviewers: jmajors, labath Subscribers: danalbert, srhines, emaste, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D30286 Author: Eugene Zemtsov <ezemtsov@google.com> llvm-svn: 296101
OpenPOWER on IntegriCloud