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

Function _CmdMemoryDump

source/Debugger/Debug.cpp:4182–4222  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

4180
4181//===========================================================================
4182static Update_t _CmdMemoryDump (int nArgs, int iWhich, int iView )
4183{
4184 if (!nArgs)
4185 {
4186 // Output current prefixed-address
4187 if (!g_aMemDump[iWhich].bActive)
4188 {
4189 ConsolePrintFormat("Mini memory area-%1d not set", iWhich+1);
4190 }
4191 else
4192 {
4193 std::string fullPrefixAddr = GetFullPrefixAddrForBreakpoint(g_aMemDump[iWhich].addrPrefix, g_aMemDump[iWhich].nAddress, g_aMemDump[iWhich].eDevice, false);
4194 ConsolePrintFormat("Mini memory area-%1d: %s", iWhich+1, fullPrefixAddr.c_str());
4195 }
4196 return ConsoleUpdate();
4197 }
4198
4199 int iArg = 1; // skip cmd
4200 int dArgPrefix = 0;
4201 g_aMemDump[iWhich].addrPrefix.Clear();
4202 if (!Range_GetAllPrefixes(iArg, nArgs, dArgPrefix, &g_aMemDump[iWhich].addrPrefix, false))
4203 return Help_Arg_1(g_iCommand);
4204
4205 WORD nAddress = 0;
4206 if (!MemoryDumpCheck(iArg, &nAddress))
4207 return Help_Arg_1(g_iCommand);
4208
4209 if (g_aMemDump[iWhich].addrPrefix.nSlot == AddressPrefix_t::kSlotInvalid &&
4210 (g_aArgs[iArg].eDevice == DEV_MB_SUBUNIT || g_aArgs[iArg].eDevice == DEV_AY8913_PAIR))
4211 {
4212 ConsolePrintFormat("Slot prefix required for MB or AY device");
4213 return ConsoleUpdate();
4214 }
4215
4216 g_aMemDump[iWhich].nAddress = nAddress;
4217 g_aMemDump[iWhich].eDevice = g_aArgs[iArg].eDevice;
4218 g_aMemDump[iWhich].bActive = true;
4219 g_aMemDump[iWhich].eView = (MemoryView_e) iView;
4220
4221 return UPDATE_MEM_DUMP; // TODO: This really needed? Don't think we do any actual output
4222}
4223
4224//===========================================================================
4225bool _MemoryCheckMiniDump ( int iWhich )

Callers 3

CmdMemoryMiniDumpHexFunction · 0.85
CmdMemoryMiniDumpAsciiFunction · 0.85
CmdMemoryMiniDumpAppleFunction · 0.85

Calls 7

ConsolePrintFormatFunction · 0.85
Range_GetAllPrefixesFunction · 0.85
Help_Arg_1Function · 0.85
MemoryDumpCheckFunction · 0.85
ConsoleUpdateFunction · 0.70
ClearMethod · 0.45

Tested by

no test coverage detected