* Makefile.in (xcoffread.o): Depend on partial-stab.h.

* xcoffsolib.c (sharedlibrary_command): New command.
	* xcoffsolib.c (solib_info): Call xcoff_relocate_symtab.
	* xcoffsolib.c: Miscellaneous cleanups.

	* partial-stab.h: Ignore symbol descriptor '-' (for local
	variables with negative type numbers) without complaint.

	* rs6000-nat.c (vmap_ldinfo): Use bfd_stat rather than our own
	local emulation thereof.  Remove unused variable ostart.
This commit is contained in:
Jim Kingdon 1995-05-18 05:24:29 +00:00
parent 8558c4e316
commit fb49432789
4 changed files with 66 additions and 45 deletions

View File

@ -1,3 +1,17 @@
Wed May 17 11:21:32 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
* Makefile.in (xcoffread.o): Depend on partial-stab.h.
* xcoffsolib.c (sharedlibrary_command): New command.
* xcoffsolib.c (solib_info): Call xcoff_relocate_symtab.
* xcoffsolib.c: Miscellaneous cleanups.
* partial-stab.h: Ignore symbol descriptor '-' (for local
variables with negative type numbers) without complaint.
* rs6000-nat.c (vmap_ldinfo): Use bfd_stat rather than our own
local emulation thereof. Remove unused variable ostart.
Wed May 17 15:55:53 1995 J.T. Conklin <jtc@rtl.cygnus.com> Wed May 17 15:55:53 1995 J.T. Conklin <jtc@rtl.cygnus.com>
* Makefile.in (config.status): changed target so that * Makefile.in (config.status): changed target so that

View File

@ -593,6 +593,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
case '7': case '7':
case '8': case '8':
case '9': case '9':
case '-':
continue; continue;
case ':': case ':':

View File

@ -435,7 +435,6 @@ vmap_ldinfo (ldi)
struct stat ii, vi; struct stat ii, vi;
register struct vmap *vp; register struct vmap *vp;
int got_one, retried; int got_one, retried;
CORE_ADDR ostart;
int got_exec_file; int got_exec_file;
/* For each *ldi, see if we have a corresponding *vp. /* For each *ldi, see if we have a corresponding *vp.
@ -453,8 +452,6 @@ vmap_ldinfo (ldi)
retry: retry:
for (got_one = 0, vp = vmap; vp; vp = vp->nxt) for (got_one = 0, vp = vmap; vp; vp = vp->nxt)
{ {
FILE *io;
/* 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'
@ -467,14 +464,14 @@ vmap_ldinfo (ldi)
|| (memb[0] && !STREQ(memb, vp->member))) || (memb[0] && !STREQ(memb, vp->member)))
continue; continue;
io = bfd_cache_lookup (vp->bfd); /* totally opaque! */
if (!io)
fatal ("cannot find BFD's iostream for %s", vp->name);
/* 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)
/* An error here is innocuous, most likely meaning that /* An error here is innocuous, most likely meaning that
the file descriptor has become worthless. */ the file descriptor has become worthless.
if (fstat (fileno(io), &vi) < 0) FIXME: What does it mean for a file descriptor to become
"worthless"? What makes it happen? What error does it
produce (ENOENT? others?)? Should we at least provide
a warning? */
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)
@ -485,8 +482,7 @@ vmap_ldinfo (ldi)
++got_one; ++got_one;
/* found a corresponding VMAP. remap! */ /* Found a corresponding VMAP. Remap! */
ostart = vp->tstart;
/* We can assume pointer == CORE_ADDR, this code is native only. */ /* We can assume pointer == CORE_ADDR, this code is native only. */
vp->tstart = (CORE_ADDR) ldi->ldinfo_textorg; vp->tstart = (CORE_ADDR) ldi->ldinfo_textorg;
@ -507,7 +503,7 @@ vmap_ldinfo (ldi)
/* relocate symbol table(s). */ /* relocate symbol table(s). */
vmap_symtab (vp); vmap_symtab (vp);
/* there may be more, so we don't break out of the loop. */ /* There may be more, so we don't break out of the loop. */
} }
/* if there was no matching *vp, we must perforce create the sucker(s) */ /* if there was no matching *vp, we must perforce create the sucker(s) */

View File

@ -18,12 +18,15 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if 0
#include <sys/types.h> #include <sys/types.h>
#include <sys/ldr.h> #include <sys/ldr.h>
#endif
#include "defs.h" #include "defs.h"
#include "bfd.h" #include "bfd.h"
#include "xcoffsolib.h" #include "xcoffsolib.h"
#include "inferior.h"
#ifdef SOLIB_SYMBOLS_MANUAL #ifdef SOLIB_SYMBOLS_MANUAL
@ -146,26 +149,32 @@ CORE_ADDR addr;
return "(unknown load module)"; return "(unknown load module)";
} }
static void solib_info PARAMS ((char *, int));
solib_info (ldi) static void
register struct ld_info *ldi; solib_info (args, from_tty)
char *args;
int from_tty;
{ {
struct vmap *vp = vmap; struct vmap *vp = vmap;
if (!vp || !vp->nxt) { /* Check for new shared libraries loaded with load (). */
printf_unfiltered("No shared libraries loaded at this time.\n"); xcoff_relocate_symtab (inferior_pid);
if (vp == NULL || vp->nxt == NULL)
{
printf_unfiltered ("No shared libraries loaded at this time.\n");
return; return;
} }
/* skip over the first vmap, it is the main program, always loaded. */ /* Skip over the first vmap, it is the main program, always loaded. */
vp = vp->nxt; vp = vp->nxt;
printf_unfiltered ("\ printf_unfiltered ("\
Text Range Data Range Syms Shared Object Library\n"); Text Range Data Range Syms Shared Object Library\n");
for (; vp; vp = vp->nxt) { for (; vp != NULL; vp = vp->nxt)
{
printf_unfiltered ("0x%08x-0x%08x 0x%08x-0x%08x %s %s%s%s%s\n", printf_unfiltered ("0x%08x-0x%08x 0x%08x-0x%08x %s %s%s%s%s\n",
vp->tstart, vp->tend, vp->tstart, vp->tend,
vp->dstart, vp->dend, vp->dstart, vp->dend,
@ -177,25 +186,26 @@ Text Range Data Range Syms Shared Object Library\n");
} }
} }
#ifdef SOLIB_SYMBOLS_MANUAL
void void
sharedlibrary_command (args, from_tty) sharedlibrary_command (args, from_tty)
char *args; char *args;
int from_tty; int from_tty;
{ {
dont_repeat(); dont_repeat ();
/* Check for new shared libraries loaded with load (). */
xcoff_relocate_symtab (inferior_pid);
#ifdef SOLIB_SYMBOLS_MANUAL
solib_add (args, from_tty, (struct target_ops *)0); solib_add (args, from_tty, (struct target_ops *)0);
}
#endif /* SOLIB_SYMBOLS_MANUAL */ #endif /* SOLIB_SYMBOLS_MANUAL */
}
void void
_initialize_solib() _initialize_solib()
{ {
add_com ("sharedlibrary", class_files, sharedlibrary_command,
#ifdef SOLIB_SYMBOLS_MANUAL
add_com("sharedlibrary", class_files, sharedlibrary_command,
"Load shared object library symbols for files matching REGEXP."); "Load shared object library symbols for files matching REGEXP.");
#endif add_info ("sharedlibrary", solib_info,
add_info("sharedlibrary", solib_info,
"Status of loaded shared object libraries"); "Status of loaded shared object libraries");
} }