Commit 7b449b13 authored by David Cotton's avatar David Cotton
Browse files

Added new debug flag DebugROMPostInit

Detail:
	It is often the case that modules fail on receipt of a PostInit
cervice call. The Kernel already has an option to display debugging on module
initialisation (DebugROMInit), but this does not help if a module crashes
during the PostInit stage.
	To aid debugging of the PostInit stage of module initialisation, a
new flag (DebugROMPostInit) has been added to the vanilla service call
handler. This flag displays the name of each module that the PostInit is
being dispatched to, and then displays whether control has passed back to the
kernel. Hence crashes of a module during PostInit can be detected.

Admin:
	Note that this debug option only works in the vanilla service call
handler. If your build uses the chocolate handler and you wish to debug
PostInit of modules, then set it temporarilly to use vanilla handlers.
	Tested in Lazarus builds both with and without the option switched.

Version 5.26. Not tagged
parent b41af248
......@@ -9,6 +9,6 @@
Module_MajorVersion SETS "5.26"
Module_Version SETA 526
Module_MinorVersion SETS ""
Module_Date SETS "09 May 2000"
Module_Date SETS "10 May 2000"
Module_FullVersion SETS "5.26"
END
......@@ -5,11 +5,11 @@
*/
#define Module_MajorVersion_CMHG 5.26
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 May 2000
#define Module_Date_CMHG 10 May 2000
#define Module_MajorVersion "5.26"
#define Module_Version 526
#define Module_MinorVersion ""
#define Module_Date "09 May 2000"
#define Module_Date "10 May 2000"
#define Module_FullVersion "5.26"
......@@ -755,6 +755,7 @@ Issue_Service ROUT ; R1 is service number, R2 may be a parameter
82
CMP R11,R10
BHS %FT88
Push "R10"
MOV R10,R1
LDR R9,[R11,#ServEntry_R1]
......@@ -825,6 +826,11 @@ Issue_Service ROUT ; R1 is service number, R2 may be a parameter
LDR R11, [R9, #Module_Service]
CMP R11, #0
BEQ %BT03
[ DebugROMPostInit
CMP R1, #Service_PostInit ; If it is a Service_PostInit call
BEQ display_pre_postinit_calls ; Go and display the postinit call
83
]
ADD R9, R9, R11
ADD R11, R10, #Module_incarnation_list - Incarnation_Link
04 LDR R11, [R11, #Incarnation_Link]
......@@ -854,6 +860,12 @@ Issue_Service ROUT ; R1 is service number, R2 may be a parameter
ADD sp, sp, #5*4
]
[ DebugROMPostInit
CMP R1, #Service_PostInit ; If it is a Service_PostInit call
BEQ display_post_postinit_calls ; Go and display the postinit call
87
]
CMP R1, #Service_Serviced
BNE %BT04
Pull "R9-R12, PC"
......@@ -982,6 +994,32 @@ checkmoshandlers
Pull "r0-r7"
B %BT05
[ DebugROMPostInit
; Display the title of the current module in the chain.
; R9 contains the module pointer.
display_pre_postinit_calls
SWI XOS_WriteS
= "postinit service call to mod ",0
Push "r0-r7"
LDR R0, [R9, #Module_Title]
ADD R0, R9, R0
SWI XOS_Write0
SWI XOS_WriteS
= " sent"
SWI XOS_NewLine
Pull "r0-r7"
B %BT83
; Display a message stating that we have finished the postinit service call.
; This will appear once for every module called on postinit.
display_post_postinit_calls
SWI XOS_WriteS
= "returned from postinit service call.",0
SWI XOS_NewLine
B %BT87
]
;************************************************
; SWI to call a vector
;************************************************
......
......@@ -321,6 +321,9 @@ DAF_SpecifyBit SETL {TRUE}
GBLL DebugROMInit
DebugROMInit SETL (MEMC_Type = "IOMD") :LAND: {FALSE}
GBLL DebugROMPostInit ; Displays when the PostInit service call is sent to each ROM module (currently works on vanilla service call handling only)
DebugROMPostInit SETL (MEMC_Type = "IOMD") :LAND: {FALSE}
GBLL DebugROMErrors
DebugROMErrors SETL (MEMC_Type = "IOMD") :LAND: {FALSE}
......
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