75 lines
1.8 KiB
Plaintext
75 lines
1.8 KiB
Plaintext
#ifndef __PANDA_BREAKPOINTS_AH__
|
|
#define __PANDA_BREAKPOINTS_AH__
|
|
|
|
#include "config/FailConfig.hpp"
|
|
#include "config/VariantConfig.hpp"
|
|
|
|
#if defined(BUILD_PANDA) && defined(CONFIG_EVENT_BREAKPOINTS)
|
|
|
|
#include "../SALInst.hpp"
|
|
#include "../../../debuggers/openocd/openocd_wrapper.hpp"
|
|
|
|
aspect PandaBreakpoints
|
|
{
|
|
advice "fail::BPSingleListener" : slice class
|
|
{
|
|
public:
|
|
bool onAddition()
|
|
{
|
|
// Setup Breakpoint on Pandaboard
|
|
struct halt_condition hc;
|
|
if (m_WatchInstrPtr == ANY_ADDR) {
|
|
hc.type = HALT_TYPE_SINGLESTEP;
|
|
} else {
|
|
hc.type = HALT_TYPE_BP;
|
|
}
|
|
hc.address = m_WatchInstrPtr;
|
|
hc.addr_len= 4; // Thumb? => 2
|
|
oocdw_set_halt_condition(&hc);
|
|
return true;
|
|
}
|
|
|
|
void onDeletion()
|
|
{
|
|
// Delete Breakpoint on Pandaboard
|
|
struct halt_condition hc;
|
|
if (m_WatchInstrPtr == ANY_ADDR) {
|
|
hc.type = HALT_TYPE_SINGLESTEP;
|
|
} else {
|
|
hc.type = HALT_TYPE_BP;
|
|
}
|
|
hc.type = HALT_TYPE_BP;
|
|
hc.address = m_WatchInstrPtr;
|
|
hc.addr_len= 4; // Thumb? => 2
|
|
oocdw_delete_halt_condition(&hc);
|
|
}
|
|
};
|
|
|
|
#if defined(CONFIG_EVENT_BREAKPOINTS_RANGE)
|
|
#error Range Breakpoints not yet implemented for Pandaboard
|
|
|
|
advice "fail::BPRangeListener" : slice class
|
|
{
|
|
public:
|
|
bool onAddition()
|
|
{
|
|
// Calculate address range
|
|
address_t range = m_WatchEndAddr - m_WatchStartAddr; // range / sizeof(address_t) ??!
|
|
|
|
// ToDo: Setup MMU to watch address range
|
|
}
|
|
|
|
void onDeletion()
|
|
{
|
|
// Calculate address range
|
|
address_t range = m_WatchEndAddr - m_WatchStartAddr; // range / sizeof(address_t) ??!
|
|
|
|
// ToDo: Setup MMU to no longer watch address range
|
|
}
|
|
};
|
|
#endif // CONFIG_EVENT_BREAKPOINTS_RANGE
|
|
};
|
|
|
|
#endif // BUILD_PANDA && CONFIG_EVENT_BREAKPOINTS
|
|
#endif // __PANDA_BREAKPOINTS_AH__
|