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

Function CmdBookmarkAdd

source/Debugger/Debug.cpp:609–648  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

607
608//===========================================================================
609Update_t CmdBookmarkAdd (int nArgs )
610{
611 // BMA address
612 // BMA # address ; where # is [0...9]
613 if (! nArgs)
614 {
615 return CmdBookmarkList( 0 );
616 }
617
618 int iBookmark = 0;
619
620 int iArg = 1;
621 if (nArgs > 1)
622 {
623 iBookmark = g_aArgs[ iArg ].nValue;
624 iArg++;
625 }
626 else
627 {
628 while ((iBookmark < MAX_BOOKMARKS) && g_aBookmarks[iBookmark].bSet)
629 iBookmark++;
630 }
631
632 WORD nAddress = g_aArgs[ iArg ].nValue;
633
634 if (iBookmark >= MAX_BOOKMARKS)
635 {
636 ConsoleDisplayPushFormat( "All bookmarks are currently in use. (Max: %d)", MAX_BOOKMARKS );
637 return ConsoleUpdate();
638 }
639
640 if (Bookmark_Find( nAddress ))
641 _Bookmark_Del( nAddress );
642
643 bool bAdded = _Bookmark_Add( iBookmark, nAddress );
644 if (!bAdded)
645 return Help_Arg_1( CMD_BOOKMARK_ADD );
646
647 return UPDATE_DISASM | ConsoleUpdate();
648}
649
650//===========================================================================
651Update_t CmdBookmarkClear (int nArgs)

Callers 2

CmdBookmarkFunction · 0.85
DebuggerProcessKeyFunction · 0.85

Calls 7

CmdBookmarkListFunction · 0.85
ConsoleDisplayPushFormatFunction · 0.85
Bookmark_FindFunction · 0.85
_Bookmark_DelFunction · 0.85
_Bookmark_AddFunction · 0.85
Help_Arg_1Function · 0.85
ConsoleUpdateFunction · 0.70

Tested by

no test coverage detected