winIDEA SDK
isys::CBreakpointController Class Reference

Description

This class controls breakpoints on target.

Python example for method setBP(): test_set_bp.py
Python example for method setHWBP(): test_set_hwbp.py

#include <CBreakpointController.h>

Inheritance diagram for isys::CBreakpointController:
isys::WrapperBase

Public Member Functions

 CBreakpointController (std::shared_ptr< ConnectionMgr > connectionMgr)
 Instantiates object. More...
 
int setBP (const std::string &symbolName, int conditionCount=0, const std::string &conditionExpression="")
 Sets breakpoint at the given symbol. More...
 
int setBP (int lineNumber, const std::string &fileName, int conditionCount=0, const std::string &conditionExpression="")
 Sets breakpoint at the given location in source code. More...
 
int setBP (int memArea, ADDRESS_64 address, int conditionCount=0, const std::string &conditionExpression="")
 Sets breakpoint at the given address. More...
 
int setHWBP (DWORD rwAccess, DWORD accessSize, DWORD usedDataBytes, bool isEntireObject, const std::string &symbolName, DWORD data)
 Sets hardware breakpoint on the given variable or symbol. More...
 
int setHWBP (DWORD rwAccess, DWORD accessSize, DWORD usedDataBytes, int memArea, ADDRESS_64 address, DWORD data)
 Sets hardware breakpoint on the given address. More...
 
int deleteBP (const std::string &symbolName)
 Deletes breakpoint at the given symbol name. More...
 
int deleteBP (const std::string &fileName, int lineNumber)
 Deletes breakpoint at the given location in source code. More...
 
int deleteBP (int memArea, ADDRESS_64 address)
 Deletes breakpoint at the given address. More...
 
int deleteHWBP (const std::string &symbolName)
 Deletes hardware breakpoint at the given symbol name. More...
 
int deleteHWBP (int memArea, ADDRESS_64 address)
 Deletes hardware breakpoint at the given address. More...
 
int deleteAll ()
 Deletes all execution breakpoints. More...
 
int deleteAllHWBP ()
 Deletes all hardware breakpoints. More...
 
int setEnabled (bool isEnabled, const std::string &symbolName)
 Enables / disables the breakpoint at the given symbol name. More...
 
int setEnabled (bool isEnabled, const std::string &fileName, int lineNumber)
 Enables / disables the breakpoint at the given source line. More...
 
int setEnabled (bool isEnabled, int memArea, ADDRESS_64 address)
 Enables / disables the breakpoint at the given address. More...
 
int setHWEnabled (bool isEnabled, const std::string &symbolName)
 Enables / disables hardware breakpoint at the given symbol name. More...
 
int setHWEnabled (bool isEnabled, int memArea, ADDRESS_64 address)
 Enables / disables hardware breakpoint at the given address. More...
 
int setHWEnabledAll (bool isEnabled)
 Sets enabled status of all hardware breakpoints. More...
 
int setEnabledAll (bool isEnabled)
 Sets enabled status of all breakpoints. More...
 
int reapplyAll ()
 Reapplies all currently active breakpoints. More...
 
VBPInstances get_BPs ()
 Returns all currently configured BPs. More...
 
CBPInstance set_BP_symbol (const std::string &rstrSymbol)
 Sets a breakpoint on the symbol. More...
 
CBPInstance set_BP_source (int nLineNumber, const std::string &rstrFileName)
 Sets a breakpoint on a source line. More...
 
void remove_BP (const CBPInstance &rBP)
 removes the breakpoint More...
 
void remove_BPs (const VBPInstances &rvBPs)
 removes the breakpoints More...
 
void remove_all_BPs ()
 removes all breakpoints More...
 
void set_BP_condition (const CBPInstance &rBP, int nConditionCount, const std::string &rstrConditionExpression)
 Sets condition to the breakpoint. More...
 
void clear_BP_condition (const CBPInstance &rBP)
 removes breakpoint's condition More...
 
void set_BP_process_filter (const CBPInstance &rBP, const std::string &rstrProcessFilter="")
 Sets process filter for a breakpoint. More...
 
void set_BP_action (const CBPInstance &rBP, const std::string &rstrActionScript, const std::string &rstrActionScriptParams, bool bShow)
 Sets action to take when BP hits. More...
 
void set_BP_enabled (const CBPInstance &rBP, bool bEnable)
 Enables / disables the breakpoint. More...
 

Constructor & Destructor Documentation

◆ CBreakpointController()

isys::CBreakpointController::CBreakpointController ( std::shared_ptr< ConnectionMgr connectionMgr)

Instantiates object.

Parameters
connectionMgrclass which maintains connection to winIDEA. Connection must be established before this call.

