From patchwork Sat Sep 26 21:34:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 8862 Received: (qmail 13263 invoked by alias); 26 Sep 2015 21:34:28 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 13253 invoked by uid 89); 26 Sep 2015 21:34:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: nova.aep.polymtl.ca Received: from nova.polymtl.ca (HELO nova.aep.polymtl.ca) (132.207.4.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 26 Sep 2015 21:34:25 +0000 Received: from nova.aep.polymtl.ca (localhost [127.0.0.1]) by nova.aep.polymtl.ca (8.14.9/8.14.9/Debian-4) with ESMTP id t8QLYKGA008711 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 26 Sep 2015 17:34:21 -0400 Received: (from simark@localhost) by nova.aep.polymtl.ca (8.14.9/8.14.9/Submit) id t8QLYKhG008709; Sat, 26 Sep 2015 17:34:20 -0400 From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH obv] Fix cast of xml_find_attribute's return value Date: Sat, 26 Sep 2015 17:34:18 -0400 Message-Id: <1443303258-8631-1-git-send-email-simon.marchi@polymtl.ca> X-Spam-Report: * -0.1 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 AWL AWL: Adjusted score from AWL reputation of From: address ReportDone Nova! 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 ec7d672..246b1cd 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 da0b517..2bf7177 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 d56b14c..3de6e9d 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 48dec25..55b8f55 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 ef9599c..7745a4a 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 415fa6d..6ca66e7 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;