Chapter 6 - A commented debug log example.

------------------------------------------------------------------------------
003> ASM_Exception: DAR 0x0 DSISR 0xa000000
004> ASM_Exception: IntGPR1 0xc02fb8 SRR0 0x21240a34 SRR1 0xf030 LR 0x21240a5c
005> ASM_Exception: Type 0x3
006> ASM_Exception: Thread 0xe0e640 Name ABox
007> ASM_Exception: DAR 0x0 DSISR 0xa000000
------------------------------------------------------------------------------
001-010: ASM_Exception
  This debug comes from the Quark kernel and will always happen, even  if  the
  ABox and Exec are badly trashed.

  Most important information is:
  - DAR (the last accessed invalid address)
  - Exception Type. Most common ones are:
    DATAACCESS 0x3 when accessing data from/to invalid memory
    INSTACCESS 0x4 when running code from invalid memory
    PROGRAM    0x7 when trying to execute an invalid instruction


------------------------------------------------------------------------------
011> Quark Thread:
012>     TID 0000000010020010
013>    Name ABox
014>  Exception 3 <Illegal Data Access at 00000000 DSISR 0a000000, Store is not allowed because of protection modes>
------------------------------------------------------------------------------
011-097:
  The PowerPC is a RISC CPU family using a load/store architecture.
  An illegal memory access can be caused by a load (memory read)  or  a  store
  (memory write) operation.

  This debug comes from ABox's exception-handler.


098-199: Running Task
  This debug comes from Exec's exception-handler and is a dump of  the  faulty
  task's state.


------------------------------------------------------------------------------
107>       Task 0x2260cd30 Name 0x226e89b4 <Shell Process> Type 13 Pri 0
108>      Flags 0x8 State 2 IDNestCnt -1 TDNestCnt -1
109>   SigAlloc 0x0000ffff    SigWait 0x00000100 SigRecvd 0x04008120 SigExcept 0x00000000
110> ExceptCode 0x10100670 ExceptData 0x00000000 TrapCode 0x10100970  TrapData 0x00000000
111>     Switch 0x00000000     Launch 0x00000000 UserData 0x215fc21c
112>    SPLower 0x21623c48    SPUpper 0x216ff7e8    SPReg 0x226e8950
------------------------------------------------------------------------------
  107-112: Dump of Exec Task structure.
    107:
      Name of the task that caused the crash.

    109: task's signals
      You can take a look at SigAlloc (allocated  signals  mask)  and  SigWait
      (wait signals mask) to know if the task was waiting  for  some  specific
      signal (see exec.doc/AllocSignal and exec.doc/Wait).

    112: task's 68k stack boundaries, a7 being the stack pointer

    For more information, see "struct Task" in exec/tasks.h header file.


------------------------------------------------------------------------------
114>          ETask 0x2081f2b4
115>        MemPool 0x205bc788     PPCLibData 0x00000000
116>     PPCSPLower 0x2117d204     PPCSPUpper 0x21185200
117> PPCTrapMsgPort 0x00000000 PPCTrapMessage 0x20774fd4
118>    PPCRegFrame 0x211848e0
119>      Private[] 0x00000000 0x00000000 0x00000000 0x00000000
120>     EmulHandle 0x00000000
------------------------------------------------------------------------------
  114-120: Dump of Exec Task Extension structure.
    116: task's PPC stack boundaries, r1 being the stack pointer

    For more information, see "struct ETask" in exec/tasks.h header file.


------------------------------------------------------------------------------
122>  EmulHandle 0x21185110     Type 0x00000004    Flags 0x00000001
123> SuperHandle 0x10001000     Type 0x00000000 WaitMask 0x00000000 SyncMask 0x00000000
124>         USP 0x00000000      SSP 0x20004818      VBR 0x2000ded0
125>         SFC 0x00000000      DFC 0x00000000     CACR 0x00000000   TC 0x00000000
126>        ITT0 0x00000000     ITT1 0x00000000     DTT0 0x00000000 DTT1 0x00000000
127>         URP 0x00000000      SRP 0x00000000    BUSCR 0x00000000  PCR 0x04310000
------------------------------------------------------------------------------
  122    : The r2  register  always  contains  a  pointer  to  the  EmulHandle
           structure.
  124-127: Dump of some virtual 68k registers.


------------------------------------------------------------------------------
129>    SRR0 0x21240a34 SRR1 0x0000f030
130>      LR 0x21240a5c  CTR 0x10115934
131>      CR 0x22002022  XER 0x20000000
132> GPR[00] 212408cc 21184ba0 21185110 00000000 00000000 fffffff7 00000004 00000004
133> GPR[08] 20850000 20850000 20850000 20850000 24002022 00000000 21184d08 087805bd
134> GPR[16] 0000000a 0000000a 00000000 226e89b4 2260ce14 226e89b0 00000001 08983385
135> GPR[24] 226e89b0 08212584 2085bcb4 20850000 20850000 20850000 20850000 2260cd30
------------------------------------------------------------------------------
  129-135: Dump of PowerPC registers.
    129-131: content of SRR0, LR, etc. registers
    132: content of r0 to r7 registers
    133: content of r8 to r15 registers
    134: content of r16 to r23 registers
    135: content of r24 to r31 registers