Python example: test_set_bp.py

Member Function Documentation

◆ clear_BP_condition()

void isys::CBreakpointController::clear_BP_condition ( const CBPInstance rBP)

removes breakpoint's condition

Parameters
rBPthe breakpoint handle

Python example: test_clear_bp_condition.py

◆ deleteAll()

int isys::CBreakpointController::deleteAll ( )

Deletes all execution breakpoints.

Returns
0 if OK

Python example: test_delete_all.py

◆ deleteAllHWBP()

int isys::CBreakpointController::deleteAllHWBP ( )

Deletes all hardware breakpoints.

Returns
0 if OK

Python example: test_delete_all_hwbp.py

◆ deleteBP() [1/3]

int isys::CBreakpointController::deleteBP ( const std::string &  fileName,
int  lineNumber 
)

Deletes breakpoint at the given location in source code.

Parameters
fileNamename of source code file
lineNumberline number in source file
Returns
0 if operation was successful, 1 if operation was not executed as expected, but the target is in the expected state. For example, if there was no breakpoint at the specified location, then 1 is returned, because it was not removed, but after the method returns there is no breakpoint, as it is expected.

Python example: test_delete_bp.py

◆ deleteBP() [2/3]

int isys::CBreakpointController::deleteBP ( const std::string &  symbolName)

Deletes breakpoint at the given symbol name.

Parameters
symbolNamename of symbol in target program, for example function name.
Returns
0 if there was breakpoint before this call (it was deleted), 1 if the breakpoint at this location did not exist

Python example: test_delete_bp.py

◆ deleteBP() [3/3]

int isys::CBreakpointController::deleteBP ( int  memArea,
ADDRESS_64  address 
)

Deletes breakpoint at the given address.

Parameters
memAreamemory area of the breakpoint
addressaddress of the existing breakpoint
Returns
0 if operation was successful, 1 if operation was not executed as expected, but the target is in the expected state. For example, if there was no breakpoint at the specified location, then 1 is returned, because it was not removed, but after the method returns there is no breakpoint, as it is expected.

Python example: test_delete_bp.py

◆ deleteHWBP() [1/2]

int isys::CBreakpointController::deleteHWBP ( const std::string &  symbolName)

Deletes hardware breakpoint at the given symbol name.

Parameters
symbolNamename of symbol in target program, for example function name.
Returns
0 if operation was successful, 1 if there was no breakpoint at the given address or it was disabled.

◆ deleteHWBP() [2/2]

int isys::CBreakpointController::deleteHWBP ( int  memArea,
ADDRESS_64  address 
)

Deletes hardware breakpoint at the given address.

Parameters
memAreamemory area of the breakpoint
addressaddress of the breakpoint
Returns
0 if operation was successful, 1 if there was no breakpoint at the given address or it was disabled.

◆ get_BPs()

VBPInstances isys::CBreakpointController::get_BPs ( )

Returns all currently configured BPs.

Returns
vector of BPs

Python example: test_get_bps.py

◆ reapplyAll()

int isys::CBreakpointController::reapplyAll ( )

Reapplies all currently active breakpoints.

Use this method, if your application has overwritten software breakpoints, for example when the code in RAM is overwritten by target application after download.

Returns
0 on success, throws Exception on error.

Python example: test_reapply_all.py

◆ remove_all_BPs()

void isys::CBreakpointController::remove_all_BPs ( )

removes all breakpoints

Python example: test_remove_all_bps.py

◆ remove_BP()

void isys::CBreakpointController::remove_BP ( const CBPInstance rBP)

removes the breakpoint

Parameters
rBPthe breakpoint handle

Python example: test_remove_bp.py

◆ remove_BPs()

void isys::CBreakpointController::remove_BPs ( const VBPInstances rvBPs)

removes the breakpoints

Parameters
rvBPsBP handles to remove

Python example: test_remove_bps.py

◆ set_BP_action()

void isys::CBreakpointController::set_BP_action ( const CBPInstance rBP,
const std::string &  rstrActionScript,
const std::string &  rstrActionScriptParams,
bool  bShow 
)

Sets action to take when BP hits.

Parameters
rBPthe breakpoint handle
rstrActionScriptpath to the script to execute
rstrActionScriptParamsparameters to pass to rstrActionScript
bShowif set, the script window is shown, otherwise hidden

Python example: test_set_bp_action.py

◆ set_BP_condition()

void isys::CBreakpointController::set_BP_condition ( const CBPInstance rBP,
int  nConditionCount,
const std::string &  rstrConditionExpression 
)

Sets condition to the breakpoint.

