From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23543 invoked by alias); 4 Jan 2002 20:03:28 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 23278 invoked from network); 4 Jan 2002 20:03:22 -0000 Received: from unknown (HELO motgate3.mot.com) (144.189.100.103) by sources.redhat.com with SMTP; 4 Jan 2002 20:03:22 -0000 Received: [from mothost.mot.com (mothost.mot.com [129.188.137.101]) by motgate3.mot.com (motgate3 2.1) with ESMTP id MAA09065 for ; Fri, 4 Jan 2002 12:53:17 -0700 (MST)] Received: [from postal.somerset.sps.mot.com (postal.somerset.sps.mot.com [163.12.132.5]) by mothost.mot.com (MOT-mothost 2.0) with ESMTP id NAA24636 for ; Fri, 4 Jan 2002 13:03:16 -0700 (MST)] Received: from pacific.somerset.sps.mot.com (pacific.somerset.sps.mot.com [163.12.101.73]) by postal.somerset.sps.mot.com (8.11.0/8.11.0) with ESMTP id g04K3F316801 for ; Fri, 4 Jan 2002 14:03:15 -0600 (CST) Received: (from swarthou@localhost) by pacific.somerset.sps.mot.com (8.11.0/8.11.0) id g04K3F219582; Fri, 4 Jan 2002 14:03:15 -0600 (CST) Date: Fri, 04 Jan 2002 12:03:00 -0000 Message-Id: <200201042003.g04K3F219582@pacific.somerset.sps.mot.com> From: Edward Swarthout To: gdb@sources.redhat.com In-reply-to: <1010165997.16220.ezmlm@sources.redhat.com> (gdb-digest-help@sources.redhat.com) References: <1010165997.16220.ezmlm@sources.redhat.com> Subject: Re: A copy/save command ... X-SW-Source: 2002-01/txt/msg00013.txt.bz2 >From Daniel: > Perhaps read/write? But that's still not clear which way is which. > load/store would be perfect but load is already used. >From FChE: > and FORMAT could be some bfd-supported forms like "srec" or "binary". Couldn't adding binary support to load be considered the same as thing as "read"? Then the opposite of load, is dump. load/dump FILE SECTIONS(S) The trick is to create a way to specify the layout and format of the desired sections. Some sort of a reverse "info maint sections". gdb> info maint sections Exec file: `/h1/swarthou/prg/empty/empty1', file type elf32-powerpc. 0x10000074->0x10000098 at 0x00000074: .text ALLOC LOAD READONLY CO 0x10000098->0x10000098 at 0x00000098: .sdata2 ALLOC LOAD READONLY 0x100100a0->0x100100b0 at 0x000000a0: .data ALLOC LOAD DATA HAS_CO 0x100100b0->0x100100b0 at 0x000000b0: .sdata ALLOC LOAD DATA HAS_C 0x100100b0->0x100100b0 at 0x000000b0: .sbss HAS_CONTENTS 0x100100b0->0x100100c0 at 0x000000b0: .bss ALLOC Core file: `/h1/swarthou/prg/empty/core', file type elf32-powerpc. 0x00000000->0x00000654 at 0x000000b4: note0 READONLY HAS_CONTENTS 0x00000000->0x000000c0 at 0x0000010c: .reg/14104 HAS_CONTENTS 0x00000000->0x000000c0 at 0x0000010c: .reg HAS_CONTENTS 0x00000000->0x00000108 at 0x00000600: .reg2/14104 HAS_CONTENTS 0x00000000->0x00000108 at 0x00000600: .reg2 HAS_CONTENTS 0x10000000->0x10000000 at 0x00001000: load1 ALLOC LOAD READONLY CO 0x10010000->0x10011000 at 0x00001000: load2 ALLOC LOAD HAS_CONTENT 0x7ffff000->0x80000000 at 0x00002000: load3 ALLOC LOAD CODE HAS_CO Then gdb> load BINFILE1 .bss or gdb> dump BINFILE2 load1 would do the desired thing. It would be natural to add core file support to load/dump too. There is still the issue of how to specify the format (binary, elf-core, elf-object, srec, or other bfd type). Maybe some borrow the syntax from objcopy or the loader. - Ed Ed.Swarthout@motorola.com Somerset Design Center