llvm/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp

//===-- DynamicLoaderHexagonDYLD.cpp --------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPlanRunToAddress.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"

#include "DynamicLoaderHexagonDYLD.h"

#include <memory>

usingnamespacelldb;
usingnamespacelldb_private;

LLDB_PLUGIN_DEFINE()

// Aidan 21/05/2014
//
// Notes about hexagon dynamic loading:
//
//      When we connect to a target we find the dyld breakpoint address.  We put
//      a
//      breakpoint there with a callback 'RendezvousBreakpointHit()'.
//
//      It is possible to find the dyld structure address from the ELF symbol
//      table,
//      but in the case of the simulator it has not been initialized before the
//      target calls dlinit().
//
//      We can only safely parse the dyld structure after we hit the dyld
//      breakpoint
//      since at that time we know dlinit() must have been called.
//

// Find the load address of a symbol
static lldb::addr_t findSymbolAddress(Process *proc, ConstString findName) {}

void DynamicLoaderHexagonDYLD::Initialize() {}

void DynamicLoaderHexagonDYLD::Terminate() {}

llvm::StringRef DynamicLoaderHexagonDYLD::GetPluginDescriptionStatic() {}

DynamicLoader *DynamicLoaderHexagonDYLD::CreateInstance(Process *process,
                                                        bool force) {}

DynamicLoaderHexagonDYLD::DynamicLoaderHexagonDYLD(Process *process)
    :{}

DynamicLoaderHexagonDYLD::~DynamicLoaderHexagonDYLD() {}

void DynamicLoaderHexagonDYLD::DidAttach() {}

void DynamicLoaderHexagonDYLD::DidLaunch() {}

/// Checks to see if the target module has changed, updates the target
/// accordingly and returns the target executable module.
ModuleSP DynamicLoaderHexagonDYLD::GetTargetExecutable() {}

// AD: Needs to be updated?
Status DynamicLoaderHexagonDYLD::CanLoadImage() {}

void DynamicLoaderHexagonDYLD::UpdateLoadedSections(ModuleSP module,
                                                    addr_t link_map_addr,
                                                    addr_t base_addr,
                                                    bool base_addr_is_offset) {}

/// Removes the loaded sections from the target in \p module.
///
/// \param module The module to traverse.
void DynamicLoaderHexagonDYLD::UnloadSections(const ModuleSP module) {}

// Place a breakpoint on <_rtld_debug_state>
bool DynamicLoaderHexagonDYLD::SetRendezvousBreakpoint() {}

// We have just hit our breakpoint at <_rtld_debug_state>
bool DynamicLoaderHexagonDYLD::RendezvousBreakpointHit(
    void *baton, StoppointCallbackContext *context, user_id_t break_id,
    user_id_t break_loc_id) {}

/// Helper method for RendezvousBreakpointHit.  Updates LLDB's current set
/// of loaded modules.
void DynamicLoaderHexagonDYLD::RefreshModules() {}

// AD:	This is very different to the Static Loader code.
//		It may be wise to look over this and its relation to stack
//		unwinding.
ThreadPlanSP
DynamicLoaderHexagonDYLD::GetStepThroughTrampolinePlan(Thread &thread,
                                                       bool stop) {}

/// Helper for the entry breakpoint callback.  Resolves the load addresses
/// of all dependent modules.
void DynamicLoaderHexagonDYLD::LoadAllCurrentModules() {}

/// Computes a value for m_load_offset returning the computed address on
/// success and LLDB_INVALID_ADDRESS on failure.
addr_t DynamicLoaderHexagonDYLD::ComputeLoadOffset() {}

// Here we must try to read the entry point directly from the elf header.  This
// is possible if the process is not relocatable or dynamically linked.
//
// an alternative is to look at the PC if we can be sure that we have connected
// when the process is at the entry point.
// I dont think that is reliable for us.
addr_t DynamicLoaderHexagonDYLD::GetEntryPoint() {}

const SectionList *DynamicLoaderHexagonDYLD::GetSectionListFromModule(
    const ModuleSP module) const {}

static int ReadInt(Process *process, addr_t addr) {}

lldb::addr_t
DynamicLoaderHexagonDYLD::GetThreadLocalData(const lldb::ModuleSP module,
                                             const lldb::ThreadSP thread,
                                             lldb::addr_t tls_file_addr) {}