From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29992 invoked by alias); 20 Jun 2013 18:05:47 -0000 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 Received: (qmail 29980 invoked by uid 89); 20 Jun 2013 18:05:47 -0000 X-Spam-SWARE-Status: No, score=-8.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 20 Jun 2013 18:05:47 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5KI5i0x003848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 20 Jun 2013 14:05:44 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5KI5g15001595; Thu, 20 Jun 2013 14:05:42 -0400 Message-ID: <51C34475.4090301@redhat.com> Date: Thu, 20 Jun 2013 18:34:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: Mike Frysinger CC: gdb-patches@sourceware.org, lgustavo@codesourcery.com Subject: Re: [PATCH, gdbsim] Avoid silly crash when no binary is loaded References: <51C0C7E3.1030603@codesourcery.com> <51C193AE.7010608@redhat.com> <51C19FF0.8000005@codesourcery.com> <201306201350.31839.vapier@gentoo.org> In-Reply-To: <201306201350.31839.vapier@gentoo.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00556.txt.bz2 On 06/20/2013 06:50 PM, Mike Frysinger wrote: > well, there's a bit more nuance than that. consider the operating environment > (literally, --environment operating). when you connect to that, it's like you > took jtag and connected it to a cpu fresh out of reset. sure, there's no > "program" loaded in its memory, but there's still plenty you can do to the > device like poke memory and see how it reacts -- whether it be external SDRAM, > or a parallel flash, or on-chip L1/L2, or memory mapped registers for the > peripherals, or an async memory bus, or an on-chip boot/ROM (which has both > code & data). maybe i'm an odd ball, but i find this scenario great for both > testing, development (like writing new sim device models), and one-off checks. > the fact that i need to compile & link a dummy program just to load it into > the sim so i can start poking around is obnoxious. similarly, when i have > just a .bin of raw code/data (e.g. `objcopy -O binary foo.elf foo.bin` which > is common in the embedded world), how am i going to get that into the > simulator ? when i'm connected to jtag, i could use "load" & friends to copy > it to memory, set the pc, and let it run. with the sim, i need to create a > dummy .s that does .incbin "foo.bin" and compile+link that. This makes a lot of sense to me. I fully agree. Thanks, -- Pedro Alves