This commit is contained in:
Nav
2022-09-06 17:17:43 +01:00
parent 46d8ce1854
commit 7d07a9cf6c
9 changed files with 38 additions and 31 deletions

View File

@@ -1,6 +1,5 @@
#include "EdbgAvr8Interface.hpp" #include "EdbgAvr8Interface.hpp"
#include <cstdint>
#include <thread> #include <thread>
#include <cmath> #include <cmath>

View File

@@ -23,7 +23,8 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
{ {
public: public:
explicit EdbgAvrIspInterface(EdbgInterface& edbgInterface) explicit EdbgAvrIspInterface(EdbgInterface& edbgInterface)
: edbgInterface(edbgInterface) {}; : edbgInterface(edbgInterface)
{};
/** /**
* The EdbgAvrIspInterface doesn't actually require any config from the user, at this point in time. So this * The EdbgAvrIspInterface doesn't actually require any config from the user, at this point in time. So this

View File

@@ -14,7 +14,9 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::ResponseFrame
{ {
public: public:
GetProgramCounter() = default; GetProgramCounter() = default;
explicit GetProgramCounter(const std::vector<AvrResponse>& avrResponses): Avr8GenericResponseFrame(avrResponses) {} explicit GetProgramCounter(const std::vector<AvrResponse>& avrResponses)
: Avr8GenericResponseFrame(avrResponses)
{}
Targets::TargetProgramCounter extractProgramCounter() { Targets::TargetProgramCounter extractProgramCounter() {
/* /*

View File

@@ -13,7 +13,9 @@ namespace Bloom::Events
static constexpr EventType type = EventType::DEBUG_SERVER_THREAD_STATE_CHANGED; static constexpr EventType type = EventType::DEBUG_SERVER_THREAD_STATE_CHANGED;
static inline const std::string name = "DebugServerThreadStateChanged"; static inline const std::string name = "DebugServerThreadStateChanged";
explicit DebugServerThreadStateChanged(ThreadState state): state(state) {}; explicit DebugServerThreadStateChanged(ThreadState state)
: state(state)
{};
[[nodiscard]] EventType getType() const override { [[nodiscard]] EventType getType() const override {
return DebugServerThreadStateChanged::type; return DebugServerThreadStateChanged::type;

View File

@@ -13,7 +13,9 @@ namespace Bloom::Events
static constexpr EventType type = EventType::TARGET_CONTROLLER_THREAD_STATE_CHANGED; static constexpr EventType type = EventType::TARGET_CONTROLLER_THREAD_STATE_CHANGED;
static inline const std::string name = "TargetControllerThreadStateChanged"; static inline const std::string name = "TargetControllerThreadStateChanged";
explicit TargetControllerThreadStateChanged(ThreadState state): state(state) {}; explicit TargetControllerThreadStateChanged(ThreadState state)
: state(state)
{};
[[nodiscard]] EventType getType() const override { [[nodiscard]] EventType getType() const override {
return TargetControllerThreadStateChanged::type; return TargetControllerThreadStateChanged::type;

View File

@@ -11,16 +11,16 @@ namespace Bloom::Widgets
Targets::TargetMemorySize size, Targets::TargetMemorySize size,
QString labelText, QString labelText,
AnnotationItemPosition position AnnotationItemPosition position
): )
QGraphicsItem(nullptr), : QGraphicsItem(nullptr)
startAddress(startAddress), , startAddress(startAddress)
size(size), , size(size)
endAddress(static_cast<std::uint32_t>(startAddress + size - 1)), , endAddress(static_cast<Targets::TargetMemoryAddress>(startAddress + size - 1))
labelText(std::move(labelText)), , labelText(std::move(labelText))
position(position), , position(position)
width(static_cast<int>((ByteItem::WIDTH + ByteItem::RIGHT_MARGIN) * size - ByteItem::RIGHT_MARGIN)), , width(static_cast<int>((ByteItem::WIDTH + ByteItem::RIGHT_MARGIN) * size - ByteItem::RIGHT_MARGIN))
height(position == AnnotationItemPosition::TOP ? AnnotationItem::TOP_HEIGHT : AnnotationItem::BOTTOM_HEIGHT , height(position == AnnotationItemPosition::TOP ? AnnotationItem::TOP_HEIGHT : AnnotationItem::BOTTOM_HEIGHT)
) { {
this->setAcceptHoverEvents(true); this->setAcceptHoverEvents(true);
this->setToolTip(this->labelText); this->setToolTip(this->labelText);
} }
@@ -29,19 +29,22 @@ namespace Bloom::Widgets
const Targets::TargetMemoryAddressRange& addressRange, const Targets::TargetMemoryAddressRange& addressRange,
const QString& labelText, const QString& labelText,
AnnotationItemPosition position AnnotationItemPosition position
): AnnotationItem( )
addressRange.startAddress, : AnnotationItem(
addressRange.endAddress - addressRange.startAddress + 1, addressRange.startAddress,
labelText, addressRange.endAddress - addressRange.startAddress + 1,
position labelText,
) {} position
)
{}
AnnotationItem::AnnotationItem(const FocusedMemoryRegion& focusedMemoryRegion, AnnotationItemPosition position) AnnotationItem::AnnotationItem(const FocusedMemoryRegion& focusedMemoryRegion, AnnotationItemPosition position)
: AnnotationItem( : AnnotationItem(
focusedMemoryRegion.addressRange, focusedMemoryRegion.addressRange,
focusedMemoryRegion.name, focusedMemoryRegion.name,
position position
) {} )
{}
void AnnotationItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { void AnnotationItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) {
auto lineColor = this->getLineColor(); auto lineColor = this->getLineColor();

View File

@@ -37,8 +37,7 @@ namespace Bloom::Widgets
); );
AnnotationItem( AnnotationItem(
const Targets::TargetMemoryAddressRange& const Targets::TargetMemoryAddressRange& addressRange,
addressRange,
const QString& labelText, const QString& labelText,
AnnotationItemPosition position AnnotationItemPosition position
); );

View File

@@ -4,7 +4,6 @@
#include "Command.hpp" #include "Command.hpp"
#include "src/Targets/TargetBreakpoint.hpp"
#include "src/Targets/TargetMemory.hpp" #include "src/Targets/TargetMemory.hpp"
namespace Bloom::TargetController::Commands namespace Bloom::TargetController::Commands

View File

@@ -1,14 +1,14 @@
#pragma once #pragma once
#include <string>
#include <cstdint> #include <cstdint>
#include <string>
#include <map> #include <map>
#include "TargetPinDescriptor.hpp" #include "TargetPinDescriptor.hpp"
namespace Bloom::Targets namespace Bloom::Targets
{ {
enum class TargetPackage: int enum class TargetPackage: std::uint8_t
{ {
UNKNOWN, UNKNOWN,