From 3d2c1d41d4b6cdaa6052ddfd99b0745cc70c9cbb Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 2 Feb 2011 16:12:59 +0000 Subject: * xml-support.c (xml_find_attribute): New. (xinclude_start_include): Use it. * xml-support.h (xml_find_attribute): Declare. * memory-map.c (memory_map_start_memory) (memory_map_start_property): Use xml_find_attribute. * osdata.c (osdata_start_osdata, osdata_start_column): Use xml_find_attribute. * remote.c (start_thread): Use xml_find_attribute. * solib-target.c (library_list_start_segment) (library_list_start_section, library_list_start_library) (library_list_start_list): Use xml_find_attribute. * xml-tdesc.c (tdesc_start_target, tdesc_start_feature) (tdesc_start_union, tdesc_start_struct, tdesc_start_flags) (tdesc_start_field): Use xml_find_attribute. --- gdb/remote.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gdb/remote.c') diff --git a/gdb/remote.c b/gdb/remote.c index b440e9e..c79f6e2 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -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; -- cgit v1.1