2022-03-24 19:06:09 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
2022-03-31 21:52:46 +01:00
|
|
|
#include "src/DebugServer/Gdb/TargetDescriptor.hpp"
|
2022-03-24 19:06:09 +00:00
|
|
|
|
2024-07-23 21:14:22 +01:00
|
|
|
#include "src/Targets/TargetDescriptor.hpp"
|
|
|
|
|
#include "src/Targets/TargetAddressSpaceDescriptor.hpp"
|
|
|
|
|
#include "src/Targets/TargetMemorySegmentDescriptor.hpp"
|
|
|
|
|
#include "src/Targets/TargetPeripheralDescriptor.hpp"
|
|
|
|
|
#include "src/Targets/TargetRegisterGroupDescriptor.hpp"
|
|
|
|
|
|
2023-08-13 15:47:51 +01:00
|
|
|
namespace DebugServer::Gdb::AvrGdb
|
2022-03-24 19:06:09 +00:00
|
|
|
{
|
2024-10-25 22:22:25 +01:00
|
|
|
class AvrGdbTargetDescriptor: public DebugServer::Gdb::TargetDescriptor
|
2022-03-24 19:06:09 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2024-07-23 21:14:22 +01:00
|
|
|
static constexpr auto SRAM_ADDRESS_MASK = 0x00800000U;
|
|
|
|
|
static constexpr auto EEPROM_ADDRESS_MASK = 0x00810000U;
|
|
|
|
|
|
2023-05-21 21:08:25 +01:00
|
|
|
static constexpr auto STATUS_GDB_REGISTER_ID = 32;
|
|
|
|
|
static constexpr auto STACK_POINTER_GDB_REGISTER_ID = 33;
|
|
|
|
|
static constexpr auto PROGRAM_COUNTER_GDB_REGISTER_ID = 34;
|
2022-03-24 19:06:09 +00:00
|
|
|
|
2024-07-23 21:14:22 +01:00
|
|
|
const Targets::TargetAddressSpaceDescriptor& programAddressSpaceDescriptor;
|
|
|
|
|
const Targets::TargetAddressSpaceDescriptor& eepromAddressSpaceDescriptor;
|
|
|
|
|
const Targets::TargetAddressSpaceDescriptor& sramAddressSpaceDescriptor;
|
|
|
|
|
const Targets::TargetAddressSpaceDescriptor& gpRegistersAddressSpaceDescriptor;
|
|
|
|
|
|
|
|
|
|
const Targets::TargetMemorySegmentDescriptor& programMemorySegmentDescriptor;
|
|
|
|
|
const Targets::TargetMemorySegmentDescriptor& eepromMemorySegmentDescriptor;
|
|
|
|
|
const Targets::TargetMemorySegmentDescriptor& sramMemorySegmentDescriptor;
|
|
|
|
|
const Targets::TargetMemorySegmentDescriptor& gpRegistersMemorySegmentDescriptor;
|
|
|
|
|
|
|
|
|
|
const Targets::TargetPeripheralDescriptor& cpuGpPeripheralDescriptor;
|
|
|
|
|
const Targets::TargetRegisterGroupDescriptor& cpuGpRegisterGroupDescriptor;
|
|
|
|
|
|
2024-10-25 22:22:25 +01:00
|
|
|
explicit AvrGdbTargetDescriptor(const Targets::TargetDescriptor& targetDescriptor);
|
2022-03-24 19:06:09 +00:00
|
|
|
|
2024-07-23 21:14:22 +01:00
|
|
|
const Targets::TargetAddressSpaceDescriptor& addressSpaceDescriptorFromGdbAddress(
|
|
|
|
|
GdbMemoryAddress address
|
|
|
|
|
) const override;
|
|
|
|
|
|
|
|
|
|
Targets::TargetMemoryAddress translateGdbAddress(GdbMemoryAddress address) const override;
|
|
|
|
|
GdbMemoryAddress translateTargetMemoryAddress(
|
|
|
|
|
Targets::TargetMemoryAddress address,
|
|
|
|
|
const Targets::TargetAddressSpaceDescriptor& addressSpaceDescriptor,
|
|
|
|
|
const Targets::TargetMemorySegmentDescriptor& memorySegmentDescriptor
|
|
|
|
|
) const override;
|
2022-03-24 19:06:09 +00:00
|
|
|
};
|
|
|
|
|
}
|