summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Reorg code to allow Windows Process Plugins to share some common code.Adrian McCarthy2015-08-241-1016/+0
| | | | | | Differential Revision: http://reviews.llvm.org/D12252 llvm-svn: 245850
* [ProcessWindows] Fix rare crash on shutdown.Zachary Turner2015-08-201-0/+3
| | | | | | | | There might be an underlying race condition here that should be figured out, but this at least prevents the crash for the time being and doesn't appear to have any adverse effects. llvm-svn: 245626
* Load executable module when attaching to process; implement detach from process.Adrian McCarthy2015-06-191-6/+105
| | | | llvm-svn: 240157
* Silence warning on Windows.Chaoren Lin2015-06-081-1/+2
| | | | llvm-svn: 239284
* Fix race condition when detaching/killing an inferior.Zachary Turner2015-05-211-13/+26
| | | | llvm-svn: 237945
* Implement attach to process on Windows.Zachary Turner2015-05-201-37/+102
| | | | | | | Differential Revision: http://reviews.llvm.org/D9801 Reviewed by: Adrian McCarthy llvm-svn: 237817
* Enable debugging of multithreaded programs on Windows.Adrian McCarthy2015-05-181-11/+17
| | | | llvm-svn: 237637
* Reverting r237392 since it broke TestNumThreads on ubuntu builder.Oleksiy Vyalov2015-05-151-17/+11
| | | | llvm-svn: 237415
* Enable multithreaded debugging on Windows.Adrian McCarthy2015-05-141-11/+17
| | | | llvm-svn: 237392
* Add logging to ProcessWindows.Zachary Turner2015-05-071-35/+200
| | | | llvm-svn: 236776
* Add missing semicolon in the windows plugin.Benjamin Kramer2015-04-031-1/+1
| | | | llvm-svn: 234007
* Sprinkle some #include <mutex> in files that use std::call_once.Benjamin Kramer2015-04-031-0/+1
| | | | llvm-svn: 234005
* [Plugin/Process] Use std::call_once() to initialize.Davide Italiano2015-04-031-3/+2
| | | | | | | | This replaces the home-grown initialization mechanism used before. Differential Revision: http://reviews.llvm.org/D8760 llvm-svn: 233999
* Fix warnings generated by clang-cl.Zachary Turner2015-04-021-5/+2
| | | | | | | | | | | | | | There were a couple of real bugs here regarding error checking and signed/unsigned comparisons, but mostly these were just noise. There was one class of bugs fixed here which is particularly annoying, dealing with MSVC's non-standard behavior regarding the underlying type of enums. See the comment in lldb-enumerations.h for details. In short, from now on please use FLAGS_ENUM and FLAGS_ANONYMOUS_ENUM when defining enums which contain values larger than can fit into a signed integer. llvm-svn: 233943
* Further reduce the header footprint of Process.hZachary Turner2015-03-031-0/+1
| | | | | | | No functional change here, only deletes unnecessary headers and moves one function's body from the .h file to the .cpp. llvm-svn: 231145
* Revert "Fix warnings found with clang-cl."Zachary Turner2015-02-251-2/+5
| | | | | | | SWIG doesn't like enum : unsigned. Revert this until I can fix this in a way that swig likes. llvm-svn: 230531
* Solve hang on Windows when lldb fails to launch the process.Zachary Turner2015-02-251-0/+4
| | | | | | | | | | | | | | The DebuggerThread was detecting the launch error, but it was ignored by ProcessWindows::DoLaunch, causing LLDB to wait forever in the debugger loop. This fixes the test case that explicitly attempts to launch a process from a non-existant path. Patch by Adrian McCarthy Differential Revision: http://reviews.llvm.org/D7874 llvm-svn: 230523
* Fix warnings found with clang-cl.Zachary Turner2015-02-251-5/+2
| | | | | | | | | | | Earlier this week I was able to get clang-cl on Windows to be able to self host. This opened the door to being able to get a whole new slew of warnings for the Windows build. This patch fixes all of the warnings, many of which were real bugs. llvm-svn: 230522
* Implement ProcessWindows::GetMemoryRegionInfo.Zachary Turner2015-01-211-0/+38
| | | | llvm-svn: 226742
* Some fixes for thread stepping on Windows.Zachary Turner2015-01-151-23/+27
| | | | | | | | | | | | | This hooks up the changes necessary to set the trap flag on the CPU and properly manage the process and thread's resume state and private state so that the ThreadPlan does its thing. Stepping still doesn't work as of this change, because there are some issues with stack frames where it doesn't update the thread's frame list correctly when it breaks inside of a function, but I will try to fix that separately. llvm-svn: 226221
* Only set the StopInfo on Windows if the stop is valid for this thread.Zachary Turner2015-01-141-7/+3
| | | | llvm-svn: 226054
* Fix a number of tests on Windows.Zachary Turner2015-01-141-1/+1
| | | | | | | These fix various issues with path handling and disable a few tests which use features of LLVM which are not yet supported on Windows. llvm-svn: 226042
* Remove a lock acquisition from ProcessWindows::OnExitProcess.Zachary Turner2015-01-061-11/+12
| | | | | | | | | | | | | This was causing a race condition where DoDestroy() would acquire the lock and then initiate a shutdown and then wait for it to complete. But part of the shutdown involved acquiring the same lock from a different thread. So the main thread would timeout waiting for the shutdown to complete and return too soon. The end result of this is that SBProcess::Kill() was broken on Windows. llvm-svn: 225297
* Fix some test failures for Windows.Zachary Turner2014-12-101-2/+43
| | | | llvm-svn: 223982
* Create a valid stop info for all non-breakpoint exceptions.Zachary Turner2014-12-091-2/+12
| | | | llvm-svn: 223812
* Subtract the size of the breakpoint opcode from the PC when getting the bp site.Zachary Turner2014-12-051-0/+4
| | | | llvm-svn: 223498
* Load / unload modules in the target when the OS events occur.Zachary Turner2014-12-051-2/+17
| | | | | | | This causes all deferred breakpoints to be correctly resolved as the modules that they reside in are loaded. llvm-svn: 223497
* Manually call ModulesDidLoad when the executable is loaded.Zachary Turner2014-12-031-0/+11
| | | | | | | | | This is a temporary workaround to get deferred breakpoint resolution working until Bug 21720 is addressed. Even with this workaround, it will only resolve deferred breakpoints in the executable module, and not in a shared library. llvm-svn: 223273
* Correctly shutdown when DoDestroy is called with an active exception.Zachary Turner2014-12-031-26/+23
| | | | | | | | | | | | | | | | | | | | | Previously if we got a DoDestroy while stopped at a breakpoint, we would detach and then say the process had exited. This is completely wrong, as it resulted in the python script incorrectly assuming that the process had actually exited and trying to delete the image, when in fact it had done no such thing. The fix employed here is that when we get a DoDestroy, we do 3 steps: 1) initiate a termination sequence on the process 2) If we were stopped handling an exception of any kind, mask it and let the program resume, causing the program to see the termination request and exit on its own. 3) Let the program exit normally, and close all of our handles before returning control back to DoDestroy. This fixes Bug 21722 and Bug 21723. llvm-svn: 223272
* Enable enabling and disabling breakpoints on Windows.Zachary Turner2014-12-011-0/+12
| | | | llvm-svn: 223089
* When a process stops, set the StopInfo object on Windows.Zachary Turner2014-11-251-0/+37
| | | | llvm-svn: 222776
* Disable GetSTDOUT, GetSTDERR, and PutSTDIN on Windows.Zachary Turner2014-11-251-0/+20
| | | | | | | | | | These methods are difficult / impossible to implement in a way that is semantically equivalent to the expectations set by LLDB for using them. In the future, we should find an alternative strategy (for example, i/o redirection) for achieving similar functionality, and hopefully deprecate these APIs someday. llvm-svn: 222775
* [ProcessWindows] Implement a RegisterContextWindows for x86.Zachary Turner2014-11-201-0/+1
| | | | | | | | | | | | | | | This implements the skeleton of a RegisterContext for Windows. In particular, this implements support only for x86 general purpose registers. After this patch, LLDB on Windows can perform basic debugging operations in a single-threaded inferior process (breakpoint, register inspection, frame select, unwinding, etc). Differential Revision: http://reviews.llvm.org/D6322 Reviewed by: Greg Clayton llvm-svn: 222474
* Change HostThread::GetNativeThread() to return a derived reference.Zachary Turner2014-11-171-3/+3
| | | | | | | | Previously using HostThread::GetNativeThread() required an ugly cast to most-derived type. This solves the issue by simply returning the derived type directly. llvm-svn: 222185
* Move the thread logic around to fit better into LLDB's process model.Zachary Turner2014-11-171-19/+64
| | | | | | | | | | | Previously we were directly updating the thread list and stopping and restarting the process every time threads were created. With this patch, we queue up thread launches and thread exits, resolve these all internally, and only update the threads when we get an UpdateThreadList call. We now only update the private state on an actual stop (i.e. breakpoint). llvm-svn: 222178
* [ProcessWindows] Create a TargetThreadWindows class.Zachary Turner2014-11-171-17/+35
| | | | | | | | | | | This creates a TargetThreadWindows class and updates the thread list of the Process with the main thread. Additionally, we fill out a few more overrides of Process base class methods. We do not yet update the thread list as threads are created and/or destroyed, and we do not yet propagate stop reasons to threads as their states change. llvm-svn: 222148
* [ProcessWindows] Implement read / write process memory.Zachary Turner2014-11-171-2/+28
| | | | llvm-svn: 222147
* [ProcessWindows] Improve support for launching processes.Zachary Turner2014-11-121-41/+114
| | | | | | | | | | | | | This sends notifications for module load / unload to the process plugin, and also manages the state more accurately during the loading sequence. Similar work by Virgile Bello was referenced during the implementation of this patch. Differential Revision: http://reviews.llvm.org/D6224 llvm-svn: 221807
* [ProcessWindows] Simplify the DebugDelegate interface.Zachary Turner2014-11-121-13/+11
| | | | | | | | | | | Due to a previous multi-threaded design involving message passing, we used message classes to pass event information to the delegate. Since the multi-threaded design has gone away, we simplify this by passing event arguments as direct function parameters, which is more clear and easier to understand. llvm-svn: 221806
* [ProcessWindows] Implement breakpoint stop / resume on Windows.Zachary Turner2014-11-111-1/+20
| | | | | | | | | | | | | | This patch implements basic support for stopping at breakpoints and resuming later. While a breakpoint is stopped at, LLDB will cease to process events in the debug loop, effectively suspending the process, and then resume later when ProcessWindows::DoResume is called. As a side effect, this also correctly handles the loader breakpoint (i.e. the initial stop) so that LLDB goes through the correct state sequence during the initial process launch. llvm-svn: 221642
* [ProcessWindows] Notify process plugin when the launch succeeds.Zachary Turner2014-11-101-7/+42
| | | | llvm-svn: 221637
* Remove the top-level DebugDriverThread in ProcessWindows.Zachary Turner2014-11-071-9/+3
| | | | | | | | | | Originally the idea was that we would queue requests to a master thread that would dispatch them to other slave threads each responsible for debugging an individual process. This might make some scenarios more scalable and responsive, but for now it seems to be unwarranted complexity for no observable benefit. llvm-svn: 221561
* Decouple ProcessWindows from the Windows debug driver thread.Zachary Turner2014-11-051-2/+55
| | | | | | | | | In the llgs world, ProcessWindows will eventually go away and we'll implement a different protocol. This patch decouples ProcessWindows from the core debug loop so that this transition will not be more difficult than it needs to be. llvm-svn: 221405
* Implement a framework for live debugging on Windows.Zachary Turner2014-11-041-2/+32
| | | | | | | | | | | | | | | | | When processes are launched for debugging on Windows now, LLDB will detect changes such as DLL loads and unloads, breakpoints, thread creation and deletion, etc. These notifications are not yet propagated to LLDB in a way that LLDB understands what is happening with the process. This only picks up the notifications from the OS in a way that they can be sent to LLDB with subsequent patches. Reviewed by: Scott Graham Differential Revision: http://reviews.llvm.org/D6037 llvm-svn: 221207
* Make ProcessWindows just use Host::LaunchProcess.Zachary Turner2014-10-241-5/+1
| | | | llvm-svn: 220574
* Create a process launcher abstraction.Zachary Turner2014-10-141-71/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements Host::LaunchProcess for windows, and in doing so does some minor refactor to move towards a more modular process launching design. The original motivation for this is that launching processes on windows needs some very windows specific code, which would live most appropriately in source/Host/windows somewhere. However, there is already some common code that all platforms use when launching a process before delegating to the platform specific stuff, which lives in source/Host/common/Host.cpp which would be nice to reuse without duplicating. This commonality has been abstracted into MonitoringProcessLauncher, a class which abstracts out the notion of launching a process using an arbitrary algorithm, and then monitoring it for state changes. The windows specific launching code lives in ProcessLauncherWindows, and the posix specific launching code lives in ProcessLauncherPosix. When launching a process MonitoringProcessLauncher is created, and then an appropriate delegate launcher is created and given to the MonitoringProcessLauncher. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5781 llvm-svn: 219731
* Refactor FileAction out of ProcessLaunchInfo.Zachary Turner2014-08-141-1/+2
| | | | | | | | | | | | | FileAction was previously a nested class in ProcessLaunchInfo. This led to some unfortunate style consequences, such as requiring the AddPosixSpawnFileAction() funciton to be defined in the Target layer, instead of the more appropriate Host layer. This patch makes FileAction its own independent class in the Target layer, and then moves AddPosixSpawnFileAction() into Host as a result. Differential Revision: http://reviews.llvm.org/D4877 llvm-svn: 215649
* Teach ProcessWindows plugin to support stdio i/o redirection.Zachary Turner2014-08-041-11/+61
| | | | llvm-svn: 214816
* Teach LLDB about Windows processes.Zachary Turner2014-07-281-0/+203
This patch creates a simple ProcessWindows process plugin. The only thing it knows how to do currently is create processes. Differential Revision: http://reviews.llvm.org/D4681 llvm-svn: 214094
OpenPOWER on IntegriCloud