Introduce exec_file_locate_attach

This commit adds a new function, exec_file_locate_attach, which works
like exec_file_attach except that, instead of a filename argument, it
takes an integer process ID and attempts to determine the executable
filename from that.

gdb/ChangeLog:

	* gdbcore.h (exec_file_locate_attach): New declaration.
	* exec.c (exec_file_locate_attach): New function, factored
	out from...
	* infcmd.c (attach_command_post_wait): ...here.
This commit is contained in:
Gary Benson
2015-04-17 09:47:30 +01:00
parent 92209ddfdc
commit a10de6046f
4 changed files with 47 additions and 23 deletions

View File

@@ -150,6 +150,13 @@ extern void core_file_command (char *filename, int from_tty);
extern void exec_file_attach (const char *filename, int from_tty);
/* If the filename of the main executable is unknown, attempt to
determine it. If a filename is determined, proceed as though
it was just specified with the "file" command. Do nothing if
the filename of the main executable is already known. */
extern void exec_file_locate_attach (int pid, int from_tty);
extern void exec_file_clear (int from_tty);
extern void validate_files (void);