llvm/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp

//===-- ABISysV_hexagon.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 "ABISysV_hexagon.h"

#include "llvm/IR/DerivedTypes.h"
#include "llvm/TargetParser/Triple.h"

#include "lldb/Core/Module.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Value.h"
#include "lldb/Core/ValueObjectConstResult.h"
#include "lldb/Core/ValueObjectMemory.h"
#include "lldb/Core/ValueObjectRegister.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Status.h"

usingnamespacelldb;
usingnamespacelldb_private;

LLDB_PLUGIN_DEFINE_ADV(ABISysV_hexagon, ABIHexagon)

static const RegisterInfo g_register_infos[] =;

static const uint32_t k_num_register_infos =;

const lldb_private::RegisterInfo *
ABISysV_hexagon::GetRegisterInfoArray(uint32_t &count) {}

/*
    http://en.wikipedia.org/wiki/Red_zone_%28computing%29

    In computing, a red zone is a fixed size area in memory beyond the stack
   pointer that has not been
    "allocated". This region of memory is not to be modified by
   interrupt/exception/signal handlers.
    This allows the space to be used for temporary data without the extra
   overhead of modifying the
    stack pointer. The x86-64 ABI mandates a 128 byte red zone.[1] The OpenRISC
   toolchain assumes a
    128 byte red zone though it is not documented.
*/
size_t ABISysV_hexagon::GetRedZoneSize() const {}

// Static Functions

ABISP
ABISysV_hexagon::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {}

bool ABISysV_hexagon::PrepareTrivialCall(Thread &thread, lldb::addr_t sp,
                                         lldb::addr_t pc, lldb::addr_t ra,
                                         llvm::ArrayRef<addr_t> args) const {}

/*

// AD:
//  . safeguard the current stack
//  . how can we know that the called function will create its own frame
properly?
//  . we could manually make a new stack first:
//      2. push RA
//      3. push FP
//      4. FP = SP
//      5. SP = SP ( since no locals in our temp frame )

// AD 6/05/2014
//  . variable argument list parameters are not passed via registers, they are
passed on
//    the stack.  This presents us with a problem, since we need to know when
the valist
//    starts.  Currently I can find out if a function is varg, but not how many
//    real parameters it takes.  Thus I don't know when to start spilling the
vargs.  For
//    the time being, to progress, I will assume that it takes on real parameter
before
//    the vargs list starts.

// AD 06/05/2014
//  . how do we adhere to the stack alignment requirements

// AD 06/05/2014
//  . handle 64bit values and their register / stack requirements

*/
#define HEX_ABI_DEBUG
bool ABISysV_hexagon::PrepareTrivialCall(
    Thread &thread, lldb::addr_t sp, lldb::addr_t pc, lldb::addr_t ra,
    llvm::Type &prototype, llvm::ArrayRef<ABI::CallArgument> args) const {}

bool ABISysV_hexagon::GetArgumentValues(Thread &thread,
                                        ValueList &values) const {}

Status
ABISysV_hexagon::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
                                      lldb::ValueObjectSP &new_value_sp) {}

ValueObjectSP ABISysV_hexagon::GetReturnValueObjectSimple(
    Thread &thread, CompilerType &return_compiler_type) const {}

ValueObjectSP ABISysV_hexagon::GetReturnValueObjectImpl(
    Thread &thread, CompilerType &return_compiler_type) const {}

// called when we are on the first instruction of a new function for hexagon
// the return address is in RA (R31)
bool ABISysV_hexagon::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {}

bool ABISysV_hexagon::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {}

/*
    Register		Usage					Saved By

    R0  - R5		parameters(a)			-
    R6  - R15		Scratch(b)				Caller
    R16 - R27		Scratch					Callee
    R28				Scratch(b)				Caller
    R29 - R31		Stack Frames			Callee(c)
    P3:0			Processor State			Caller

    a = the caller can change parameter values
    b = R14 - R15 and R28 are used by the procedure linkage table
    c = R29 - R31 are saved and restored by allocframe() and deallocframe()
*/
bool ABISysV_hexagon::RegisterIsVolatile(const RegisterInfo *reg_info) {}

bool ABISysV_hexagon::RegisterIsCalleeSaved(const RegisterInfo *reg_info) {}

void ABISysV_hexagon::Initialize() {}

void ABISysV_hexagon::Terminate() {}

// get value object specialized to work with llvm IR types
lldb::ValueObjectSP
ABISysV_hexagon::GetReturnValueObjectImpl(lldb_private::Thread &thread,
                                          llvm::Type &retType) const {}