From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24794 invoked by alias); 28 Jun 2004 22:50:34 -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 24613 invoked from network); 28 Jun 2004 22:50:32 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 28 Jun 2004 22:50:32 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i5SMoWe1024826 for ; Mon, 28 Jun 2004 18:50:32 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i5SMoT031737; Mon, 28 Jun 2004 18:50:29 -0400 Received: from redhat.com (IDENT:MSMMq2+J2/hrueK6mL05ygYJNapIUULM@topaz.toronto.redhat.com [172.16.14.227]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id i5SMoOvU005394; Mon, 28 Jun 2004 18:50:24 -0400 Message-ID: <40E0A0B0.3020001@redhat.com> Date: Mon, 28 Jun 2004 22:50:00 -0000 From: Dave Brolley Organization: Red Hat Canada, Ltd User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040421 MIME-Version: 1.0 To: Dave Brolley CC: sid@sources.redhat.com Subject: Re: Misaligned read/write of memory by GDB References: <40E08B13.7000404@redhat.com> In-Reply-To: <40E08B13.7000404@redhat.com> Content-Type: multipart/mixed; boundary="------------010008030804040108070804" X-SW-Source: 2004-q2/txt/msg00052.txt.bz2 This is a multi-part message in MIME format. --------------010008030804040108070804 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 650 Ooops, sent the wrong patch...... Dave Brolley wrote: > Hi, > > Some sid components don't support misaligned reads/writes. The current > cache components are the example which caused my particular problem. > They punt on misaligned reads/writes, presumably so that they don't > have to worry about accesses which cross cache line boundaries. This > causes a problem when GDB attempts to read memory at unaligned addresses. > > This patch to gdb::process_get_mem and gdb::process_set_mem forces any > unaligned requests to use the existing byte-at-a-time method. > > I've committed this patch. Let me know if there are any problems. > > Dave > --------------010008030804040108070804 Content-Type: text/plain; name="sid-gdb-align.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sid-gdb-align.patch.txt" Content-length: 4924 Index: sid/component/gdb/gdb.cxx =================================================================== 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 28 Jun 2004 21:10:43 -0000 *************** gdb::process_get_mem (struct gdbserv_reg *** 620,642 **** } host_int_4 addr = addr8; // truncate ! if (len==1 && e==endian_big) ! read_bus_word (gdbserv, memory, addr, big_int_1()); ! else if (len==1 && e==endian_little) ! read_bus_word (gdbserv, memory, addr, little_int_1()); ! else if (len==2 && e==endian_big) ! read_bus_word (gdbserv, memory, addr, big_int_2()); ! else if (len==2 && e==endian_little) ! read_bus_word (gdbserv, memory, addr, little_int_2()); ! else if (len==4 && e==endian_big) ! read_bus_word (gdbserv, memory, addr, big_int_4()); ! else if (len==4 && e==endian_little) ! read_bus_word (gdbserv, memory, addr, little_int_4()); ! else if (len==8 && e==endian_big) ! read_bus_word (gdbserv, memory, addr, big_int_8()); ! else if (len==8 && e==endian_little) ! read_bus_word (gdbserv, memory, addr, little_int_8()); ! else if (e==endian_little) { for (unsigned long i=0; i