blob: 9075df6832c33ecd33fc0ee234642216f1633ed8 [file] [log] [blame]
Greg Claytonfc7117a2011-03-05 01:04:56 +00001//===-- DynamicLoaderStatic.h -----------------------------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Greg Claytonfc7117a2011-03-05 01:04:56 +00006//
7//===----------------------------------------------------------------------===//
8
9#ifndef liblldb_DynamicLoaderStatic_h_
10#define liblldb_DynamicLoaderStatic_h_
11
Kate Stoneb9c1b512016-09-06 20:57:50 +000012#include "lldb/Target/DynamicLoader.h"
Greg Claytonfc7117a2011-03-05 01:04:56 +000013#include "lldb/Target/Process.h"
Zachary Turner5713a052017-03-22 18:40:07 +000014#include "lldb/Utility/FileSpec.h"
15#include "lldb/Utility/UUID.h"
Greg Claytonfc7117a2011-03-05 01:04:56 +000016
Kate Stoneb9c1b512016-09-06 20:57:50 +000017class DynamicLoaderStatic : public lldb_private::DynamicLoader {
Greg Claytonfc7117a2011-03-05 01:04:56 +000018public:
Kate Stoneb9c1b512016-09-06 20:57:50 +000019 DynamicLoaderStatic(lldb_private::Process *process);
Eugene Zelenko4c3f2b92015-10-21 01:03:30 +000020
Kate Stoneb9c1b512016-09-06 20:57:50 +000021 ~DynamicLoaderStatic() override;
Eugene Zelenko4c3f2b92015-10-21 01:03:30 +000022
Kate Stoneb9c1b512016-09-06 20:57:50 +000023 //------------------------------------------------------------------
24 // Static Functions
25 //------------------------------------------------------------------
26 static void Initialize();
Greg Claytonfc7117a2011-03-05 01:04:56 +000027
Kate Stoneb9c1b512016-09-06 20:57:50 +000028 static void Terminate();
Greg Claytonfc7117a2011-03-05 01:04:56 +000029
Kate Stoneb9c1b512016-09-06 20:57:50 +000030 static lldb_private::ConstString GetPluginNameStatic();
Greg Claytonfc7117a2011-03-05 01:04:56 +000031
Kate Stoneb9c1b512016-09-06 20:57:50 +000032 static const char *GetPluginDescriptionStatic();
Greg Claytonfc7117a2011-03-05 01:04:56 +000033
Kate Stoneb9c1b512016-09-06 20:57:50 +000034 static lldb_private::DynamicLoader *
35 CreateInstance(lldb_private::Process *process, bool force);
Greg Claytonfc7117a2011-03-05 01:04:56 +000036
Kate Stoneb9c1b512016-09-06 20:57:50 +000037 //------------------------------------------------------------------
38 /// Called after attaching a process.
39 ///
40 /// Allow DynamicLoader plug-ins to execute some code after
41 /// attaching to a process.
42 //------------------------------------------------------------------
43 void DidAttach() override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000044
Kate Stoneb9c1b512016-09-06 20:57:50 +000045 void DidLaunch() override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000046
Kate Stoneb9c1b512016-09-06 20:57:50 +000047 lldb::ThreadPlanSP GetStepThroughTrampolinePlan(lldb_private::Thread &thread,
48 bool stop_others) override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000049
Zachary Turner97206d52017-05-12 04:51:55 +000050 lldb_private::Status CanLoadImage() override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000051
Kate Stoneb9c1b512016-09-06 20:57:50 +000052 //------------------------------------------------------------------
53 // PluginInterface protocol
54 //------------------------------------------------------------------
55 lldb_private::ConstString GetPluginName() override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000056
Kate Stoneb9c1b512016-09-06 20:57:50 +000057 uint32_t GetPluginVersion() override;
Greg Claytonfc7117a2011-03-05 01:04:56 +000058
Greg Claytonfc7117a2011-03-05 01:04:56 +000059private:
Kate Stoneb9c1b512016-09-06 20:57:50 +000060 void LoadAllImagesAtFileAddresses();
Greg Claytonfc7117a2011-03-05 01:04:56 +000061
Kate Stoneb9c1b512016-09-06 20:57:50 +000062 DISALLOW_COPY_AND_ASSIGN(DynamicLoaderStatic);
Greg Claytonfc7117a2011-03-05 01:04:56 +000063};
64
Eugene Zelenko4c3f2b92015-10-21 01:03:30 +000065#endif // liblldb_DynamicLoaderStatic_h_