diff options
author | Michael Snyder <msnyder@vmware.com> | 2005-05-23 21:19:48 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2005-05-23 21:19:48 +0000 |
commit | 2e14c2ea7fcc88584c816501fa1d75bb5cc40010 (patch) | |
tree | 85a1fde89e867d9c8766043ea0cd13c383047e6b /gdb/linux-nat.c | |
parent | 6c932e5455d4f45b18417f57c146bbff75fe34bf (diff) | |
download | gdb-2e14c2ea7fcc88584c816501fa1d75bb5cc40010.zip gdb-2e14c2ea7fcc88584c816501fa1d75bb5cc40010.tar.gz gdb-2e14c2ea7fcc88584c816501fa1d75bb5cc40010.tar.bz2 |
2005-05-23 Michael Snyder <msnyder@redhat.com>
From Nora Pan <qpan@mvista.com>
* linux-nat.c (read_mapping): Don't stumble over entries in
mapping that have name but zero inode.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index b39d792..2c64d5d 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -2451,7 +2451,8 @@ read_mapping (FILE *mapfile, int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx", addr, endaddr, permissions, offset, device, inode); - if (ret > 0 && ret != EOF && *inode != 0) + filename[0] = '\0'; + if (ret > 0 && ret != EOF) { /* Eat everything up to EOL for the filename. This will prevent weird filenames (such as one with embedded whitespace) from @@ -2462,11 +2463,7 @@ read_mapping (FILE *mapfile, only. */ ret += fscanf (mapfile, "%[^\n]\n", filename); } - else - { - filename[0] = '\0'; /* no filename */ - fscanf (mapfile, "\n"); - } + return (ret != 0 && ret != EOF); } |