This is the mail archive of the gdb@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]

Unable to 'load' to extended-remote target


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



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