From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23671 invoked by alias); 4 Aug 2009 20:01:27 -0000 Received: (qmail 23560 invoked by uid 22791); 4 Aug 2009 20:01:26 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Aug 2009 20:01:20 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id C3D111347E; Tue, 4 Aug 2009 13:01:16 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost3.vmware.com (Postfix) with ESMTP id B7DA0CD903; Tue, 4 Aug 2009 13:01:16 -0700 (PDT) Message-ID: <4A78935B.5030508@vmware.com> Date: Tue, 04 Aug 2009 20:01:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Eli Zaretskii CC: Hui Zhu , "gdb-patches@sourceware.org" Subject: Re: [RFA/RFC] Add dump and load command to process record and replay References: <4A749572.7030005@vmware.com> <4A75054C.9030304@vmware.com> <83ws5koinl.fsf@gnu.org> <83my6fo2pa.fsf@gnu.org> In-Reply-To: <83my6fo2pa.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00062.txt.bz2 Eli Zaretskii wrote: >> From: Hui Zhu >> Date: Tue, 4 Aug 2009 10:07:11 +0800 >> Cc: msnyder@vmware.com, gdb-patches@sourceware.org >> >>> By the way, does it make sense to make the dump file portable, so that >>> another host that supports debugging the same target could then use >>> it? >>> >> Yes, the dump file is portable like core file. > > Well, maybe I'm missing something important, but isn't the dump file a > series of struct's defined as this: > > struct record_entry > { > struct record_entry *prev; > struct record_entry *next; > enum record_type type; > union > { > /* reg */ > struct record_reg_entry reg; > /* mem */ > struct record_mem_entry mem; > } u; > }; > > ? If so, then the dump file uses host's native pointers, so it is not > portable to a different host. Right? No. If you look at the code that dumps the file (and I had to add a bunch of printfs and stuff to figure it out), you'll see that the dump file looks like this: 4 byte magic number Series of the following: 1) 1 byte tag (record_end), or 2) 1 byte tag (record_rec) followed by 8 byte number (register id), followed by MAX_REGISTER_SIZE byte value (register value): or 3) 1 byte tag (record_mem) followed by 8 byte number (memory address) followed by 8 byte number (memory length) followed by N byte buffer (memory value). If you look for the #if (BYTE_ORDER == BIG_ENDIAN), this is where Teawater is making the byte orders host-independent. I was going to mention the ifdefs eventually. ;-)