aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-proc.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2002-01-08 22:09:50 +0000
committerMichael Snyder <msnyder@vmware.com>2002-01-08 22:09:50 +0000
commit4b09dc8c14cd3dd0030c60976811a2b849bf9989 (patch)
tree6b37162b498f12a02a12e8dc7871b9a4411326e2 /gdb/linux-proc.c
parent97996af6f2b19f1dabca2a35b90eff5e18959e12 (diff)
downloadgdb-4b09dc8c14cd3dd0030c60976811a2b849bf9989.zip
gdb-4b09dc8c14cd3dd0030c60976811a2b849bf9989.tar.gz
gdb-4b09dc8c14cd3dd0030c60976811a2b849bf9989.tar.bz2
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.
Diffstat (limited to 'gdb/linux-proc.c')
-rw-r--r--gdb/linux-proc.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c
new file mode 100644
index 0000000..4e25923
--- /dev/null
+++ b/gdb/linux-proc.c
@@ -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;
+}