GitLab has been upgraded to 13.3.6. If you encounter any issues mail code@riscosopen.org

Commit dd8ac1d9 authored by Jeffrey Lee's avatar Jeffrey Lee

Update to work with zero page relocation

Detail:
  s/Debugger - Try reading DebuggerSpace location using OS_ReadSysInfo 6 before falling back on legacy address. Compute appropriate MOV PC,DebuggerSpace instruction instead of using hard-coded one.
Admin:
  Tested on rev A2 BB-xM


Version 1.82. Tagged as 'Debugger-1_82'
parent 73fbcc05
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.81"
Module_Version SETA 181
Module_MajorVersion SETS "1.82"
Module_Version SETA 182
Module_MinorVersion SETS ""
Module_Date SETS "22 Mar 2010"
Module_ApplicationDate SETS "22-Mar-10"
Module_Date SETS "04 Aug 2011"
Module_ApplicationDate SETS "04-Aug-11"
Module_ComponentName SETS "Debugger"
Module_ComponentPath SETS "castle/RiscOS/Sources/Programmer/Debugger"
Module_FullVersion SETS "1.81"
Module_HelpVersion SETS "1.81 (22 Mar 2010)"
Module_FullVersion SETS "1.82"
Module_HelpVersion SETS "1.82 (04 Aug 2011)"
END
/* (1.81)
/* (1.82)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.81
#define Module_MajorVersion_CMHG 1.82
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 22 Mar 2010
#define Module_Date_CMHG 04 Aug 2011
#define Module_MajorVersion "1.81"
#define Module_Version 181
#define Module_MajorVersion "1.82"
#define Module_Version 182
#define Module_MinorVersion ""
#define Module_Date "22 Mar 2010"
#define Module_Date "04 Aug 2011"
#define Module_ApplicationDate "22-Mar-10"
#define Module_ApplicationDate "04-Aug-11"
#define Module_ComponentName "Debugger"
#define Module_ComponentPath "castle/RiscOS/Sources/Programmer/Debugger"
#define Module_FullVersion "1.81"
#define Module_HelpVersion "1.81 (22 Mar 2010)"
#define Module_LibraryVersionInfo "1:81"
#define Module_FullVersion "1.82"
#define Module_HelpVersion "1.82 (04 Aug 2011)"
#define Module_LibraryVersionInfo "1:82"
......@@ -244,6 +244,7 @@
GET Hdr:ResourceFS
GET Hdr:CPU.FPA
GET Hdr:CPU.Arch
GET Hdr:OSRSI6
GET Hdr:Debugger
......@@ -328,6 +329,9 @@ MessageFile_Open # 4 ; Opened message file flag
SysIs32bit # 1 ; non-zero if on a 32-bit system
# 3
ptr_DebuggerSpace # 4
MOVPCInstr # 4
; SAR
DisOpts # 4 ; Disassembler options
DisOpt_APCS * 2_1 ; Use APCS register names (when set)
......@@ -609,25 +613,64 @@ Debug_Init Entry
STRB R3, SysIs32bit
BEQ %FT40
; Find DebuggerSpace
MOV R0, #6
MOV R1, #0
MOV R2, #OSRSI6_DebuggerSpace
SWI XOS_ReadSysInfo
MOVVS R2, #0
CMP R2, #0
LDREQ R2, =Legacy_DebuggerSpace
STR R2, ptr_DebuggerSpace
ASSERT nbreakpoints*8 <= ?Legacy_DebuggerSpace
; Calculate MOVPCInstr
; This whole section could do with some checks to make sure DebuggerSpace and DebuggerSpace_Size are acceptable
LDR R0, ptr_DebuggerSpace
MOV R1, #32 ; ROR amount
LDR R2, =&E3A0F000 ; MOV PC,#0
25
CMP R0, #256
MOVHS R0, R0, LSR #2
SUBHS R1, R1, #2
BHS %BT25
ORR R2, R2, R0
ORR R2, R2, R1, LSL #7
STR R2, MOVPCInstr
; MakeBranch modifies MOVPCInstr by just adding the breakpoint number * 2
; So 2 :ROR: R1 is the number of bytes between each branch
MOV R3, #2
MOV R3, R3, ROR R1
; Fill in the zero page branch table
ASSERT nbreakpoints*8 <= ?DebuggerSpace
MOV R0, #DebuggerSpace + nbreakpoints*8
LDR R4, ptr_DebuggerSpace
ASSERT nbreakpoints = 16
ADD R0, R4, R3, LSL #4
LDR R1, =&E51FF004 ; LDR PC,[PC,#-4]
ADR R2, BreakCodeStart + (nbreakpoints-1)*8
30 STMDB R0!, {R1, R2}
30 SUB R0, R0, R3
STMIA R0, {R1, R2}
SUB R2, R2, #8
CMP R0, #DebuggerSpace
CMP R0, R4
BHI %BT30
[ StrongARM
MOV r1, r0
MOV r0, #1
MOV r1, #DebuggerSpace
ADD r2, r1, #(nbreakpoints)*8-4
ASSERT nbreakpoints = 16
ADD r2, r1, r3, LSL #4
SWI XOS_SynchroniseCodeAreas
CLRV
]
;
40
; SAR
MOV R3, #0
......@@ -5688,8 +5731,7 @@ MakeBranch ROUT
; Out r2 = instruction
MakeMOVPC ROUT
ASSERT DebuggerSpace < &400
LDR r2, =&E3A0FF00 + (DebuggerSpace :SHR: 2)
LDR r2, MOVPCInstr
ADD r2, r2, r3, LSR #2
MOV pc, lr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment