mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-08 15:56:07 +08:00
2002-01-08 Michael Snyder <msnyder@redhat.com>
* linux-proc.c (child_pid_to_exec_file): Use readlink to get the real name of the executable, rather than the /proc name.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2002-01-08 Michael Snyder <msnyder@redhat.com>
|
||||||
|
|
||||||
|
* linux-proc.c (child_pid_to_exec_file): Use readlink to get the
|
||||||
|
real name of the executable, rather than the /proc name.
|
||||||
|
|
||||||
2002-01-03 Michael Snyder <msnyder@redhat.com>
|
2002-01-03 Michael Snyder <msnyder@redhat.com>
|
||||||
|
|
||||||
Implement a "generate-core-file" command in gdb, save target state.
|
Implement a "generate-core-file" command in gdb, save target state.
|
||||||
|
@ -37,11 +37,19 @@
|
|||||||
char *
|
char *
|
||||||
child_pid_to_exec_file (int pid)
|
child_pid_to_exec_file (int pid)
|
||||||
{
|
{
|
||||||
static char fname[MAXPATHLEN];
|
char *name1, *name2;
|
||||||
|
|
||||||
sprintf (fname, "/proc/%d/exe", pid);
|
name1 = xmalloc (MAXPATHLEN);
|
||||||
/* FIXME use readlink to get the real name. */
|
name2 = xmalloc (MAXPATHLEN);
|
||||||
return fname;
|
make_cleanup (xfree, name1);
|
||||||
|
make_cleanup (xfree, name2);
|
||||||
|
memset (name2, 0, MAXPATHLEN);
|
||||||
|
|
||||||
|
sprintf (name1, "/proc/%d/exe", pid);
|
||||||
|
if (readlink (name1, name2, MAXPATHLEN) > 0)
|
||||||
|
return name2;
|
||||||
|
else
|
||||||
|
return name1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function: linux_find_memory_regions
|
/* Function: linux_find_memory_regions
|
||||||
|
Reference in New Issue
Block a user