Parameters
rBPthe breakpoint handle
nConditionCountthe number of times condition has to be met for breakpoint to trigger
rstrConditionExpressioncondition that has to be met for breakpoint to trigger

Python example: test_set_bp_condition.py

◆ set_BP_enabled()

void isys::CBreakpointController::set_BP_enabled ( const CBPInstance rBP,
bool  bEnable 
)

Enables / disables the breakpoint.

Parameters
rBPthe breakpoint handle
bEnableset to true to enable the breakpoint, false to disable it

Python example: test_set_bp_enabled.py

◆ set_BP_process_filter()

void isys::CBreakpointController::set_BP_process_filter ( const CBPInstance rBP,
const std::string &  rstrProcessFilter = "" 
)

Sets process filter for a breakpoint.

Parameters
rBPthe breakpoint handle
rstrProcessFilterthe process filter string

◆ set_BP_source()

CBPInstance isys::CBreakpointController::set_BP_source ( int  nLineNumber,
const std::string &  rstrFileName 
)

Sets a breakpoint on a source line.

Parameters
nLineNumberline number of the breakpoint
rstrFileNamefile name
Returns
the breakpoint handle

Python example: test_set_bp_source.py

◆ set_BP_symbol()

CBPInstance isys::CBreakpointController::set_BP_symbol ( const std::string &  rstrSymbol)

Sets a breakpoint on the symbol.

Parameters
rstrSymbolname of the symbol to set a BP to
Returns
the breakpoint handle

Python example: test_set_bp_symbol.py

◆ setBP() [1/3]

int isys::CBreakpointController::setBP ( const std::string &  symbolName,
int  conditionCount = 0,
const std::string &  conditionExpression = "" 
)

Sets breakpoint at the given symbol.

Parameters
symbolNamename of symbol in target program, for example function name.
conditionCountthe number of times condition has to be met for breakpoint to trigger
conditionExpressioncondition that has to be met for breakpoint to trigger
Returns
0 if there was no breakpoint before this call, 1 if the breakpoint at this location was already set

Python example: test_set_bp.py

◆ setBP() [2/3]

int isys::CBreakpointController::setBP ( int  lineNumber,
const std::string &  fileName,
int  conditionCount = 0,
const std::string &  conditionExpression = "" 
)

Sets breakpoint at the given location in source code.

Parameters
lineNumberline number in source file
fileNamename of source code file
conditionCountthe number of times condition has to be met for breakpoint to trigger
conditionExpressioncondition that has to be met for breakpoint to trigger
Returns
0 if there was no breakpoint before this call, 1 if the breakpoint at this location was already set

Python example: test_set_bp.py

◆ setBP() [3/3]

int isys::CBreakpointController::setBP ( int  memArea,
ADDRESS_64  address,
int  conditionCount = 0,
const std::string &  conditionExpression = "" 
)

Sets breakpoint at the given address.

Parameters
memAreamemory area of the breakpoint
addressaddress to set the breakpoint
conditionCountthe number of times condition has to be met for breakpoint to trigger
conditionExpressioncondition that has to be met for breakpoint to trigger
Returns
0 if there was no breakpoint before this call, 1 if the breakpoint at this location was already set

Python example: test_set_bp.py

◆ setEnabled() [1/3]

int isys::CBreakpointController::setEnabled ( bool  isEnabled,
const std::string &  fileName,
int  lineNumber 
)

Enables / disables the breakpoint at the given source line.

Parameters
isEnabledset to true to enable the breakpoint, false to disable it
fileNamename of source code file
lineNumberline number in source file
Returns
0 if breakpoint is enabled after the call, regardless of previous state.

Python example: test_set_enabled.py

◆ setEnabled() [2/3]

int isys::CBreakpointController::setEnabled ( bool  isEnabled,
const std::string &  symbolName 
)

Enables / disables the breakpoint at the given symbol name.

Parameters
isEnabledset to true to enable the breakpoint, false to disable it
symbolNamename of symbol in target program, for example function name.
Returns
0 if breakpoint is enabled after the call, regardless of previous state.

Python example: test_set_enabled.py

◆ setEnabled() [3/3]

int isys::CBreakpointController::setEnabled ( bool  isEnabled,
int  memArea,
ADDRESS_64  address 
)

Enables / disables the breakpoint at the given address.

Parameters
isEnabledset to true to enable the breakpoint, false to disable it
memAreamemory area of the breakpoint
addressaddress of the breakpoint
Returns
0 if breakpoint is enabled after the call, regardless of previous state.

Python example: test_set_enabled.py

◆ setEnabledAll()

int isys::CBreakpointController::setEnabledAll ( bool  isEnabled)

Sets enabled status of all breakpoints.

Parameters
isEnabledset to true to enable breakpoints, false to disable them

Python example: test_set_enabled_all.py

◆ setHWBP() [1/2]

int isys::CBreakpointController::setHWBP ( DWORD  rwAccess,
DWORD  accessSize,
DWORD  usedDataBytes,
bool  isEntireObject,
const std::string &  symbolName,
DWORD  data 
)

Sets hardware breakpoint on the given variable or symbol.

This method can set only the most basic parameters of one hardware breakpoint. If you'd like to set more than one HW breakpoint, or options not supported by this method, please set winIDEA options. To find options, set some value in HW breakpoint dialog in winIDEA, then search for it in winIDEA Help | Display Options ...

Example for PowerPC:

import isystem.connect as ic

cmgr = ic.ConnectionMgr()
cmgr.connect()

ide = ic.CIDEController(cmgr)

#configure the breakpoint
strRoot = '/iOPEN/Breakpoints.PPC55xx.BP.'
strCore = '1'
ide.setOption(strRoot + 'HW.Enabled'              , 'true')
ide.setOption(strRoot + 'HW.e200[' + strCore + '].Enabled'      , 'true')
ide.setOption(strRoot + 'HW.e200[' + strCore + '].DAC_Enable[0]', 'true')
ide.setOption(strRoot + 'HW.e200[' + strCore + '].DAC_Access[0]', 'WR')
ide.setOption(strRoot + 'e200[' + strCore + '].DAC_Address[0]'  , 'VariableName')

#apply it to the MCU
print (ide.serviceCall('/iOPEN/Core.Debug.ApplyInternalBPs', ''))
Parameters
rwAccessdefines read/write access. Should be one of IConnectDebug::EBreakpointFlags which start with bHW_acc...:
accessSizedefines the size of access area. Should be one of IConnectDebug::EBreakpointFlags which start with bHW_Size...:
usedDataBytesdetermines which byte of data is used for data value comparison (00 = no data, FF = all). It can be set as ORed value of IConnectDebug::EBreakpointFlags which start with bHW_Data...:
isEntireObjectif true, all addresses occupied by object will be monitored, otherwise only the first address is monitored. For example, if symbol is array or struct, any address occupied by the symbol may trigger a breakpoint.
symbolNamename of symbol in target program, for example variable name.
datavalue used for comparison (access breakpoints only)
Returns
0 if there was no breakpoint before this call, 1 if the breakpoint at this location was already set

Python example: test_set_hwbp.py

◆ setHWBP() [2/2]

int isys::CBreakpointController::setHWBP ( DWORD  rwAccess,
DWORD  accessSize,
DWORD  usedDataBytes,
int  memArea,
ADDRESS_64  address,
DWORD  data 
)

Sets hardware breakpoint on the given address.

See setHWBP(DWORD, DWORD, DWORD, bool, const std::string &, DWORD) for limitations of this method and how to overcome them.

Parameters
rwAccessdefines read/write access. Should be one of IConnectDebug::EBreakpointFlags which start with bHW_acc...:
accessSizedefines the size of access area. Should be one of IConnectDebug::EBreakpointFlags which start with bHW_Size...:
usedDataBytesdetermines which byte of data is used for data value comparison (00 = no data, FF = all). It can be set as ORed value of IConnectDebug::EBreakpointFlags which start with bHW_Data...:
memAreamemory area of address
addressaddress to be monitored
datavalue used for comparison (access breakpoints only)
Returns
0 if there was no breakpoint before this call, 1 if the breakpoint at this location was already set

Python example: test_set_hwbp.py

◆ setHWEnabled() [1/2]

int isys::CBreakpointController::setHWEnabled ( bool  isEnabled,
const std::string &  symbolName 
)

Enables / disables hardware breakpoint at the given symbol name.

Parameters
isEnabledset to true to enable the breakpoint, false to disable it
symbolNamename of symbol in target program, for example function name.
Returns
0 if breakpoint is enabled after the call, regardless of previous state.

Python example: test_set_hw_enabled.py

◆ setHWEnabled() [2/2]

int isys::CBreakpointController::setHWEnabled ( bool  isEnabled,
int  memArea,
ADDRESS_64  address 
)

Enables / disables hardware breakpoint at the given address.

Parameters
isEnabledset to true to enable the breakpoint, false to disable it
memAreamemory area of the breakpoint
addressaddress of the breakpoint
Returns
0 if breakpoint is enabled after the call, regardless of previous state.

◆ setHWEnabledAll()

int isys::CBreakpointController::setHWEnabledAll ( bool  isEnabled)

Sets enabled status of all hardware breakpoints.

Parameters
isEnabledset to true to enable breakpoints, false to disable them

Python example: test_set_hw_enabled_all.py