MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / CmdBreakpointAddPC

Function CmdBreakpointAddPC

source/Debugger/Debug.cpp:1821–1874  ·  view source on GitHub ↗

=========================================================================== Pre: nArgs = last valid index into g_aArgs[]

Source from the content-addressed store, hash-verified

1819//===========================================================================
1820// Pre: nArgs = last valid index into g_aArgs[]
1821Update_t CmdBreakpointAddPC (int nArgs)
1822{
1823 BreakpointSource_t iSrc = BP_SRC_REG_PC;
1824 BreakpointOperator_t iCmp = BP_OP_EQUAL ;
1825
1826 if (!nArgs)
1827 {
1828 nArgs = 1;
1829// g_aArgs[1].nValue = regs.pc;
1830 g_aArgs[1].nValue = g_nDisasmCurAddress;
1831 }
1832
1833// int iParamSrc;
1834 int iParamCmp;
1835
1836 int nFound = 0;
1837
1838 int iArg = 1;
1839 while (iArg <= nArgs)
1840 {
1841 char *sArg = g_aArgs[iArg].sArg;
1842
1843 if (g_aArgs[iArg].bType & TYPE_OPERATOR)
1844 {
1845 nFound = FindParam( sArg, MATCH_EXACT, iParamCmp, _PARAM_BREAKPOINT_BEGIN, _PARAM_BREAKPOINT_END );
1846 if (nFound)
1847 {
1848 switch (iParamCmp)
1849 {
1850 case PARAM_BP_LESS_EQUAL : iCmp = BP_OP_LESS_EQUAL ; break;
1851 case PARAM_BP_LESS_THAN : iCmp = BP_OP_LESS_THAN ; break;
1852 case PARAM_BP_EQUAL : iCmp = BP_OP_EQUAL ; break;
1853 case PARAM_BP_NOT_EQUAL : iCmp = BP_OP_NOT_EQUAL ; break;
1854 case PARAM_BP_GREATER_THAN : iCmp = BP_OP_GREATER_THAN ; break;
1855 case PARAM_BP_GREATER_EQUAL: iCmp = BP_OP_GREATER_EQUAL; break;
1856 default:
1857 break;
1858 }
1859 }
1860 iArg++;
1861 }
1862 else
1863 {
1864 int dArg = _CmdBreakpointAddCommonArg( nArgs, iArg, iSrc, iCmp );
1865 if (! dArg)
1866 {
1867 return Help_Arg_1( CMD_BREAKPOINT_ADD_PC );
1868 }
1869 iArg += dArg;
1870 }
1871 }
1872
1873 return UPDATE_BREAKPOINTS | UPDATE_CONSOLE_DISPLAY; // 1;
1874}
1875
1876
1877//===========================================================================

Callers 1

CmdBreakpointFunction · 0.85

Calls 3

FindParamFunction · 0.85
Help_Arg_1Function · 0.85

Tested by

no test coverage detected