#include "llvm/IR/Module.h"
#include "lldb/Expression/IRMemoryMap.h"
-#include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Expression/ObjectFileJIT.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/lldb-forward.h"
//
//===----------------------------------------------------------------------===//
-#ifndef LLDB_SOURCE_PLUGINS_OBJECTFILE_JIT_OBJECTFILEJIT_H
-#define LLDB_SOURCE_PLUGINS_OBJECTFILE_JIT_OBJECTFILEJIT_H
+#ifndef LLDB_EXPRESSION_OBJECTFILEJIT_H
+#define LLDB_EXPRESSION_OBJECTFILEJIT_H
#include "lldb/Core/Address.h"
+#include "lldb/Core/Section.h"
#include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Symbol/Symtab.h"
+#include "lldb/Utility/ArchSpec.h"
-// This class needs to be hidden as eventually belongs in a plugin that
-// will export the ObjectFile protocol
-class ObjectFileJIT : public lldb_private::ObjectFile {
+namespace lldb_private {
+
+class ObjectFileJITDelegate {
+public:
+ ObjectFileJITDelegate() = default;
+ virtual ~ObjectFileJITDelegate() = default;
+ virtual lldb::ByteOrder GetByteOrder() const = 0;
+ virtual uint32_t GetAddressByteSize() const = 0;
+ virtual void PopulateSymtab(lldb_private::ObjectFile *obj_file,
+ lldb_private::Symtab &symtab) = 0;
+ virtual void PopulateSectionList(lldb_private::ObjectFile *obj_file,
+ lldb_private::SectionList §ion_list) = 0;
+ virtual ArchSpec GetArchitecture() = 0;
+};
+
+class ObjectFileJIT : public ObjectFile {
public:
ObjectFileJIT(const lldb::ModuleSP &module_sp,
const lldb::ObjectFileJITDelegateSP &delegate_sp);
lldb::offset_t section_offset, void *dst,
size_t dst_len) override;
- size_t
- ReadSectionData(lldb_private::Section *section,
- lldb_private::DataExtractor §ion_data) override;
+ size_t ReadSectionData(lldb_private::Section *section,
+ lldb_private::DataExtractor §ion_data) override;
lldb_private::Address GetEntryPointAddress() override;
protected:
lldb::ObjectFileJITDelegateWP m_delegate_wp;
};
+} // namespace lldb_private
-#endif // LLDB_SOURCE_PLUGINS_OBJECTFILE_JIT_OBJECTFILEJIT_H
+#endif // LLDB_EXPRESSION_OBJECTFILEJIT_H
namespace lldb_private {
-class ObjectFileJITDelegate {
-public:
- ObjectFileJITDelegate() = default;
-
- virtual ~ObjectFileJITDelegate() = default;
-
- virtual lldb::ByteOrder GetByteOrder() const = 0;
-
- virtual uint32_t GetAddressByteSize() const = 0;
-
- virtual void PopulateSymtab(lldb_private::ObjectFile *obj_file,
- lldb_private::Symtab &symtab) = 0;
-
- virtual void PopulateSectionList(lldb_private::ObjectFile *obj_file,
- lldb_private::SectionList §ion_list) = 0;
-
- virtual ArchSpec GetArchitecture() = 0;
-};
-
/// \class ObjectFile ObjectFile.h "lldb/Symbol/ObjectFile.h"
/// A plug-in interface definition class for object file parsers.
///
# TODO: Add property `NO_PLUGIN_DEPENDENCIES` to lldbExpression
-add_lldb_library(lldbExpression
+add_lldb_library(lldbExpression NO_PLUGIN_DEPENDENCIES
DiagnosticManager.cpp
DWARFExpression.cpp
DWARFExpressionList.cpp
IRMemoryMap.cpp
LLVMUserExpression.cpp
Materializer.cpp
+ ObjectFileJIT.cpp
REPL.cpp
UserExpression.cpp
UtilityFunction.cpp
lldbSymbol
lldbTarget
lldbUtility
- lldbPluginObjectFileJIT
LINK_COMPONENTS
Core
#include "lldb/Core/Module.h"
#include "lldb/Core/Section.h"
#include "lldb/Expression/IRExecutionUnit.h"
+#include "lldb/Expression/ObjectFileJIT.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
-#include "lldb/../../source/Plugins/ObjectFile/JIT/ObjectFileJIT.h"
#include <optional>
using namespace lldb_private;
#include "llvm/ADT/StringRef.h"
-#include "ObjectFileJIT.h"
-#include "lldb/Core/Debugger.h"
#include "lldb/Core/FileSpecList.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
-#include "lldb/Core/StreamFile.h"
-#include "lldb/Host/Host.h"
-#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Target/Platform.h"
+#include "lldb/Expression/ObjectFileJIT.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
-#include "lldb/Utility/RangeMap.h"
-#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/Timer.h"
#include "lldb/Utility/UUID.h"
using namespace lldb;
using namespace lldb_private;
-LLDB_PLUGIN_DEFINE(ObjectFileJIT)
-
char ObjectFileJIT::ID;
void ObjectFileJIT::Initialize() {
return 0;
}
-size_t ObjectFileJIT::ReadSectionData(
- lldb_private::Section *section,
- lldb_private::DataExtractor §ion_data) {
+size_t
+ObjectFileJIT::ReadSectionData(lldb_private::Section *section,
+ lldb_private::DataExtractor §ion_data) {
if (section->GetFileSize()) {
const void *src = (void *)(uintptr_t)section->GetFileOffset();
add_subdirectory(Breakpad)
add_subdirectory(ELF)
-add_subdirectory(JIT)
add_subdirectory(JSON)
add_subdirectory(Mach-O)
add_subdirectory(Minidump)
+++ /dev/null
-add_lldb_library(lldbPluginObjectFileJIT PLUGIN
- ObjectFileJIT.cpp
-
- LINK_LIBS
- lldbCore
- lldbHost
- lldbSymbol
- lldbTarget
- LINK_COMPONENTS
- Support
- )