* rs6000-nat.c (vmap_ldinfo): Issue warning instead of error if
fstat on ldinfo_fd fails. Use objfile->obfd instead of vp->bfd to check for reference to the same file. * target.c (target_read_string): Handle string transfers at the end of a memory section gracefully.
This commit is contained in:
parent
94fa695eca
commit
8b150a6b18
|
@ -1,3 +1,12 @@
|
||||||
|
Sun Apr 26 07:57:21 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
|
||||||
|
|
||||||
|
* rs6000-nat.c (vmap_ldinfo): Issue warning instead of error if
|
||||||
|
fstat on ldinfo_fd fails. Use objfile->obfd instead of vp->bfd
|
||||||
|
to check for reference to the same file.
|
||||||
|
|
||||||
|
* target.c (target_read_string): Handle string transfers at the
|
||||||
|
end of a memory section gracefully.
|
||||||
|
|
||||||
Fri Apr 24 17:18:56 1998 Geoffrey Noer <noer@cygnus.com>
|
Fri Apr 24 17:18:56 1998 Geoffrey Noer <noer@cygnus.com>
|
||||||
|
|
||||||
* Makefile.in: enable EXEEXT setting
|
* Makefile.in: enable EXEEXT setting
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* IBM RS/6000 native-dependent code for GDB, the GNU debugger.
|
/* IBM RS/6000 native-dependent code for GDB, the GNU debugger.
|
||||||
Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1995, 1996, 1997
|
Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1995, 1996, 1997, 1998
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GDB.
|
This file is part of GDB.
|
||||||
|
@ -466,15 +466,24 @@ vmap_ldinfo (ldi)
|
||||||
retried = 0;
|
retried = 0;
|
||||||
|
|
||||||
if (fstat (ldi->ldinfo_fd, &ii) < 0)
|
if (fstat (ldi->ldinfo_fd, &ii) < 0)
|
||||||
fatal ("cannot fstat(fd=%d) on %s", ldi->ldinfo_fd, name);
|
{
|
||||||
|
/* The kernel sets ld_info to -1, if the process is still using the
|
||||||
|
object, and the object is removed. Keep the symbol info for the
|
||||||
|
removed object and issue a warning. */
|
||||||
|
warning ("%s (fd=%d) has disappeared, keeping its symbols",
|
||||||
|
name, ldi->ldinfo_fd);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
retry:
|
retry:
|
||||||
for (got_one = 0, vp = vmap; vp; vp = vp->nxt)
|
for (got_one = 0, vp = vmap; vp; vp = vp->nxt)
|
||||||
{
|
{
|
||||||
|
struct objfile *objfile;
|
||||||
|
|
||||||
/* First try to find a `vp', which is the same as in ldinfo.
|
/* First try to find a `vp', which is the same as in ldinfo.
|
||||||
If not the same, just continue and grep the next `vp'. If same,
|
If not the same, just continue and grep the next `vp'. If same,
|
||||||
relocate its tstart, tend, dstart, dend values. If no such `vp'
|
relocate its tstart, tend, dstart, dend values. If no such `vp'
|
||||||
found, get out of this for loop, add this ldi entry as a new vmap
|
found, get out of this for loop, add this ldi entry as a new vmap
|
||||||
(add_vmap) and come back, fins its `vp' and so on... */
|
(add_vmap) and come back, find its `vp' and so on... */
|
||||||
|
|
||||||
/* The filenames are not always sufficient to match on. */
|
/* The filenames are not always sufficient to match on. */
|
||||||
|
|
||||||
|
@ -482,15 +491,17 @@ vmap_ldinfo (ldi)
|
||||||
|| (memb[0] && !STREQ(memb, vp->member)))
|
|| (memb[0] && !STREQ(memb, vp->member)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* See if we are referring to the same file. */
|
/* See if we are referring to the same file.
|
||||||
if (bfd_stat (vp->bfd, &vi) < 0)
|
We have to check objfile->obfd, symfile.c:reread_symbols might
|
||||||
/* An error here is innocuous, most likely meaning that
|
have updated the obfd after a change. */
|
||||||
the file descriptor has become worthless.
|
objfile = vp->objfile == NULL ? symfile_objfile : vp->objfile;
|
||||||
FIXME: What does it mean for a file descriptor to become
|
if (objfile == NULL
|
||||||
"worthless"? What makes it happen? What error does it
|
|| objfile->obfd == NULL
|
||||||
produce (ENOENT? others?)? Should we at least provide
|
|| bfd_stat (objfile->obfd, &vi) < 0)
|
||||||
a warning? */
|
{
|
||||||
|
warning ("Unable to stat %s, keeping its symbols", name);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (ii.st_dev != vi.st_dev || ii.st_ino != vi.st_ino)
|
if (ii.st_dev != vi.st_dev || ii.st_ino != vi.st_ino)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue