Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Patch: Fix the segment missing in gcore maps parser.
@ 2005-03-21  0:55 Nora Pan
  2005-03-21 19:23 ` Michael Snyder
  0 siblings, 1 reply; 5+ messages in thread
From: Nora Pan @ 2005-03-21  0:55 UTC (permalink / raw)
  To: gdb-patches

A bug in gdb /proc/<pid>/maps parser causes gcore can't capture the
segments following the one with a file name and zero inode entry in the
maps file. For example:

30028000-3002f000 rw-s 00000000 00:05 0 	 /SYSV0000bdad (deleted)

Okay for mainline?

-- 
Nora Pan
MontaVista Software




2005-03-18  Nora Pan  <qpan@mvista.com>

	* linux-nat.c (read_mapping): Capturing the segments after the
one with file name and zero inode.


diff -urNp src/gdb.orig/linux-nat.c src/gdb/linux-nat.c
--- src/gdb.orig/linux-nat.c	2005-03-06 08:42:20.000000000 -0800
+++ src/gdb/linux-nat.c	2005-03-18 17:48:05.000000000 -0800
@@ -2453,7 +2453,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

@@ -2464,11 +2465,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);
 }


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-05-23 21:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-21  0:55 Patch: Fix the segment missing in gcore maps parser Nora Pan
2005-03-21 19:23 ` Michael Snyder
2005-03-21 21:00   ` Daniel Jacobowitz
2005-05-18 20:53     ` Nora Pan
2005-05-24  1:04       ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox