From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6700 invoked by alias); 13 Oct 2015 17:14:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 6688 invoked by uid 89); 13 Oct 2015 17:14:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg20.ericsson.net Received: from usevmg20.ericsson.net (HELO usevmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 13 Oct 2015 17:14:22 +0000 Received: from EUSAAHC007.ericsson.se (Unknown_Domain [147.117.188.93]) by usevmg20.ericsson.net (Symantec Mail Security) with SMTP id 51.19.32596.ABBDC165; Tue, 13 Oct 2015 12:23:55 +0200 (CEST) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.95) with Microsoft SMTP Server id 14.3.248.2; Tue, 13 Oct 2015 13:14:19 -0400 Subject: Re: [PATCH c++ 1/5] lm32: Add (const gdb_byte *) cast To: References: <1444538238-7468-1-git-send-email-simon.marchi@polymtl.ca> <561B952D.8060909@redhat.com> From: Simon Marchi Message-ID: <561D3BEB.9090409@ericsson.com> Date: Tue, 13 Oct 2015 17:14:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <561B952D.8060909@redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00185.txt.bz2 On 15-10-12 07:10 AM, Pedro Alves wrote: > This reveals that the code has a host-dependency. It is assuming the > byte order of the target is the same as host's. >=20 > Please replace this with a call to write_memory_unsigned_integer. >=20 > Looks like this port hasn't been touched ever since it was > originally contributed. Jon, is there still interest in this port? >=20 > Thanks, > Pedro Alves Ah, thanks for the tip. It would look like this then: =46rom 5543b8ee060c5d0d171f5a8220a927c35bd3e5d5 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sun, 11 Oct 2015 00:37:14 -0400 Subject: [PATCH] lm32: Replace call to write_memory with write_memory_unsig= ned_integer MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Fixes this error: /home/emaisin/src/binutils-gdb/gdb/lm32-tdep.c: In function =91CORE_ADDR lm= 32_push_dummy_call(gdbarch*, value*, regcache*, CORE_ADDR, int, value**, CO= RE_ADDR, int, CORE_ADDR)=92: /home/emaisin/src/binutils-gdb/gdb/lm32-tdep.c:292:59: error: invalid conve= rsion from =91void*=92 to =91const gdb_byte* {aka const unsigned char*}=92 = [-fpermissive] write_memory (sp, (void *) &val, TYPE_LENGTH (arg_type)); ^ In file included from /home/emaisin/src/binutils-gdb/gdb/lm32-tdep.c:29:0: /home/emaisin/src/binutils-gdb/gdb/gdbcore.h:107:13: error: initializing = argument 2 of =91void write_memory(CORE_ADDR, const gdb_byte*, ssize_t)=92 = [-fpermissive] extern void write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, ^ gdb/ChangeLog: * lm32-tdep.c (lm32_push_dummy_call): Replace call to write_memory with write_memory_unsigned_integer. --- gdb/lm32-tdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index 25a7e1e..2dcc9a3 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -289,7 +289,8 @@ lm32_push_dummy_call (struct gdbarch *gdbarch, struct v= alue *function, regcache_cooked_write_unsigned (regcache, first_arg_reg + i, val); else { - write_memory (sp, (void *) &val, TYPE_LENGTH (arg_type)); + write_memory_unsigned_integer (sp, TYPE_LENGTH (arg_type), byte_order, + val); sp -=3D 4; } } --=20 2.5.1