diff packages/kernel/current/src/debug/dbg_gdb.cxx @ 30:641b639be825 ecos-sw-1999-08-16

Merge from eCos master repository on 1999-08-16-22:01:37-BST
author jlarmour
date Mon, 16 Aug 1999 22:10:49 +0000
parents 01ce82f3e11a
children c38311975d4f
line wrap: on
line diff
--- a/packages/kernel/current/src/debug/dbg_gdb.cxx
+++ b/packages/kernel/current/src/debug/dbg_gdb.cxx
@@ -99,7 +99,12 @@ externC int dbg_thread_capabilities(stru
 
 static void dbg_make_threadref(Cyg_Thread *thread, threadref *ref )
 {
-    if( thread == NULL )                     
+    // The following test tries to avoid accessing uninitialized pointers.
+    // This can happen if we take a breakpoint before the data is copied
+    // or the BSS zeroed. We currently assume that RAM will reset to zero
+    // or 0xff. If it is random, we have no hope.
+
+    if( (CYG_ADDRWORD)thread == 0 || (CYG_ADDRWORD)thread == 0xffffffff )                     
     {
         ((unsigned long *)ref)[0] = 0;
         ((unsigned long *)ref)[1] = 0;