Ok, here goes...
* From a user's perspective GDB is magically prefixing *some*
executable and shared library filenames with "target:".
* From a developer's perspective this magic prefixing is implemented
by having the string "target:" as the default sysroot.
My proposal is to make the default sysroot be "" again, and add the
prefix in solib_find_1 if certain conditions are met, specifically:
* Executable filenames get prefixed with "target:" iff:
Automatic "target:" prefixing is enabled
AND gdb_sysroot is ""
AND the filesystem is nonlocal
* Shared library filenames get prefixed with "target:" iff:
Automatic "target:" prefixing is enabled
AND gdb_sysroot is ""
AND the filesystem is nonlocal
AND exec_filename starts with "target:"