mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-25 16:57:52 +00:00
2002-01-07 Michael Snyder <msnyder@redhat.com>
* linux-proc.c: New file. Implement child_pid_to_exec_file, so that attaching to a pid will automatically read the process's symbol file and shlibs. * Makefile.in: Add rule for linux-proc.o. * config/nm-linux.h: Define CHILD_PID_TO_EXEC_FILE. * config/alpha/alpha-linux.mh: Add linux-proc.o to NATDEPFILES. * config/arm/linux.mh: Ditto. * config/i386/linux.mh: Ditto. * config/i386/x86-64linux.mh: Ditto. * config/ia64/linux.mh: Ditto. * config/m68k/linux.mh: Ditto. * config/mips/linux.mh: Ditto. * config/powerpc/linux.mh: Ditto. * config/sparc/linux.mh: Ditto.
This commit is contained in:
32
gdb/linux-proc.c
Normal file
32
gdb/linux-proc.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/* Generate a core file for the inferior process -- Linux version.
|
||||
Copyright 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "defs.h"
|
||||
#include <sys/param.h> /* for MAXPATHLEN */
|
||||
|
||||
char *
|
||||
child_pid_to_exec_file (int pid)
|
||||
{
|
||||
static char fname[MAXPATHLEN];
|
||||
|
||||
sprintf (fname, "/proc/%d/exe", pid);
|
||||
/* FIXME use readlink to get the real name. */
|
||||
return fname;
|
||||
}
|
||||
Reference in New Issue
Block a user