------------------------------------------------------------------------------
136> SRR0 -> hitmania Hunk 1 Offset 0x00000624
137>   LR -> hitmania Hunk 1 Offset 0x0000064c
138>  CTR -> Module Hunk 0 Offset 0x00015934
------------------------------------------------------------------------------
  136-138: SegTracker information
    For SRR0, LR and CTR registers, tells where the address points  to.  Could
    be inside MorphOS or in a user executable. Includes name, hunk and offset.

    So, by looking at this information, it's possible to know the place  where
    this task crashed (SRR0) and the code it was previously executing (LR).

    The chapter 3 and the chapter 4 explain how to use this information.


------------------------------------------------------------------------------
140> PPCStackFrame History:
141> StackFrame[-0].LR-> Address 0x212408cc -> hitmania Hunk 1 Offset 0x000004bc
142> StackFrame[-1].LR-> Address 0x212406ac -> hitmania Hunk 1 Offset 0x0000029c
143> StackFrame[-2].LR-> Address 0x10248f5c -> Module Hunk 0 Offset 0x00148f5c
144> StackFrame[-3].LR-> Address 0x1024d9b0 -> Module Hunk 0 Offset 0x0014d9b0
145> StackFrame[-4].LR-> Address 0x1024d6b0 -> Module Hunk 0 Offset 0x0014d6b0
146> StackFrame[-5].LR-> Address 0x102b5b1c -> Module Hunk 0 Offset 0x001b5b1c
147> StackFrame[-6].LR-> Address 0x102b20e4 -> Module Hunk 0 Offset 0x001b20e4
148> StackFrame[-7].LR-> Address 0x102b1328 -> Module Hunk 0 Offset 0x001b1328
149> StackFrame[-8].LR-> Address 0x102b0dd8 -> Module Hunk 0 Offset 0x001b0dd8
150> StackFrame[-9].LR-> Address 0x10241da0 -> Module Hunk 0 Offset 0x00141da0
151> StackFrame[-10].LR-> Address 0x10241bf0 -> Module Hunk 0 Offset 0x00141bf0
152> StackFrame[-11].LR-> Address 0x10241e64 -> Module Hunk 0 Offset 0x00141e64
------------------------------------------------------------------------------
  140-152: PPCStackFrame
    Basically, it's the stack backtrace (previous LR content).  So,  it's  all
    previous places the code was going through. If it would  return  from  the
    current function, this task would run the code pointed to by LR. And  when
    returning from the function pointed to  by  LR,  it  would  run  the  code
    pointed to by StackFrame[-0].LR, then by StackFrame[-1].LR, and so on...


--------------------------------------------------------------------------------
153> Full PPC mode: Last 68k context
154>    PC 87654321 SR 0008
155> Dn[0] 00000014 00100000 00002000 00000000 00000000 00000000 00000000 00000000
156> An[0] 215fc0c8 00000000 00000000 00000000 00000000 00000000 20000c38 216ff7e0
157> Stack: 0x216ff7e0
158> A7[-32] 00000000 00000000 00000000 00000000
159> A7[-16] 00000000 00000000 00000000 11328720
160> A7[000] 000dbba0 226e89b0 219317a8 0008fd78
161> A7[016] 00000000 00000000 00000000 00000000
162> A7[032] 00000000 00000000 00000000 00000000
163> A7[048] 00000000 00000000 00000000 00000000
164> A7[064] 00000000 00000000 00000000 00000000
165> A7[080] 00000000 00000000 00000000 00000000
166> A7[096] 00000000 00000000 00000000 00000000
167> A7[112] 00000000 00000000 00000000 00000000
------------------------------------------------------------------------------
  153-167: Dump of 68k context
    If no 68k code was executed, this part will be useless.
    Otherwise, it contains d0 to d7  and  a0  to  a7  registers  content,  68k
    program counter in PC register, 68k stackframe, and  so  on...  Note  that
    stack is also displayed from the negative, unused side (it could sometimes
    contain useful information). Stack pointer itself points to A7[000].

  168-183: Ignore this part for now.


------------------------------------------------------------------------------
186>     SegList 0x081dd3c6        GlobVec 0x202dbaf8
187>   StackBase 0x08588f12      StackSize 0x000dbba0
188>     TaskNum 0x00000006        Result2 0x00000000
189>  CurrentDir 0x081dd3cd            CIS 0x0878043b
190>         COS 0x087804f3            CES 0x00000000
191> ConsoleTask 0x207754c0 FileSystemTask 0x200099ac
192>         CLI 0x0878033d     ReturnAddr 0x216ff7e0
193>     PktWait 0x00000000      WindowPtr 0x00000000
194>      HomeDir 0x081c99d1         Flags 0x00000024
195>     ExitCode 0x00000000      ExitData 0x00000000
196>    Arguments 0x2085bcb4  ShellPrivate 0x00000000
197> CmdName: <hitmania>
------------------------------------------------------------------------------
  185-197: Dump of DOS Process structure
    Only if the crash happened for a dos process.
    Also contains the program name (CmdName), from shell.

<< A few tips | PowerPC Registers overview >>