From: Michael Snyder Date: Mon, 23 May 2005 21:19:48 +0000 (+0000) Subject: 2005-05-23 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e14c2ea7fcc88584c816501fa1d75bb5cc40010;p=binutils-gdb.git 2005-05-23 Michael Snyder From Nora Pan * linux-nat.c (read_mapping): Don't stumble over entries in mapping that have name but zero inode. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f68f9a81948..7330f54caad 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2005-05-23 Michael Snyder + From Nora Pan + * linux-nat.c (read_mapping): Don't stumble over entries in + mapping that have name but zero inode. + 2005-05-23 Andrew Cagney * target.h (child_xfer_memory): Use gdb_byte for byte buffer diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index b39d7926efb..2c64d5db9f8 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); }