Re: [PATCH] Allow spaces in filenames to load command

Jim Blandy
2005-12-06T23:05:03Z

Okay, we have a bigger problem here than I'd thought.

generic_load is a generic implementation of the target to_load method,
for use by targets that just want to use target_write_memory_partial
to write the loadable sections of the exec file to the target's
memory. It's used by the GDB remote protocol and some of the other
remote targets. However:
- dve3900-rom.c, remote-m32r-sdi.c, remote-mips.c, and wince.c just
expect a filename.
- monitor.c uses sscanf ("%s 0x%lx") to parse its argument.
- remote-e7000.c parses -quiet and -nostart arguments, but no load offset.
- remote-sim.c passes it on to sim_load, which always seems to expect
a filename.

So testing for address equality is a way for generic_load to recognize
when it's being given a lone filename that shouldn't be broken up,
without changing load_command in a way that would break the seven
non-generic-load targets out there.

I feel morally compromised. :) Let me think about this a bit.