This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: generate-core-file tweak for linux
- From: Michael Snyder <msnyder at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 25 Mar 2002 11:36:23 -0800
- Subject: [PATCH]: generate-core-file tweak for linux
This catches some minor variations in kernel output in /proc.
2002-03-25 Jeff Law (law@redhat.com)
* linux-proc.c (read_mapping): Scan up to end of line for filename.
Index: linux-proc.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-proc.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 linux-proc.c
*** linux-proc.c 2002/02/24 22:31:19 1.7
--- linux-proc.c 2002/03/25 19:44:51
*************** read_mapping (FILE *mapfile,
*** 77,83 ****
if (ret > 0 && ret != EOF && *inode != 0)
{
! ret += fscanf (mapfile, "%s\n", filename);
}
else
{
--- 77,90 ----
if (ret > 0 && ret != EOF && *inode != 0)
{
! /* Eat everything up to EOL for the filename. This will prevent
! weird filenames (such as one with embedded whitespace) from
! confusing this code. It also makes this code more robust
! in respect to annotations the kernel may add after the
! filename.
!
! Note the filename is used for informational purposes only. */
! ret += fscanf (mapfile, "%[^\n]\n", filename);
}
else
{