blob: c6122edf50cf53ac4c52e0b49a5ffec0d68fbadd [file] [log] [blame]
Greg Claytonfc7117a2011-03-05 01:04:56 +00001//===-- DynamicLoaderStatic.h -----------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_DynamicLoaderStatic_h_
11#define liblldb_DynamicLoaderStatic_h_
12
13// C Includes
14// C++ Includes
Greg Claytonfc7117a2011-03-05 01:04:56 +000015// Other libraries and framework includes
Eugene Zelenko4c3f2b92015-10-21 01:03:30 +000016// Project includes
Greg Claytonfc7117a2011-03-05 01:04:56 +000017#include "lldb/Core/UUID.h"
Kate Stoneb9c1b512016-09-06 20:57:50 +000018#include "lldb/Host/FileSpec.h"
19#include "lldb/Target/DynamicLoader.h"
Greg Claytonfc7117a2011-03-05 01:04:56 +000020#include "lldb/Target/Process.h"
21
Kate Stoneb9c1b512016-09-06 20:57:50 +000022class DynamicLoaderStatic : public lldb_private::DynamicLoader {
Greg Claytonfc7117a2011-03-05 01:04:56 +000023public:
Kate Stoneb9c1b512016-09-06 20:57:50 +000024 DynamicLoaderStatic(lldb_private::Process *process);
Eugene Zelenko4c3f2b92015-10-21 01:03:30 +000025
Kate Stoneb9c1b512016-09-06 20:57:50 +000026 ~DynamicLoaderStatic() override;
Eugene Zelenko4c3f2b92015-10-21 01:03:30 +000027
Kate Stoneb9c1b512016-09-06 20:57:50 +000028 //------------------------------------------------------------------
29 // Static Functions
30 //------------------------------------------------------------------
31 static void Initialize();
Greg Claytonfc7117a2011-03-05 01:04:56 +000032
Kate Stoneb9c1b512016-09-06 20:57:50 +000033 static void Terminate();
Greg Claytonfc7117a2011-03-05 01:04:56 +000034
Kate Stoneb9c1b512016-09-06 20:57:50 +000035 static lldb_private::ConstString GetPluginNameStatic();
Greg Claytonfc7117a2011-03-05 01:04:56 +000036
Kate Stoneb9c1b512016-09-06 20:57:50 +000037 static const char *GetPluginDescriptionStatic();
Greg Claytonfc7117a2011-03-05 01:04:56 +000038
Kate Stoneb9c1b512016-09-06 20:57:50 +000039 static lldb_private::DynamicLoader *
40 CreateInstance(lldb_private::Process *process, bool force);
Greg Claytonfc7117a2011-03-05 01:04:56 +000041
Kate Stoneb9c1b512016-09-06 20:57:50 +000042 //------------------------------------------------------------------
43 /// Called after attaching a process.
44 ///
45 /// Allow DynamicLoader plug-ins to execute some code after
46 /// attaching to a process.
47 //------------------------------------------------------------------
48 void DidAttach() override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000049
Kate Stoneb9c1b512016-09-06 20:57:50 +000050 void DidLaunch() override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000051
Kate Stoneb9c1b512016-09-06 20:57:50 +000052 lldb::ThreadPlanSP GetStepThroughTrampolinePlan(lldb_private::Thread &thread,
53 bool stop_others) override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000054
Kate Stoneb9c1b512016-09-06 20:57:50 +000055 lldb_private::Error CanLoadImage() override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000056
Kate Stoneb9c1b512016-09-06 20:57:50 +000057 //------------------------------------------------------------------
58 // PluginInterface protocol
59 //------------------------------------------------------------------
60 lldb_private::ConstString GetPluginName() override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000061
Kate Stoneb9c1b512016-09-06 20:57:50 +000062 uint32_t GetPluginVersion() override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000063
Greg Claytonfc7117a2011-03-05 01:04:56 +000064private:
Kate Stoneb9c1b512016-09-06 20:57:50 +000065 void LoadAllImagesAtFileAddresses();
Greg Claytonfc7117a2011-03-05 01:04:56 +000066
Kate Stoneb9c1b512016-09-06 20:57:50 +000067 DISALLOW_COPY_AND_ASSIGN(DynamicLoaderStatic);
Greg Claytonfc7117a2011-03-05 01:04:56 +000068};
69
Eugene Zelenko4c3f2b92015-10-21 01:03:30 +000070#endif // liblldb_DynamicLoaderStatic_h_