This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ob] gnu-nat.c, don't error out on target_pid_to_exec_file


Hi,

Another one I had here, that I noticed while running the
testsuite on a debian/hurd system.

There's no reason to throw an error from target_pid_to_exec_file,
claiming it isn't implemented.  If it isn't implemented, it's OK,
it's just that a handy feature isn't implemented --- the user
has to specify the exec file manually.  The default implementation
returns NULL already.  No need to leave the attaching half finished.

 /* Attempts to find the pathname of the executable file
    that was run to create a specified process.

    The process PID must be stopped when this operation is used.

    If the executable file cannot be determined, NULL is returned.

    Else, a pointer to a character string containing the pathname
    is returned.  This string should be copied into a buffer by
    the client if the string will not be immediately used, or if
    it must persist.  */

 #define target_pid_to_exec_file(pid) \
      (current_target.to_pid_to_exec_file) (pid)

Checked in as obvious.

-- 
Pedro Alves
2008-09-09  Pedro Alves  <pedro@codesourcery.com>

	* gnu-nat.c (gnu_pid_to_exec_file): Delete.
	(init_gnu_ops): Don't register it.

---
 gdb/gnu-nat.c |    9 ---------
 1 file changed, 9 deletions(-)

Index: src/gdb/gnu-nat.c
===================================================================
--- src.orig/gdb/gnu-nat.c	2008-09-09 16:45:46.000000000 +0100
+++ src/gdb/gnu-nat.c	2008-09-09 16:46:55.000000000 +0100
@@ -2253,14 +2253,6 @@ gnu_stop (ptid_t ptid)
   error (_("to_stop target function not implemented"));
 }
 
-static char *
-gnu_pid_to_exec_file (int pid)
-{
-  error (_("to_pid_to_exec_file target function not implemented"));
-  return NULL;
-}
-
-
 static int
 gnu_thread_alive (ptid_t ptid)
 {
@@ -2649,7 +2641,6 @@ init_gnu_ops (void)
   gnu_ops.to_thread_alive = gnu_thread_alive;	/* to_thread_alive */
   gnu_ops.to_pid_to_str = gnu_pid_to_str;   /* to_pid_to_str */
   gnu_ops.to_stop = gnu_stop;	/* to_stop */
-  gnu_ops.to_pid_to_exec_file = gnu_pid_to_exec_file; /* to_pid_to_exec_file */
   gnu_ops.to_stratum = process_stratum;		/* to_stratum */
   gnu_ops.to_has_all_memory = 1;	/* to_has_all_memory */
   gnu_ops.to_has_memory = 1;		/* to_has_memory */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]