This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Unable to 'load' to extended-remote target
- From: "Jon Beniston" <jon at beniston dot com>
- To: <gdb at sourceware dot org>
- Cc: <jon at beniston dot com>
- Date: Fri, 30 Sep 2016 10:15:56 +0100
- Subject: Unable to 'load' to extended-remote target
- Authentication-results: sourceware.org; auth=none
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