From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12222 invoked by alias); 28 Jun 2004 23:58:27 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12214 invoked from network); 28 Jun 2004 23:58:25 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 28 Jun 2004 23:58:25 -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 i5SNwOe1007920 for ; Mon, 28 Jun 2004 19:58:24 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i5SNwM013200; Mon, 28 Jun 2004 19:58:23 -0400 To: gdb-patches@sources.redhat.com Subject: RFA: neaten up sim memory dumping From: Jim Blandy Date: Mon, 28 Jun 2004 23:58:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-06/txt/msg00656.txt.bz2 Of course, there's no end to the improvements one could make here. This, at least, improved things enough that I could be sure what was really going on. 2004-06-28 Jim Blandy * remote-sim.c (dump_mem): Include leading zeros in dumped values, so the user can tell whether we're dumping words or bytes. When we dump words, interpret them using the target byte order, not host byte order. Index: gdb/remote-sim.c =================================================================== RCS file: /cvs/src/src/gdb/remote-sim.c,v retrieving revision 1.39 diff -c -p -r1.39 remote-sim.c *** gdb/remote-sim.c 25 Jun 2004 19:46:08 -0000 1.39 --- gdb/remote-sim.c 28 Jun 2004 23:56:20 -0000 *************** dump_mem (char *buf, int len) *** 129,139 **** { if (len == 8 || len == 4) { ! long l[2]; ! memcpy (l, buf, len); ! printf_filtered ("\t0x%lx", l[0]); if (len == 8) ! printf_filtered (" 0x%lx", l[1]); printf_filtered ("\n"); } else --- 129,140 ---- { if (len == 8 || len == 4) { ! printf_filtered ("\t0x%08lx", ! (unsigned long) extract_unsigned_integer (buf, 4)); if (len == 8) ! printf_filtered (" 0x%08lx", ! ((unsigned long) ! extract_unsigned_integer (buf + 4, 4))); printf_filtered ("\n"); } else *************** dump_mem (char *buf, int len) *** 141,147 **** int i; printf_filtered ("\t"); for (i = 0; i < len; i++) ! printf_filtered ("0x%x ", buf[i]); printf_filtered ("\n"); } } --- 142,148 ---- int i; printf_filtered ("\t"); for (i = 0; i < len; i++) ! printf_filtered ("0x%02x ", buf[i]); printf_filtered ("\n"); } }