Skip to content
Permalink
Browse files

Limited Watchpoints to debug mode, unset value.

Two values in TEmulator were not initialized correctly.
  • Loading branch information
Matthias Melcher
Matthias Melcher committed Jan 30, 2020
1 parent 64f248a commit 638183a827910f1d40316043346d155db2bf0bb0
@@ -97,9 +97,12 @@ TEmulator::TEmulator(
mFileManager( NULL ),
mLog( inLog ),
mMonitor( NULL ),
mSignal( 0 ),
mInterrupted( 0 ),
mRunning( false ),
mPaused( false ),
mBPHalted( false )
mBPHalted( false ),
mBPID( 0 )
{
mInterruptManager = new TInterruptManager(inLog, &mProcessor);
#ifdef JIT_PERFORMANCE
@@ -177,9 +180,12 @@ TEmulator::TEmulator(
mScreenManager( nil ),
mLog( inLog ),
mMonitor( NULL ),
mSignal( 0 ),
mInterrupted( 0 ),
mRunning( false ),
mPaused( false ),
mBPHalted( false )
mBPHalted( false ),
mBPID( 0 )
{
mInterruptManager = new TInterruptManager(inLog, &mProcessor);
#ifdef JIT_PERFORMANCE
@@ -700,13 +700,15 @@ TMemory::ReadInstruction( KUInt32 inBankNumber, KUInt32 inOffsetInBank )
Boolean
TMemory::Read( VAddr inAddress, KUInt32& outWord )
{
#ifdef _DEBUG
int i;
for (i=0; i<mWPCount; i++) {
if ((mWatchpoints[i].fAddress==inAddress) && (mWatchpoints[i].fMode&1)) {
fprintf(stderr, "Watchpoint 0x%08X read around 0x%08X\n", (unsigned int)inAddress, (unsigned int)mProcessor->mCurrentRegisters[15]);
mEmulator->BreakInMonitor();
}
}
#endif

PAddr theAddress;

@@ -738,13 +740,15 @@ TMemory::Read( VAddr inAddress, KUInt32& outWord )
Boolean
TMemory::ReadAligned( VAddr inAddress, KUInt32& outWord )
{
#ifdef _DEBUG
int i;
for (i=0; i<mWPCount; i++) {
if ((mWatchpoints[i].fAddress==inAddress) && (mWatchpoints[i].fMode&1)) {
fprintf(stderr, "Watchpoint 0x%08X read around 0x%08X\n", (unsigned int)inAddress, (unsigned int)mProcessor->mCurrentRegisters[15]);
mEmulator->BreakInMonitor();
}
}
#endif

PAddr theAddress;

@@ -776,13 +780,15 @@ TMemory::ReadAligned( VAddr inAddress, KUInt32& outWord )
inline Boolean
TMemory::ReadROMRAM( VAddr inAddress, KUInt32& outWord )
{
#ifdef _DEBUG
int i;
for (i=0; i<mWPCount; i++) {
if ((mWatchpoints[i].fAddress==inAddress) && (mWatchpoints[i].fMode&1)) {
fprintf(stderr, "Watchpoint 0x%08X read around 0x%08X\n", (unsigned int)inAddress, (unsigned int)mProcessor->mCurrentRegisters[15]);
mEmulator->BreakInMonitor();
}
}
#endif

PAddr theAddress;

@@ -1332,13 +1338,15 @@ TMemory::ReadROMRAMP( PAddr inAddress, Boolean& outFault )
Boolean
TMemory::ReadB( VAddr inAddress, KUInt8& outByte )
{
#ifdef _DEBUG
int i;
for (i=0; i<mWPCount; i++) {
if ((mWatchpoints[i].fAddress==inAddress) && (mWatchpoints[i].fMode&1)) {
fprintf(stderr, "Watchpoint 0x%08X read around 0x%08X\n", (unsigned int)inAddress, (unsigned int)mProcessor->mCurrentRegisters[15]);
mEmulator->BreakInMonitor();
}
}
#endif

PAddr theAddress;

@@ -1525,13 +1533,15 @@ TMemory::ReadBP( PAddr inAddress, KUInt8& outByte )
Boolean
TMemory::Write( VAddr inAddress, KUInt32 inWord )
{
#ifdef _DEBUG
int i;
for (i=0; i<mWPCount; i++) {
if ((mWatchpoints[i].fAddress==inAddress) && (mWatchpoints[i].fMode&2)) {
fprintf(stderr, "Watchpoint 0x%08X written around 0x%08X\n", (unsigned int)inAddress, (unsigned int)mProcessor->mCurrentRegisters[15]);
mEmulator->BreakInMonitor();
}
}
#endif

PAddr theAddress;

@@ -1560,14 +1570,16 @@ TMemory::Write( VAddr inAddress, KUInt32 inWord )
Boolean
TMemory::WriteAligned( VAddr inAddress, KUInt32 inWord )
{
#ifdef _DEBUG
int i;
for (i=0; i<mWPCount; i++) {
if ((mWatchpoints[i].fAddress==inAddress) && (mWatchpoints[i].fMode&2)) {
fprintf(stderr, "Watchpoint 0x%08X written around 0x%08X\n", (unsigned int)inAddress, (unsigned int)mProcessor->mCurrentRegisters[15]);
mEmulator->BreakInMonitor();
}
}

#endif

PAddr theAddress;

if (IsMMUEnabled())
@@ -1595,14 +1607,16 @@ TMemory::WriteAligned( VAddr inAddress, KUInt32 inWord )
inline Boolean
TMemory::WriteRAM( VAddr inAddress, KUInt32 inWord )
{
#ifdef _DEBUG
int i;
for (i=0; i<mWPCount; i++) {
if ((mWatchpoints[i].fAddress==inAddress) && (mWatchpoints[i].fMode&2)) {
fprintf(stderr, "Watchpoint 0x%08lX written around 0x%08lX\n", (unsigned long)inAddress, (unsigned long)mProcessor->mCurrentRegisters[15]);
mEmulator->BreakInMonitor();
}
}

#endif

PAddr theAddress;

if (IsMMUEnabled())
@@ -2107,14 +2121,16 @@ TMemory::WriteRAMP( PAddr inAddress, KUInt32 inWord )
Boolean
TMemory::WriteB( VAddr inAddress, KUInt8 inByte )
{
#ifdef _DEBUG
int i;
for (i=0; i<mWPCount; i++) {
if ((mWatchpoints[i].fAddress==inAddress) && (mWatchpoints[i].fMode&2)) {
fprintf(stderr, "Watchpoint 0x%08X written around 0x%08X\n", (unsigned int)inAddress, (unsigned int)mProcessor->mCurrentRegisters[15]);
mEmulator->BreakInMonitor();
}
}

#endif

PAddr theAddress;
if (IsMMUEnabled())
{
@@ -79,7 +79,7 @@ TMonitorCore::ExecuteScript( const char* inScriptFile )
int n = (int)strlen(buf);
if (n) {
if (buf[n-1]=='\n') n--;
if (buf[n-1]=='\r') n--;
if ((n>0) && (buf[n-1]=='\r')) n--;
buf[n] = 0;
char *s = buf;
while (*s=='\t' || *s==' ') s++;
@@ -1,8 +1,15 @@
apply plugin: 'com.android.application'

android {
signingConfigs {
release {
storeFile file('/Users/matt/Android/upload-keystore.jks')
storePassword 'cif3cizu'
keyAlias = 'upload'
keyPassword 'dgy648!jfko'
}
}
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.newtonforever.einstein"
minSdkVersion 15
@@ -26,6 +33,7 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
externalNativeBuild {
@@ -41,6 +41,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "Einstein.app"
BlueprintName = "Einstein"
ReferencedContainer = "container:Einstein.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
@@ -53,17 +62,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "Einstein.app"
BlueprintName = "Einstein"
ReferencedContainer = "container:Einstein.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -85,8 +83,6 @@
ReferencedContainer = "container:Einstein.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"

0 comments on commit 638183a

Please sign in to comment.
You can’t perform that action at this time.