Unable to 'load' to extended-remote target

"Jon Beniston" <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
Hi,

I’m trying to connect to an extended remote target and download some code
before running it. E.g:

tar ext-remote:1025
load
run

However, if when connecting, the remote target indicates that the last
program has exited (via a Wxx packet), the ‘load’ will fail with the error
‘Load failed’.

This seems to be due to the following code in remote_xfer_partial() in
remote.c :

      /* If the remote target is connected but not running, we should
                pass this request down to a lower stratum (e.g. the
executable
                file).  */
      if (!target_has_execution)
                return TARGET_XFER_EOF;

It also seems the remote_verify_memory function checks target_has_execution,
so memory can’t be verified, before running.

I can see this makes some sense, in that GDB thinks there is no process on
the target to load to / verify, but equally, how else can new code be loaded
before running? Perhaps the remote target shouldn’t send the Wxx packet, but
that doesn’t seem right either.

Any thoughts as to how this should be made to work? 

Cheers,
Jon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.