mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-03-01 05:46:00 +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:
parent
97996af6f2
commit
4b09dc8c14
@ -1,3 +1,20 @@
|
||||
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.
|
||||
|
||||
2002-01-06 Pierre Muller <muller@ics.u-strasbg.fr>
|
||||
|
||||
* win32-nat.c: Add i386-tdep.h dependency.
|
||||
|
@ -1848,6 +1848,8 @@ proc-why.o: proc-why.c $(defs_h) proc-utils.h
|
||||
sol-thread.o: sol-thread.c $(defs_h) $(gdbthread_h) $(target_h) $(inferior_h) \
|
||||
$(gdbcmd_h) $(regcache_h)
|
||||
|
||||
linux-proc.o: linux-proc.c $(defs_h)
|
||||
|
||||
linux-thread.o: linux-thread.c $(breakpoint_h) $(gdbcmd_h) gdb_wait.h \
|
||||
$(gdbthread_h) $(gdbcore_h) $(inferior_h) $(target_h) $(defs_h)
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
XDEPFILES=
|
||||
XM_FILE= xm-alphalinux.h
|
||||
NAT_FILE= nm-linux.h
|
||||
NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o \
|
||||
NATDEPFILES= infptrace.o inftarg.o corelow.o alpha-nat.o linux-proc.o \
|
||||
fork-child.o proc-service.o thread-db.o lin-lwp.o
|
||||
|
||||
LOADLIBES = -ldl -rdynamic
|
||||
|
@ -5,7 +5,7 @@ XDEPFILES=
|
||||
|
||||
NAT_FILE= nm-linux.h
|
||||
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
|
||||
core-regset.o arm-linux-nat.o \
|
||||
core-regset.o arm-linux-nat.o linux-proc.o \
|
||||
proc-service.o thread-db.o lin-lwp.o
|
||||
|
||||
LOADLIBES= -ldl -rdynamic
|
||||
|
@ -4,9 +4,9 @@ XM_FILE= xm-i386.h
|
||||
XDEPFILES=
|
||||
|
||||
NAT_FILE= nm-linux.h
|
||||
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
|
||||
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o linux-proc.o \
|
||||
core-aout.o i386-nat.o i386-linux-nat.o i387-nat.o \
|
||||
proc-service.o thread-db.o lin-lwp.o
|
||||
proc-service.o thread-db.o lin-lwp.o linux-proc.o
|
||||
|
||||
# The dynamically loaded libthread_db needs access to symbols in the
|
||||
# gdb executable.
|
||||
|
@ -6,6 +6,6 @@ XDEPFILES=
|
||||
NAT_FILE= nm-x86-64.h
|
||||
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
|
||||
core-aout.o i386-nat.o x86-64-nat.o x86-64-linux-nat.o \
|
||||
i387-nat.o proc-service.o thread-db.o lin-lwp.o
|
||||
i387-nat.o proc-service.o thread-db.o lin-lwp.o linux-proc.o
|
||||
|
||||
LOADLIBES = -ldl -rdynamic
|
||||
|
@ -5,7 +5,7 @@ XDEPFILES=
|
||||
|
||||
NAT_FILE= nm-linux.h
|
||||
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
|
||||
core-aout.o core-regset.o ia64-linux-nat.o \
|
||||
core-aout.o core-regset.o ia64-linux-nat.o linux-proc.o \
|
||||
proc-service.o thread-db.o lin-lwp.o
|
||||
|
||||
LOADLIBES = -ldl -rdynamic
|
||||
|
@ -5,8 +5,8 @@ XDEPFILES=
|
||||
|
||||
NAT_FILE= nm-linux.h
|
||||
NATDEPFILES= infptrace.o inftarg.o fork-child.o \
|
||||
corelow.o core-aout.o m68klinux-nat.o \
|
||||
proc-service.o thread-db.o lin-lwp.o
|
||||
corelow.o core-aout.o m68klinux-nat.o linux-proc.o \
|
||||
proc-service.o thread-db.o lin-lwp.o
|
||||
|
||||
# The dynamically loaded libthread_db needs access to symbols in the
|
||||
# gdb executable.
|
||||
|
@ -3,6 +3,6 @@ XDEPFILES=
|
||||
XM_FILE= xm-linux.h
|
||||
NAT_FILE= nm-linux.h
|
||||
NATDEPFILES= infptrace.o inftarg.o fork-child.o mips-linux-nat.o \
|
||||
thread-db.o lin-lwp.o proc-service.o
|
||||
thread-db.o lin-lwp.o proc-service.o linux-proc.o
|
||||
|
||||
LOADLIBES = -ldl -rdynamic
|
||||
|
@ -67,3 +67,8 @@ extern void lin_thread_get_thread_signals (sigset_t *mask);
|
||||
|
||||
#define GDB_GREGSET_T elf_gregset_t
|
||||
#define GDB_FPREGSET_T elf_fpregset_t
|
||||
|
||||
/* Override child_pid_to_exec_file in 'inftarg.c'. */
|
||||
#define CHILD_PID_TO_EXEC_FILE
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@ XDEPFILES=
|
||||
XM_CLIBS=
|
||||
|
||||
NAT_FILE= nm-linux.h
|
||||
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
|
||||
NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o linux-proc.o \
|
||||
core-regset.o ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o
|
||||
|
||||
LOADLIBES = -ldl -rdynamic
|
||||
|
@ -5,7 +5,7 @@ XDEPFILES=
|
||||
|
||||
NAT_FILE= nm-linux.h
|
||||
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o \
|
||||
proc-service.o thread-db.o lin-lwp.o sparc-linux-nat.o
|
||||
proc-service.o thread-db.o lin-lwp.o sparc-linux-nat.o linux-proc.o
|
||||
|
||||
# The dynamically loaded libthread_db needs access to symbols in the
|
||||
# gdb executable.
|
||||
|
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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user