section's address.
* gdb/objfiles.c (objfile_relocate): Also relocate the
target sections table.
* gdb/Makefile.in (objfiles.o): Update.
* gdb/remote.c (remote_xfer_partial): Fail if the target is not
running.
+2006-06-01 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gdb/exec.c (exec_set_section_address): Always update the
+ section's address.
+ * gdb/objfiles.c (objfile_relocate): Also relocate the
+ target sections table.
+ * gdb/Makefile.in (objfiles.o): Update.
+
+ * gdb/remote.c (remote_xfer_partial): Fail if the target is not
+ running.
+
2006-06-01 Daniel Jacobowitz <dan@codesourcery.com>
* gdb/remote.c (remote_download_command): Use FILEIO_O_TRUNC.
$(objfiles_h) $(gdb_string_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) \
$(frame_h) $(gdb_regex_h) $(regcache_h) $(block_h) $(infcall_h) \
$(valprint_h) $(gdb_assert_h)
-objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \
+objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) $(exec_h) \
$(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(mdebugread_h) \
$(gdb_assert_h) $(gdb_stat_h) $(gdb_obstack_h) $(gdb_string_h) \
$(hashtab_h) $(breakpoint_h) $(block_h) $(dictionary_h)
for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++)
{
+ /* FIXME drow/2006-06-01: This used to say "&& p->addr == 0".
+ But that messes up multiple qOffsets responses relocating an
+ executable; the previous relocated value doesn't matter.
+ Removing it makes qOffsets attempt to override "set section".
+ There should be a user-specified flag - or else we should
+ just use the objfile's sections, or something like that.
+
+ This deserves more thought before a merge to mainline. */
if (strcmp (filename, p->bfd->filename) == 0
- && index == p->the_bfd_section->index
- && p->addr == 0)
+ && index == p->the_bfd_section->index)
{
+ p->endaddr += address - p->addr;
p->addr = address;
- p->endaddr += address;
}
}
}
#include "defs.h"
#include "bfd.h" /* Binary File Description */
+#include "exec.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
s->addr += ANOFFSET (delta, idx);
s->endaddr += ANOFFSET (delta, idx);
+
+ /* FIXME: The exec file uses a completely different table from
+ any objfile, unfortunately. A nice improvement would
+ be to unify those. */
+ exec_set_section_address (bfd_get_filename (abfd), idx, s->addr);
}
}
int xfered;
errno = 0;
+ /* 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 0;
+
if (writebuf != NULL)
{
void *buffer = xmalloc (len);