Commit 292298cb authored by Jeffrey Lee's avatar Jeffrey Lee Committed by ROOL

Fix null pointer dereference in exception dump

Fix a couple of places in the Annotate function where null annotation
block pointers could be accessed. Should fix the Debugger crash from
this thread: https://www.riscosopen.org/forum/forums/4/topics/15014

Also trim some redundant code from the ExcPeekMem2 routine.

Version 2.07. Tagged as 'Debugger-2_07'
parent 97a48317
......@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
Module_MajorVersion SETS "2.06"
Module_Version SETA 206
Module_MajorVersion SETS "2.07"
Module_Version SETA 207
Module_MinorVersion SETS ""
Module_Date SETS "28 Dec 2019"
Module_ApplicationDate SETS "28-Dec-19"
Module_Date SETS "05 Feb 2020"
Module_ApplicationDate SETS "05-Feb-20"
Module_ComponentName SETS "Debugger"
Module_FullVersion SETS "2.06"
Module_HelpVersion SETS "2.06 (28 Dec 2019)"
Module_FullVersion SETS "2.07"
Module_HelpVersion SETS "2.07 (05 Feb 2020)"
END
/* (2.06)
/* (2.07)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 2.06
#define Module_MajorVersion_CMHG 2.07
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 28 Dec 2019
#define Module_Date_CMHG 05 Feb 2020
#define Module_MajorVersion "2.06"
#define Module_Version 206
#define Module_MajorVersion "2.07"
#define Module_Version 207
#define Module_MinorVersion ""
#define Module_Date "28 Dec 2019"
#define Module_Date "05 Feb 2020"
#define Module_ApplicationDate "28-Dec-19"
#define Module_ApplicationDate "05-Feb-20"
#define Module_ComponentName "Debugger"
#define Module_FullVersion "2.06"
#define Module_HelpVersion "2.06 (28 Dec 2019)"
#define Module_LibraryVersionInfo "2:6"
#define Module_FullVersion "2.07"
#define Module_HelpVersion "2.07 (05 Feb 2020)"
#define Module_LibraryVersionInfo "2:7"
......@@ -841,7 +841,10 @@ static void Annotate(exc_context_t *ctx, uint32_t start, uint32_t end, eprocmode
{
/* Make a note of the address of the next frame */
excresult next_fp = ExcPeekMem(ctx, annotaddr);
block->next_fp = next_fp.val;
if (block)
{
block->next_fp = next_fp.val;
}
if (next_fp.ok)
{
if (!next_fp.val)
......@@ -858,7 +861,7 @@ static void Annotate(exc_context_t *ctx, uint32_t start, uint32_t end, eprocmode
}
}
}
else
else if(block)
{
/* Forward-fill line flags */
for(int i=1;i<LINEBUFFER_SIZE;i++)
......
......@@ -754,7 +754,6 @@ ExcWriteFile
EXPORT ExcPeekMem2
ExcPeekMem2 ROUT
Entry
SUB r12, sl, #:INDEX:CRelocOffset
; Check address directly
BIC a1, a2, #3
ADD a2, a1, #4
......@@ -764,11 +763,6 @@ ExcPeekMem2 ROUT
MOVCS a1, #0
MOVCS a2, #0
EXIT
90
BIC a3, a3, #3
LDR a1, [a1, a3]
MOV a2, #1
EXIT
; const char *ExcGetMsg(exc_context_t *ctx, exc_msg msg)
EXPORT ExcGetMsg
......
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