Index: c/src/librdbg/ChangeLog
===================================================================
--- c/src/librdbg/ChangeLog	(revision 35290c995bbcff919e7516dd0850e3ffbc720782)
+++ c/src/librdbg/ChangeLog	(revision ce8e6a8bb7b9149c6c86150a48ee51e488a7490a)
@@ -1,2 +1,8 @@
+2002-07-01	Joel Sherrill <joel@OARcorp.com>
+
+	* src/_servtgt.c, src/ptrace.c: Corrected use of
+	_Objects_Information_table now that it is a two dimensional
+	array based upon API and class.
+
 2001-05-15	Joel Sherrill <joel@OARcorp.com>
 
Index: c/src/librdbg/src/_servtgt.c
===================================================================
--- c/src/librdbg/src/_servtgt.c	(revision 35290c995bbcff919e7516dd0850e3ffbc720782)
+++ c/src/librdbg/src/_servtgt.c	(revision ce8e6a8bb7b9149c6c86150a48ee51e488a7490a)
@@ -242,10 +242,10 @@
   unsigned name;
 
-  if (Id < _Objects_Information_table[OBJECTS_RTEMS_TASKS]->maximum_id &&
-      Id > _Objects_Information_table[OBJECTS_RTEMS_TASKS]->minimum_id) {
-
-    index = Id - _Objects_Information_table[OBJECTS_RTEMS_TASKS]->minimum_id;
+  if (Id < _Objects_Information_table[OBJECTS_CLASSIC_API][1]->maximum_id &&
+      Id > _Objects_Information_table[OBJECTS_CLASSIC_API][1]->minimum_id) {
+
+    index = Id - _Objects_Information_table[OBJECTS_CLASSIC_API][1]->minimum_id;
     name =
-      *(unsigned *) (_Objects_Information_table[OBJECTS_RTEMS_TASKS]->
+      *(unsigned *) (_Objects_Information_table[OBJECTS_CLASSIC_API][1]->
                      local_table[1 + index]->name);
     ThrName[0] = (char) ((name >> 24) & 0xFF);
@@ -257,11 +257,11 @@
   }
 
-  if (Id < _Objects_Information_table[OBJECTS_POSIX_THREADS]->maximum_id &&
-      Id > _Objects_Information_table[OBJECTS_POSIX_THREADS]->minimum_id) {
+  if (Id < _Objects_Information_table[OBJECTS_POSIX_API][1]->maximum_id &&
+      Id > _Objects_Information_table[OBJECTS_POSIX_API][1]->minimum_id) {
 
     index =
-      Id - _Objects_Information_table[OBJECTS_POSIX_THREADS]->minimum_id;
+      Id - _Objects_Information_table[OBJECTS_POSIX_API][1]->minimum_id;
     name =
-      *(unsigned *) (_Objects_Information_table[OBJECTS_POSIX_THREADS]->
+      *(unsigned *) (_Objects_Information_table[OBJECTS_POSIX_API][1]->
                      local_table[1 + index]->name);
     ThrName[0] = (char) ((name >> 24) & 0xFF);
@@ -289,9 +289,9 @@
   unsigned index;
 
-  id = _Objects_Information_table[OBJECTS_RTEMS_TASKS]->minimum_id;
-
-  while (id < _Objects_Information_table[OBJECTS_RTEMS_TASKS]->maximum_id) {
-    index = id - _Objects_Information_table[OBJECTS_RTEMS_TASKS]->minimum_id;
-    if (_Objects_Information_table[OBJECTS_RTEMS_TASKS]->
+  id = _Objects_Information_table[OBJECTS_CLASSIC_API][1]->minimum_id;
+
+  while (id < _Objects_Information_table[OBJECTS_CLASSIC_API][1]->maximum_id) {
+    index = id - _Objects_Information_table[OBJECTS_CLASSIC_API][1]->minimum_id;
+    if (_Objects_Information_table[OBJECTS_CLASSIC_API][1]->
         local_table[1 + index] != NULL) {
       threads[curr] = (unsigned) id;
@@ -301,10 +301,10 @@
   }
 
-  id = _Objects_Information_table[OBJECTS_POSIX_THREADS]->minimum_id;
-
-  while (id < _Objects_Information_table[OBJECTS_POSIX_THREADS]->maximum_id) {
+  id = _Objects_Information_table[OBJECTS_POSIX_API][1]->minimum_id;
+
+  while (id < _Objects_Information_table[OBJECTS_POSIX_API][1]->maximum_id) {
     index =
-      id - _Objects_Information_table[OBJECTS_POSIX_THREADS]->minimum_id;
-    if (_Objects_Information_table[OBJECTS_POSIX_THREADS]->
+      id - _Objects_Information_table[OBJECTS_POSIX_API][1]->minimum_id;
+    if (_Objects_Information_table[OBJECTS_POSIX_API][1]->
         local_table[1 + index] != NULL) {
       threads[curr] = (unsigned) id;
@@ -314,4 +314,6 @@
   }
 
+#warning "ignores ITRON tasks and could be a single loop"
+
   return curr;
 }
Index: c/src/librdbg/src/ptrace.c
===================================================================
--- c/src/librdbg/src/ptrace.c	(revision 35290c995bbcff919e7516dd0850e3ffbc720782)
+++ c/src/librdbg/src/ptrace.c	(revision ce8e6a8bb7b9149c6c86150a48ee51e488a7490a)
@@ -36,20 +36,20 @@
   unsigned index;
 
-  if (Id < _Objects_Information_table[OBJECTS_RTEMS_TASKS]->maximum_id &&
-      Id > _Objects_Information_table[OBJECTS_RTEMS_TASKS]->minimum_id) {
-
-    index = Id - _Objects_Information_table[OBJECTS_RTEMS_TASKS]->minimum_id;
-    if (_Objects_Information_table[OBJECTS_RTEMS_TASKS]->local_table[1 + index] != NULL) {
-      return (Thread_Control*) (_Objects_Information_table[OBJECTS_RTEMS_TASKS]->local_table[1 + index]);
+  if (Id < _Objects_Information_table[OBJECTS_CLASSIC_API][1]->maximum_id &&
+      Id > _Objects_Information_table[OBJECTS_CLASSIC_API][1]->minimum_id) {
+
+    index = Id - _Objects_Information_table[OBJECTS_CLASSIC_API][1]->minimum_id;
+    if (_Objects_Information_table[OBJECTS_CLASSIC_API][1]->local_table[1 + index] != NULL) {
+      return (Thread_Control*) (_Objects_Information_table[OBJECTS_CLASSIC_API][1]->local_table[1 + index]);
     }
   }
 
-  if (Id < _Objects_Information_table[OBJECTS_POSIX_THREADS]->maximum_id &&
-      Id > _Objects_Information_table[OBJECTS_POSIX_THREADS]->minimum_id) {
-
-    index = Id - _Objects_Information_table[OBJECTS_POSIX_THREADS]->minimum_id;
-    if (_Objects_Information_table[OBJECTS_POSIX_THREADS]->
+  if (Id < _Objects_Information_table[OBJECTS_POSIX_API][1]->maximum_id &&
+      Id > _Objects_Information_table[OBJECTS_POSIX_API][1]->minimum_id) {
+
+    index = Id - _Objects_Information_table[OBJECTS_POSIX_API][1]->minimum_id;
+    if (_Objects_Information_table[OBJECTS_POSIX_API][1]->
         local_table[1 + index] != NULL)
-      return (Thread_Control*) (_Objects_Information_table[OBJECTS_POSIX_THREADS]->local_table[1 + index]);
+      return (Thread_Control*) (_Objects_Information_table[OBJECTS_POSIX_API][1]->local_table[1 + index]);
   }
 
