diff packages/kernel/current/src/debug/dbg_gdb.cxx @ 10:d3fbcdfa1b2f ecos-sw-1999-05-29

Merge from eCos master repository on 1999-05-29-00:13:11-BST
author jlarmour
date Fri, 28 May 1999 16:43:09 +0000
parents 443894e2e912
children 01ce82f3e11a
line wrap: on
line diff
--- a/packages/kernel/current/src/debug/dbg_gdb.cxx
+++ b/packages/kernel/current/src/debug/dbg_gdb.cxx
@@ -99,16 +99,23 @@ externC int dbg_thread_capabilities(stru
 
 static void dbg_make_threadref(Cyg_Thread *thread, threadref *ref )
 {
-    cyg_uint16 id = thread->get_unique_id();
+    if( thread == NULL )                     
+    {
+        ((unsigned long *)ref)[0] = 0;
+        ((unsigned long *)ref)[1] = 0;
+    }
+    else
+    {
+        cyg_uint16 id = thread->get_unique_id();
 
 #if USE_ID
-    ((unsigned long *)ref)[0] = (unsigned long)thread;
-    ((unsigned long *)ref)[1] = (unsigned long)swap32(id);
+        ((unsigned long *)ref)[0] = (unsigned long)thread;
+        ((unsigned long *)ref)[1] = (unsigned long)swap32(id);
 #else    
-    ((unsigned long *)ref)[1] = (unsigned long)thread;
-    ((unsigned long *)ref)[0] = (unsigned long)id;
+        ((unsigned long *)ref)[1] = (unsigned long)thread;
+        ((unsigned long *)ref)[0] = (unsigned long)id;
 #endif
-    
+    }
 }
 
 static Cyg_Thread *dbg_get_thread( threadref *ref)