Skip to content

Commit

Permalink
Fix compilation of the AArch32 simulator support code.
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotmiranda committed Aug 9, 2021
1 parent 504c482 commit 83613ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion processors/ARM/gdb-8.3.1/sim/arm/armos.c
Expand Up @@ -406,7 +406,7 @@ ARMul_OSHandleSWI (ARMul_State * state, ARMword number)
state->EndCondition = InstructionPrefetchError;

// during execution, the pc points the next fetch address, which is 8 byte after the current instruction.
gdb_log_printf(NULL, "Illegal Instruction fetch address (%#p).", state->Reg[15]-8);
// gdb_log_printf(NULL, "Illegal Instruction fetch address (%#p).", state->Reg[15]-8);
return TRUE; // escape immediately
break;
#endif
Expand Down
18 changes: 6 additions & 12 deletions processors/ARM/gdb-8.3.1/sim/arm/armulmem.c
Expand Up @@ -13,6 +13,7 @@
*/
#if COG
# include "GdbARMPlugin.h"
extern uintptr_t minReadAddress, minWriteAddress;
#endif

/* armvirt.c -- ARMulator virtual memory interace: ARM6 Instruction Emulator.
Expand Down Expand Up @@ -77,18 +78,14 @@ int SWI_vector_installed = FALSE;
static ARMword
GetWord (ARMul_State * state, ARMword address, int check)
{
if(address < minReadAddress || address + 4 > (state->MemSize))
{
if (address < minReadAddress || address + 4 > (state->MemSize)) {
//raise memory access error
state->EndCondition = MemoryBoundsError;
state->Emulate = FALSE;
gdb_log_printf(NULL, "Illegal memory read at %#p. ", address);
// gdb_log_printf(NULL, "Illegal memory read at %#p. ", address);
return 0;
}
else
{
return *((ARMword*) (state->MemDataPtr + (address & ~3)));
}
return *((ARMword*) (state->MemDataPtr + (address & ~3)));
}

/***************************************************************************\
Expand All @@ -98,16 +95,13 @@ GetWord (ARMul_State * state, ARMword address, int check)
static void
PutWord (ARMul_State * state, ARMword address, ARMword data, int check)
{
if(address < minWriteAddress || address + 4 > (state->MemSize))
{
if (address < minWriteAddress || address + 4 > (state->MemSize)) {
state->Emulate = FALSE;
state->EndCondition = MemoryBoundsError;
gdb_log_printf(NULL, "Illegal memory write at %#p. ", address);
// gdb_log_printf(NULL, "Illegal memory write at %#p. ", address);
}
else
{
*((ARMword*) (state->MemDataPtr + (address & ~3))) = data;
}
}

/***************************************************************************\
Expand Down

0 comments on commit 83613ff

Please sign in to comment.