Files
fail/src/core/sal/panda/PandaBreakpoints.ah
Horst Schirmeier 1947382c6e sal: avoid include cycle
Enabling both CONFIG_FAST_BREAKPOINTS / CONFIG_FAST_WATCHPOINTS and
CONFIG_EVENT_BREAKPOINTS / CONFIG_EVENT_BREAKPOINTS_RANGE /
CONFIG_EVENT_MEMREAD / CONFIG_EVENT_MEMWRITE led to an (unnecessary)
include cycle.

Change-Id: I8144e3e72da69b98e21a844a4bfded1b77bdce07
2014-06-03 11:47:21 +02:00

51 lines
1.0 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 "../../../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.address = m_WatchInstrPtr;
hc.addr_len = 4; // Thumb? => 2
oocdw_delete_halt_condition(&hc);
}
};
};
#endif // BUILD_PANDA && CONFIG_EVENT_BREAKPOINTS
#endif // __PANDA_BREAKPOINTS_AH__