From bc84451b7af508ddd154a8793eaf0de68b7ca80a Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sat, 26 Sep 2015 17:15:05 -0400 Subject: [PATCH] Fix cast of xml_find_attribute's return value The cast auto-insert script inserted long unsigned int, but we should use the typedef ULONGEST. Fixes build failures on i386. gdb/ChangeLog: * btrace.c (parse_xml_btrace_block): Fix cast of xml_find_attribute's return value. * memory-map.c (memory_map_start_memory): Likewise. * solib-svr4.c (library_list_start_library): Likewise. * solib-target.c (library_list_start_segment): Likewise. (library_list_start_section): Likewise. * tracepoint.c (traceframe_info_start_memory): Likewise. --- gdb/ChangeLog | 10 ++++++++++ gdb/btrace.c | 4 ++-- gdb/memory-map.c | 6 +++--- gdb/solib-svr4.c | 6 +++--- gdb/solib-target.c | 4 ++-- gdb/tracepoint.c | 4 ++-- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ec7d672835b..246b1cd223b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2015-09-26 Simon Marchi + + * btrace.c (parse_xml_btrace_block): Fix cast of + xml_find_attribute's return value. + * memory-map.c (memory_map_start_memory): Likewise. + * solib-svr4.c (library_list_start_library): Likewise. + * solib-target.c (library_list_start_segment): Likewise. + (library_list_start_section): Likewise. + * tracepoint.c (traceframe_info_start_memory): Likewise. + 2015-09-26 Iain Buclaw * d-namespace.c (d_lookup_symbol): New arg langdef. diff --git a/gdb/btrace.c b/gdb/btrace.c index da0b517ec11..2bf71771bb5 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -1418,8 +1418,8 @@ parse_xml_btrace_block (struct gdb_xml_parser *parser, gdb_xml_error (parser, _("Btrace format error.")); } - begin = (long unsigned int *) xml_find_attribute (attributes, "begin")->value; - end = (long unsigned int *) xml_find_attribute (attributes, "end")->value; + begin = (ULONGEST *) xml_find_attribute (attributes, "begin")->value; + end = (ULONGEST *) xml_find_attribute (attributes, "end")->value; block = VEC_safe_push (btrace_block_s, btrace->variant.bts.blocks, NULL); block->begin = *begin; diff --git a/gdb/memory-map.c b/gdb/memory-map.c index d56b14c861b..3de6e9dbe1e 100644 --- a/gdb/memory-map.c +++ b/gdb/memory-map.c @@ -61,11 +61,11 @@ memory_map_start_memory (struct gdb_xml_parser *parser, ULONGEST *start_p, *length_p, *type_p; start_p - = (long unsigned int *) xml_find_attribute (attributes, "start")->value; + = (ULONGEST *) xml_find_attribute (attributes, "start")->value; length_p - = (long unsigned int *) xml_find_attribute (attributes, "length")->value; + = (ULONGEST *) xml_find_attribute (attributes, "length")->value; type_p - = (long unsigned int *) xml_find_attribute (attributes, "type")->value; + = (ULONGEST *) xml_find_attribute (attributes, "type")->value; mem_region_init (r); r->lo = *start_p; diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 48dec25f476..55b8f556677 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1166,11 +1166,11 @@ library_list_start_library (struct gdb_xml_parser *parser, const char *name = (const char *) xml_find_attribute (attributes, "name")->value; ULONGEST *lmp - = (long unsigned int *) xml_find_attribute (attributes, "lm")->value; + = (ULONGEST *) xml_find_attribute (attributes, "lm")->value; ULONGEST *l_addrp - = (long unsigned int *) xml_find_attribute (attributes, "l_addr")->value; + = (ULONGEST *) xml_find_attribute (attributes, "l_addr")->value; ULONGEST *l_ldp - = (long unsigned int *) xml_find_attribute (attributes, "l_ld")->value; + = (ULONGEST *) xml_find_attribute (attributes, "l_ld")->value; struct so_list *new_elem; new_elem = XCNEW (struct so_list); diff --git a/gdb/solib-target.c b/gdb/solib-target.c index ef9599c992b..7745a4a08cd 100644 --- a/gdb/solib-target.c +++ b/gdb/solib-target.c @@ -83,7 +83,7 @@ library_list_start_segment (struct gdb_xml_parser *parser, VEC(lm_info_p) **list = (VEC(lm_info_p) **) user_data; struct lm_info *last = VEC_last (lm_info_p, *list); ULONGEST *address_p - = (long unsigned int *) xml_find_attribute (attributes, "address")->value; + = (ULONGEST *) xml_find_attribute (attributes, "address")->value; CORE_ADDR address = (CORE_ADDR) *address_p; if (last->section_bases != NULL) @@ -101,7 +101,7 @@ library_list_start_section (struct gdb_xml_parser *parser, VEC(lm_info_p) **list = (VEC(lm_info_p) **) user_data; struct lm_info *last = VEC_last (lm_info_p, *list); ULONGEST *address_p - = (long unsigned int *) xml_find_attribute (attributes, "address")->value; + = (ULONGEST *) xml_find_attribute (attributes, "address")->value; CORE_ADDR address = (CORE_ADDR) *address_p; if (last->segment_bases != NULL) diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 415fa6d0fe6..6ca66e7c8d1 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -4194,9 +4194,9 @@ traceframe_info_start_memory (struct gdb_xml_parser *parser, ULONGEST *start_p, *length_p; start_p - = (long unsigned int *) xml_find_attribute (attributes, "start")->value; + = (ULONGEST *) xml_find_attribute (attributes, "start")->value; length_p - = (long unsigned int *) xml_find_attribute (attributes, "length")->value; + = (ULONGEST *) xml_find_attribute (attributes, "length")->value; r->start = *start_p; r->length = *length_p; -- 2.30.2