1 //===-- ProcessFreeBSD.cpp ----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // Other libraries and framework includes
15 #include "lldb/Core/PluginManager.h"
16 #include "lldb/Core/State.h"
17 #include "lldb/Host/Host.h"
18 #include "lldb/Symbol/ObjectFile.h"
19 #include "lldb/Target/DynamicLoader.h"
20 #include "lldb/Target/Target.h"
22 #include "ProcessFreeBSD.h"
23 #include "ProcessPOSIXLog.h"
24 #include "Plugins/Process/Utility/InferiorCallPOSIX.h"
25 #include "ProcessMonitor.h"
26 #include "POSIXThread.h"
29 using namespace lldb_private;
31 //------------------------------------------------------------------------------
35 ProcessFreeBSD::CreateInstance(Target& target,
37 const FileSpec *crash_file_path)
39 lldb::ProcessSP process_sp;
40 if (crash_file_path == NULL)
41 process_sp.reset(new ProcessFreeBSD (target, listener));
46 ProcessFreeBSD::Initialize()
48 static bool g_initialized = false;
52 PluginManager::RegisterPlugin(GetPluginNameStatic(),
53 GetPluginDescriptionStatic(),
55 Log::Callbacks log_callbacks = {
56 ProcessPOSIXLog::DisableLog,
57 ProcessPOSIXLog::EnableLog,
58 ProcessPOSIXLog::ListLogCategories
61 Log::RegisterLogChannel (ProcessFreeBSD::GetPluginNameStatic(), log_callbacks);
62 ProcessPOSIXLog::RegisterPluginName(GetPluginNameStatic());
67 lldb_private::ConstString
68 ProcessFreeBSD::GetPluginNameStatic()
70 static ConstString g_name("freebsd");
75 ProcessFreeBSD::GetPluginDescriptionStatic()
77 return "Process plugin for FreeBSD";
80 //------------------------------------------------------------------------------
81 // ProcessInterface protocol.
83 lldb_private::ConstString
84 ProcessFreeBSD::GetPluginName()
86 return GetPluginNameStatic();
90 ProcessFreeBSD::GetPluginVersion()
96 ProcessFreeBSD::GetPluginCommandHelp(const char *command, Stream *strm)
101 ProcessFreeBSD::ExecutePluginCommand(Args &command, Stream *strm)
103 return Error(1, eErrorTypeGeneric);
107 ProcessFreeBSD::EnablePluginLogging(Stream *strm, Args &command)
112 //------------------------------------------------------------------------------
113 // Constructors and destructors.
115 ProcessFreeBSD::ProcessFreeBSD(Target& target, Listener &listener)
116 : ProcessPOSIX(target, listener)
121 ProcessFreeBSD::Terminate()
126 ProcessFreeBSD::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
129 new_thread_list = old_thread_list;