aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-02-09 16:45:17 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-02-09 16:45:17 +0000
commit07318b29dbd93592d8664fef540723e07ddf67be (patch)
treed75fc3e7572c800658987c07c89b5fa1fd3051b7 /gdb
parent59c58d08137da401a957fdffccb693d6aee12e51 (diff)
downloadgdb-07318b29dbd93592d8664fef540723e07ddf67be.zip
gdb-07318b29dbd93592d8664fef540723e07ddf67be.tar.gz
gdb-07318b29dbd93592d8664fef540723e07ddf67be.tar.bz2
* symmisc.c: Include gdb_stat.h.
(maintenance_print_msymbols): Use inode numbers to compare files.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/symmisc.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1cf712a..6aff8c8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-09 Corinna Vinschen <vinschen@redhat.com>
+
+ * symmisc.c: Include gdb_stat.h.
+ (maintenance_print_msymbols): Use inode numbers to compare files.
+
2005-02-09 Andrew Cagney <cagney@gnu.org>
* config/sh/linux.mt (TDEPFILES): Add symfile-mem.o.
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index d3fb7ba..5bf148c 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -35,6 +35,7 @@
#include "bcache.h"
#include "block.h"
#include "gdb_regex.h"
+#include "gdb_stat.h"
#include "dictionary.h"
#include "gdb_string.h"
@@ -930,6 +931,8 @@ maintenance_print_msymbols (char *args, int from_tty)
char *symname = NULL;
struct objfile *objfile;
+ struct stat sym_st, obj_st;
+
dont_repeat ();
if (args == NULL)
@@ -948,7 +951,10 @@ maintenance_print_msymbols (char *args, int from_tty)
/* If a second arg is supplied, it is a source file name to match on */
if (argv[1] != NULL)
{
- symname = argv[1];
+ symname = xfullpath (argv[1]);
+ make_cleanup (xfree, symname);
+ if (symname && stat (symname, &sym_st))
+ perror_with_name (symname);
}
}
@@ -962,8 +968,9 @@ maintenance_print_msymbols (char *args, int from_tty)
immediate_quit++;
ALL_OBJFILES (objfile)
- if (symname == NULL || strcmp (symname, objfile->name) == 0)
- dump_msymbols (objfile, outfile);
+ if (symname == NULL
+ || (!stat (objfile->name, &obj_st) && sym_st.st_ino == obj_st.st_ino))
+ dump_msymbols (objfile, outfile);
immediate_quit--;
fprintf_filtered (outfile, "\n\n");
do_cleanups (cleanups);