public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH RL78]:Fix offset for mem_get_si in sim
@ 2015-02-19 10:52 Amrita Honap
  2015-02-19 16:01 ` Mike Frysinger
  2015-02-19 16:10 ` DJ Delorie
  0 siblings, 2 replies; 3+ messages in thread
From: Amrita Honap @ 2015-02-19 10:52 UTC (permalink / raw)
  To: gdb-patches

Hi, 
The following patch fixes the handling of the offset that is generated 
for the mem_get_si.
The mem_get_si reads the 0th,1st and 2nd byte correctly and fails on the 3rd byte,
where it is again reading the 2nd byte.
This patch should fix this problem.

Regards,
Amrita Honap


=======================Start of Patch================================

Changelog
2015-02-19  Amrita Honap <Amrita.Honap@kpit.com>
	* rl78/mem.c (mem_get_si) : Fix offset for mem_get_si

diff -rNup src/gdb-7.8.2/sim/rl78/mem.c.orig src/gdb-7.8.2/sim/rl78/mem.c

--- src/gdb-7.8.2/sim/rl78/mem.c.orig   2015-02-19 16:01:39.199243028 +0530
+++ src/gdb-7.8.2/sim/rl78/mem.c        2015-02-19 15:56:14.891262201 +0530
@@ -435,7 +435,7 @@ mem_get_si (int address)
   v = mem_get_byte (address)
     | mem_get_byte (address + 1) * 256
     | mem_get_byte (address + 2) * 65536
-    | mem_get_byte (address + 2) * 16777216;
+    | mem_get_byte (address + 3) * 16777216;
   CHECK_ALIGNMENT (address, v, 3);
   tprintf ("(\033[35m[%05X]->%04X)\033[0m", address, v);
   return v;

 
=========================End Of Patch================================

Apologies for any company disclaimer that may get added to this e-mail.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RL78]:Fix offset for mem_get_si in sim
  2015-02-19 10:52 [PATCH RL78]:Fix offset for mem_get_si in sim Amrita Honap
@ 2015-02-19 16:01 ` Mike Frysinger
  2015-02-19 16:10 ` DJ Delorie
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2015-02-19 16:01 UTC (permalink / raw)
  To: Amrita Honap; +Cc: gdb-patches, dj

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]

On 19 Feb 2015 10:52, Amrita Honap wrote:
> The following patch fixes the handling of the offset that is generated 
> for the mem_get_si.
> The mem_get_si reads the 0th,1st and 2nd byte correctly and fails on the 3rd byte,
> where it is again reading the 2nd byte.

seems logical to me, but probably want DJ to approve it
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RL78]:Fix offset for mem_get_si in sim
  2015-02-19 10:52 [PATCH RL78]:Fix offset for mem_get_si in sim Amrita Honap
  2015-02-19 16:01 ` Mike Frysinger
@ 2015-02-19 16:10 ` DJ Delorie
  1 sibling, 0 replies; 3+ messages in thread
From: DJ Delorie @ 2015-02-19 16:10 UTC (permalink / raw)
  To: Amrita Honap; +Cc: gdb-patches


> -    | mem_get_byte (address + 2) * 16777216;
> +    | mem_get_byte (address + 3) * 16777216;

This is OK, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-19 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-19 10:52 [PATCH RL78]:Fix offset for mem_get_si in sim Amrita Honap
2015-02-19 16:01 ` Mike Frysinger
2015-02-19 16:10 ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).