Files
clang-p2996/lldb/source/Plugins/Process/Windows/DebugOneProcessThread.h
Zachary Turner 8f21174700 Implement a framework for live debugging on Windows.
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
2014-11-04 00:00:12 +00:00

64 lines
2.6 KiB
C++

//===-- DebugOneProcessThread.h ---------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_Plugins_Process_Windows_DebugOneProcessThread_H_
#define liblldb_Plugins_Process_Windows_DebugOneProcessThread_H_
#include "lldb/Host/HostProcess.h"
#include "lldb/Host/HostThread.h"
#include "lldb/Host/Predicate.h"
#include "lldb/Host/windows/windows.h"
namespace lldb_private
{
class LaunchProcessMessage;
class LaunchProcessMessageResult;
//----------------------------------------------------------------------
// DebugOneProcessThread
//
// Debugs a single process, notifying the process plugin and/or the debugger
// driver thread as appropriate when interesting things occur.
//----------------------------------------------------------------------
class DebugOneProcessThread : public std::enable_shared_from_this<DebugOneProcessThread>
{
public:
DebugOneProcessThread(HostThread driver_thread);
virtual ~DebugOneProcessThread();
const LaunchProcessMessageResult *DebugLaunch(const LaunchProcessMessage *message);
private:
void DebugLoop();
DWORD HandleExceptionEvent(const EXCEPTION_DEBUG_INFO &info, DWORD thread_id);
DWORD HandleCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO &info, DWORD thread_id);
DWORD HandleCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO &info, DWORD thread_id);
DWORD HandleExitThreadEvent(const EXIT_THREAD_DEBUG_INFO &info, DWORD thread_id);
DWORD HandleExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO &info, DWORD thread_id);
DWORD HandleLoadDllEvent(const LOAD_DLL_DEBUG_INFO &info, DWORD thread_id);
DWORD HandleUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO &info, DWORD thread_id);
DWORD HandleODSEvent(const OUTPUT_DEBUG_STRING_INFO &info, DWORD thread_id);
DWORD HandleRipEvent(const RIP_INFO &info, DWORD thread_id);
static void __stdcall NotifySlaveProcessExited(ULONG_PTR message);
static void __stdcall NotifySlaveRipEvent(ULONG_PTR message);
// The main debug driver thread which is controlling this slave.
lldb_private::HostThread m_driver_thread;
Predicate<const LaunchProcessMessageResult *> m_launch_predicate;
lldb::ProcessSP m_process_plugin;
HostProcess m_process;
static lldb::thread_result_t DebugLaunchThread(void *data);
lldb::thread_result_t DebugLaunchThread(const LaunchProcessMessage *message);
};
}
#endif