This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, gdbsim] Avoid silly crash when no binary is loaded


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]