aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-nat.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1995-04-11 22:26:14 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1995-04-11 22:26:14 +0000
commit8989d4fc4b13389e9883887b23e87a133eb72f38 (patch)
tree7a83a2a670c116a2d561ca93e93d69a90f8f9e91 /gdb/rs6000-nat.c
parentaf125b1638ee35edf583c6f0c17caeab419c8364 (diff)
downloadgdb-8989d4fc4b13389e9883887b23e87a133eb72f38.zip
gdb-8989d4fc4b13389e9883887b23e87a133eb72f38.tar.gz
gdb-8989d4fc4b13389e9883887b23e87a133eb72f38.tar.bz2
* utils.c, defs.h (warning_begin): Renamed from warning_setup, for
consistency with error_begin. Also print warning_pre_print. Document it better. * utils.c (warning): Use it. * utils.c (error_begin): Doc fix. * rs6000-nat.c (vmap_ldinfo): If symfile_objfile is not part of any vmap, nuke it.
Diffstat (limited to 'gdb/rs6000-nat.c')
-rw-r--r--gdb/rs6000-nat.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 8b92b6f..5a4274d 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -546,6 +546,31 @@ vmap_ldinfo (ldi)
} while (ldi->ldinfo_next
&& (ldi = (void *) (ldi->ldinfo_next + (char *) ldi)));
+ /* If we don't find the symfile_objfile anywhere in the ldinfo, it
+ is unlikely that the symbol file is relocated to the proper
+ address. And we might have attached to a process which is
+ running a different copy of the same executable. */
+ for (got_one = 0, vp = vmap; vp != NULL; vp = vp->nxt)
+ {
+ if (symfile_objfile == vp->objfile)
+ {
+ got_one = 1;
+ break;
+ }
+ }
+ if (symfile_objfile != NULL && !got_one)
+ {
+ warning_begin ();
+ fputs_unfiltered ("Symbol file ", gdb_stderr);
+ fputs_unfiltered (symfile_objfile->name, gdb_stderr);
+ fputs_unfiltered ("\nis not mapped; discarding it.\n\
+If in fact that file has symbols which the mapped files listed by\n\
+\"info files\" lack, you can load symbols with the \"symbol-file\" or\n\
+\"add-symbol-file\" commands (note that you must take care of relocating\n\
+symbols to the proper address).\n", gdb_stderr);
+ free_objfile (symfile_objfile);
+ symfile_objfile = NULL;
+ }
}
/* As well as symbol tables, exec_sections need relocation. After