|
|
|
@ -276,41 +276,41 @@ nindy_load( filename, from_tty ) |
|
|
|
char *filename; |
|
|
|
int from_tty; |
|
|
|
{ |
|
|
|
char *tmpfile; |
|
|
|
struct cleanup *old_chain; |
|
|
|
char *scratch_pathname; |
|
|
|
int scratch_chan; |
|
|
|
|
|
|
|
if (!filename) |
|
|
|
filename = get_exec_file (1); |
|
|
|
|
|
|
|
filename = tilde_expand (filename); |
|
|
|
make_cleanup (free, filename); |
|
|
|
|
|
|
|
scratch_chan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0, |
|
|
|
&scratch_pathname); |
|
|
|
if (scratch_chan < 0) |
|
|
|
perror_with_name (filename); |
|
|
|
close (scratch_chan); /* Slightly wasteful FIXME */ |
|
|
|
|
|
|
|
have_regs = regs_changed = 0; |
|
|
|
mark_breakpoints_out(); |
|
|
|
inferior_pid = 0; |
|
|
|
dcache_flush(); |
|
|
|
|
|
|
|
tmpfile = coffstrip(scratch_pathname); |
|
|
|
if ( tmpfile ){ |
|
|
|
old_chain = make_cleanup (unlink,tmpfile); |
|
|
|
immediate_quit++; |
|
|
|
ninDownload( tmpfile, !from_tty ); |
|
|
|
/* FIXME, don't we want this merged in here? */ |
|
|
|
immediate_quit--; |
|
|
|
do_cleanups (old_chain); |
|
|
|
asection *s; |
|
|
|
/* Can't do unix style forking on a VMS system, so we'll use bfd to do
|
|
|
|
all the work for us |
|
|
|
*/ |
|
|
|
|
|
|
|
bfd *file = bfd_openr(filename,0); |
|
|
|
if (!file) |
|
|
|
{ |
|
|
|
perror_with_name(filename); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!bfd_check_format(file, bfd_object)) |
|
|
|
{ |
|
|
|
error("can't prove it's an object file\n"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for ( s = file->sections; s; s=s->next) |
|
|
|
{ |
|
|
|
if (s->flags & SEC_LOAD) |
|
|
|
{ |
|
|
|
char *buffer = xmalloc(s->_raw_size); |
|
|
|
bfd_get_section_contents(file, s, buffer, 0, s->_raw_size); |
|
|
|
printf("Loading section %s, size %x vma %x\n", |
|
|
|
s->name, |
|
|
|
s->_raw_size, |
|
|
|
s->vma); |
|
|
|
ninMemPut(s->vma, buffer, s->_raw_size); |
|
|
|
free(buffer); |
|
|
|
} |
|
|
|
} |
|
|
|
bfd_close(file); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Return the number of characters in the buffer before the first DLE character.
|
|
|
|
*/ |
|
|
|
|
|
|
|
@ -941,8 +941,8 @@ specified when you started GDB.", |
|
|
|
0, /* lookup_symbol */ |
|
|
|
nindy_create_inferior, |
|
|
|
nindy_mourn_inferior, |
|
|
|
0, /* can_run */ |
|
|
|
0, /* notice_signals */ |
|
|
|
0, /* can_run */ |
|
|
|
0, /* notice_signals */ |
|
|
|
process_stratum, 0, /* next */ |
|
|
|
1, 1, 1, 1, 1, /* all mem, mem, stack, regs, exec */ |
|
|
|
0, 0, /* Section pointers */ |
|
|
|
|