* xml-support.c (xml_find_attribute): New.
[deliverable/binutils-gdb.git] / gdb / remote.c
index b440e9e9ab5b14c95b593feb6cec87fa3d33e58d..c79f6e2eef420afa16280044284755f1288fe694 100644 (file)
@@ -2505,13 +2505,14 @@ start_thread (struct gdb_xml_parser *parser,
 
   struct thread_item item;
   char *id;
+  struct gdb_xml_value *attr;
 
-  id = VEC_index (gdb_xml_value_s, attributes, 0)->value;
+  id = xml_find_attribute (attributes, "id")->value;
   item.ptid = read_ptid (id, NULL);
 
-  if (VEC_length (gdb_xml_value_s, attributes) > 1)
-    item.core = *(ULONGEST *) VEC_index (gdb_xml_value_s,
-                                        attributes, 1)->value;
+  attr = xml_find_attribute (attributes, "core");
+  if (attr != NULL)
+    item.core = *(ULONGEST *) attr->value;
   else
     item.core = -1;
 
This page took 0.023553 seconds and 4 git commands to generate.