From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Subject: Re: [PATCH c++ 1/5] lm32: Add (const gdb_byte *) cast
Date: Tue, 13 Oct 2015 17:14:00 -0000 [thread overview]
Message-ID: <561D3BEB.9090409@ericsson.com> (raw)
In-Reply-To: <561B952D.8060909@redhat.com>
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.
>
> Please replace this with a call to write_memory_unsigned_integer.
>
> Looks like this port hasn't been touched ever since it was
> originally contributed. Jon, is there still interest in this port?
>
> Thanks,
> Pedro Alves
Ah, thanks for the tip. It would look like this then:
From 5543b8ee060c5d0d171f5a8220a927c35bd3e5d5 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@polymtl.ca>
Date: Sun, 11 Oct 2015 00:37:14 -0400
Subject: [PATCH] lm32: Replace call to write_memory with write_memory_unsigned_integer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes this error:
/home/emaisin/src/binutils-gdb/gdb/lm32-tdep.c: In function ‘CORE_ADDR lm32_push_dummy_call(gdbarch*, value*, regcache*, CORE_ADDR, int, value**, CORE_ADDR, int, CORE_ADDR)’:
/home/emaisin/src/binutils-gdb/gdb/lm32-tdep.c:292:59: error: invalid conversion from ‘void*’ to ‘const gdb_byte* {aka const unsigned char*}’ [-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 ‘void write_memory(CORE_ADDR, const gdb_byte*, ssize_t)’ [-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 value *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 -= 4;
}
}
--
2.5.1
next prev parent reply other threads:[~2015-10-13 17:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-11 4:37 Simon Marchi
2015-10-11 4:37 ` [PATCH c++ 4/5] mips: fix void*/gdb_byte* compilation errors Simon Marchi
2015-10-22 13:13 ` Pedro Alves
2015-10-11 4:37 ` [PATCH c++ 2/5] m32c: Split m32c_move_reg_t in read/write variants Simon Marchi
2015-10-12 10:47 ` Yao Qi
2015-10-12 16:42 ` Simon Marchi
2015-10-11 4:37 ` [PATCH c++ 3/5] mep: Add cast for int to enum conversion Simon Marchi
2015-10-12 10:35 ` Yao Qi
2015-10-12 16:43 ` Simon Marchi
2015-10-11 4:44 ` [PATCH c++ 5/5] mips: " Simon Marchi
2015-10-12 10:54 ` Pedro Alves
2015-10-12 16:28 ` Simon Marchi
2015-10-12 10:52 ` [PATCH c++ 1/5] lm32: Add (const gdb_byte *) cast Yao Qi
2015-10-12 11:10 ` Pedro Alves
2015-10-12 12:18 ` Jon Beniston
2015-10-13 17:14 ` Simon Marchi [this message]
2015-10-13 17:32 ` Pedro Alves
2015-10-13 17:37 ` Simon Marchi
2015-10-22 9:59 ` Simon Marchi
2015-10-22 13:34 ` Pedro Alves
2015-10-22 13:39 ` Simon Marchi
2015-10-22 15:21 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=561D3BEB.9090409@ericsson.com \
--to=simon.marchi@ericsson.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox