Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Nora Pan" <qpan@mvista.com>
To: <gdb-patches@sources.redhat.com>
Subject: Patch: Fix the segment missing in gcore maps parser.
Date: Mon, 21 Mar 2005 00:55:00 -0000	[thread overview]
Message-ID: <000201c52db0$b6ef5780$810a000a@Nora> (raw)

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);
 }


             reply	other threads:[~2005-03-21  0:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-21  0:55 Nora Pan [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000201c52db0$b6ef5780$810a000a@Nora' \
    --to=qpan@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox