From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12983 invoked by alias); 1 Jul 2004 17:02:29 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 12976 invoked from network); 1 Jul 2004 17:02:28 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 1 Jul 2004 17:02:28 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i61H2Re1015677 for ; Thu, 1 Jul 2004 13:02:27 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i61H2Qw30175 for ; Thu, 1 Jul 2004 13:02:27 -0400 Received: from MDG2004 (vpn50-65.rdu.redhat.com [172.16.50.65]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id i61H2NP28370; Thu, 1 Jul 2004 10:02:23 -0700 Message-Id: <200407011702.i61H2NP28370@potter.sfbay.redhat.com> From: "Dave Brolley" To: "'Dave Brolley'" , "'Frank Ch. Eigler'" Cc: Subject: RE: Misaligned read/write of memory by GDB Date: Thu, 01 Jul 2004 17:02:00 -0000 Organization: Red Hat Canada MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0000_01C45F6B.A78E0B60" In-Reply-To: <40E1D329.1060705@redhat.com> X-SW-Source: 2004-q3/txt/msg00000.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C45F6B.A78E0B60 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-length: 362 In response to Frank's comments, I have removed my previous patch and committed this one in its place. The cache component now handles misaligned accesses except those which cross a cache line boundary. For those it returns bus::misaligned The GDB component reverts to the byte-at-a-time method of access if bus::misaligned is returned from downstream. Dave ------=_NextPart_000_0000_01C45F6B.A78E0B60 Content-Type: application/octet-stream; name="sid-gdbalign.ChangeLog" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="sid-gdbalign.ChangeLog" Content-length: 716 2004-07-01 Dave Brolley =0A= =0A= * gdb.cxx (read_bus_word): Now returns bus::status. Return status=0A= from bus->read.=0A= (write_bus_word): Ditto for status from bus->write.=0A= (process_get_mem): Back out previous patch. Retry access=0A= one byte at a time if bus::misaligned is returned from downstream.=0A= (process_set_mem): Ditto.=0A= =0A= 2004-07-01 Dave Brolley =0A= =0A= * cache.cxx (write_any): Allow misaligned access. Return=0A= bus::misaligned for accesses which cross line boundary.=0A= (read_any): Ditto.=0A= =0A= 2004-07-01 Dave Brolley =0A= =0A= * sidcomp.cache/misaligned.exp: 16 bit access should now be a hit.=0A= =0A= ------=_NextPart_000_0000_01C45F6B.A78E0B60 Content-Type: text/plain; name="sid-gdbalign.patch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="sid-gdbalign.patch.txt" Content-length: 7222 Index: sid/component/gdb/gdb.cxx =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/sid/component/gdb/gdb.cxx,v retrieving revision 1.11 diff -c -p -r1.11 gdb.cxx *** sid/component/gdb/gdb.cxx 22 Mar 2004 21:27:23 -0000 1.11 --- sid/component/gdb/gdb.cxx 1 Jul 2004 16:46:54 -0000 *************** gdb::process_get_exp_regs () *** 532,538 **** // Helper functions =20=20 template ! void=20 read_bus_word(gdbserv* gdbserv,=20 sid::bus* bus, host_int_4 address, --- 532,538 ---- // Helper functions =20=20 template ! bus::status read_bus_word(gdbserv* gdbserv,=20 sid::bus* bus, host_int_4 address, *************** read_bus_word(gdbserv* gdbserv,=20 *** 545,557 **** for (unsigned i=3D0; i < sizeof(typename Type::value_type); i++) gdbserv_output_byte (gdbserv, value.read_byte(i)); } ! else gdbserv_output_string (gdbserv, "E05"); } =20=20 =20=20 template ! void=20 write_bus_word(gdbserv* gdbserv,=20 int binary, sid::bus* bus, --- 545,559 ---- for (unsigned i=3D0; i < sizeof(typename Type::value_type); i++) gdbserv_output_byte (gdbserv, value.read_byte(i)); } ! // misaligned will be handled by the caller ! else if (s !=3D bus::misaligned) gdbserv_output_string (gdbserv, "E05"); + return s; } =20=20 =20=20 template ! bus::status write_bus_word(gdbserv* gdbserv,=20 int binary, sid::bus* bus, *************** write_bus_word(gdbserv* gdbserv,=20 *** 572,581 **** } =20=20 bus::status s =3D bus->write (address, value); ! if (s =3D=3D bus::ok) ! ; // No response means "OK" else gdbserv_output_string (gdbserv, "E05"); } =20=20 =20=20 --- 574,584 ---- } =20=20 bus::status s =3D bus->write (address, value); ! if (s =3D=3D bus::ok || s =3D=3D bus::misaligned) ! ; // No response means "OK" -- misaligned will be handled by the call= er else gdbserv_output_string (gdbserv, "E05"); + return s; } =20=20 =20=20 *************** gdb::process_get_mem (struct gdbserv_reg *** 620,642 **** } host_int_4 addr =3D addr8; // truncate =20=20 if (len=3D=3D1 && e=3D=3Dendian_big)=20 ! read_bus_word (gdbserv, memory, addr, big_int_1()); else if (len=3D=3D1 && e=3D=3Dendian_little) ! read_bus_word (gdbserv, memory, addr, little_int_1()); else if (len=3D=3D2 && e=3D=3Dendian_big)=20 ! read_bus_word (gdbserv, memory, addr, big_int_2()); else if (len=3D=3D2 && e=3D=3Dendian_little) ! read_bus_word (gdbserv, memory, addr, little_int_2()); else if (len=3D=3D4 && e=3D=3Dendian_big)=20 ! read_bus_word (gdbserv, memory, addr, big_int_4()); else if (len=3D=3D4 && e=3D=3Dendian_little) ! read_bus_word (gdbserv, memory, addr, little_int_4()); else if (len=3D=3D8 && e=3D=3Dendian_big)=20 ! read_bus_word (gdbserv, memory, addr, big_int_8()); else if (len=3D=3D8 && e=3D=3Dendian_little) ! read_bus_word (gdbserv, memory, addr, little_int_8()); ! else if (e=3D=3Dendian_little) { for (unsigned long i=3D0; i