This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH, gdbsim] Avoid silly crash when no binary is loaded
- From: Pedro Alves <palves at redhat dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: gdb-patches at sourceware dot org, lgustavo at codesourcery dot com
- Date: Thu, 20 Jun 2013 19:05:41 +0100
- Subject: Re: [PATCH, gdbsim] Avoid silly crash when no binary is loaded
- References: <51C0C7E3 dot 1030603 at codesourcery dot com> <51C193AE dot 7010608 at redhat dot com> <51C19FF0 dot 8000005 at codesourcery dot com> <201306201350 dot 31839 dot vapier at gentoo dot org>
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