From 942511d71cf68f500494116c9e6b25bad3890c25 Mon Sep 17 00:00:00 2001 From: tudnai Date: Fri, 4 Nov 2022 21:20:56 -0700 Subject: [PATCH] Fixes in Debug Mode + break on BRK, HLT, INV enabled --- .../xcdebugger/Expressions.xcexplist | 86 ++++++++++--------- .../xcshareddata/xcschemes/Debug.xcscheme | 9 ++ A2Mac/DebuggerWindowController.swift | 5 -- src/cpu/6502.c | 11 ++- src/cpu/6502_debugger.c | 2 +- src/util/disassembler.c | 10 +-- 6 files changed, 72 insertions(+), 51 deletions(-) diff --git a/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist b/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist index b91650e..95a7993 100644 --- a/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist +++ b/A2Mac.xcodeproj/project.xcworkspace/xcuserdata/trudnai.xcuserdatad/xcdebugger/Expressions.xcexplist @@ -48,7 +48,7 @@ value = "default_MHz_6502 * 1000 * 1000 / spkr_sample_rate"> + value = "( (spkr_clk + m6502.clkfrm) / ( 1024000 / spkr_sample_rate ) ) * 2"> @@ -66,7 +66,7 @@ value = "(spkr_clk + m6502.clkfrm)"> + value = "( (spkr_clk + m6502.clkfrm) / ( default_MHz_6502 * 1000 * 1000 / spkr_sample_rate)) * 2"> @@ -166,7 +166,7 @@ contextName = "closure #1 in ViewController.Update():ViewController.swift"> + value = "txtArr"> @@ -175,10 +175,10 @@ value = "txt"> + value = "MEMcfg.txt_page_2"> + value = "MEMcfg.is_80STORE"> @@ -225,9 +225,6 @@ - - @@ -240,6 +237,9 @@ + + @@ -307,7 +307,7 @@ contextName = "LoRes.Update():LoRes.swift"> + value = "blockChanged[ screenIdx ]"> @@ -316,7 +316,7 @@ value = "UInt8(block & 4)"> + value = "UInt8( (block >> 4) & 0x0F )"> @@ -425,13 +425,13 @@ contextName = "m6502_Debug:6502.c"> + value = "m6502.SP"> + value = "m6502.debugger.SP"> @@ -583,10 +583,10 @@ contextName = "ToolBarController.GamePort(_:):ToolBarController.swift"> + value = "ViewController.current?.mouseCursorJoystickEmulation"> + value = "ViewController.current?.mouseCursorHidden"> @@ -625,13 +625,13 @@ contextName = "HiRes.compute():HiRes.swift"> + value = "computePipelineState.maxTotalThreadsPerThreadgroup"> + value = "UnsafeRawBufferPointer(result)"> @@ -718,7 +718,7 @@ value = "new"> + value = "WOZwrite.shift16"> @@ -730,7 +730,7 @@ value = "(1 << i) - 1"> + value = "WOZtmp.shift16"> @@ -898,10 +898,10 @@ contextName = "set_flags_NZC:common.h"> + value = "(unsigned)test "> + value = "(unsigned)0xFF"> @@ -935,10 +935,10 @@ contextName = "HiRes.draw(_:):HiRes.swift"> + value = "linAddr"> + value = "HiRes.blockCols"> @@ -961,14 +961,14 @@ + + - - + value = "ctx?.data"> @@ -1004,22 +1004,22 @@ value = "m6502"> + value = "(void*)Apple2_64K_RAM"> + value = "Apple2_64K_RAM + 0x3600"> + + - - + value = "m6502.clkfrm"> @@ -1037,6 +1037,9 @@ + + @@ -1049,9 +1052,6 @@ - - + + + + + + @@ -1149,7 +1157,7 @@ value = "pdl_value[pdl]"> + value = "normalized_time >= pdl_value[pdl] ? 255 : 0"> @@ -1161,7 +1169,7 @@ value = "1 * 512 * (1 - ( 3300 / 3300.0 ))"> + value = "normalized_time"> @@ -1232,10 +1240,10 @@ value = "Apple2_64K_AUX + 0xC600"> + value = "(void*)rom"> + value = "Apple2_64K_RAM + 0xC600"> diff --git a/A2Mac.xcodeproj/xcshareddata/xcschemes/Debug.xcscheme b/A2Mac.xcodeproj/xcshareddata/xcschemes/Debug.xcscheme index a21cbb2..2771166 100644 --- a/A2Mac.xcodeproj/xcshareddata/xcschemes/Debug.xcscheme +++ b/A2Mac.xcodeproj/xcshareddata/xcschemes/Debug.xcscheme @@ -63,6 +63,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + enableAddressSanitizer = "YES" + enableASanStackUseAfterReturn = "YES" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" @@ -89,6 +91,13 @@ ReferencedContainer = "container:A2Mac.xcodeproj"> + + + +