ChangeLog:

* configure.ac [AC_CHECK_FUNCS]: Check for readlink.
	* config.in, configure: Regenerate.

	* target.h (struct target_ops): Add to_fileio_readlink.
	(target_fileio_readlink): Add prototype.
	* target.c (target_fileio_readlink): New function.

	* inf-child.c: Conditionally include <sys/param.h>.
	(inf_child_fileio_readlink): New function.
	(inf_child_target): Install it.

	* remote.c (PACKET_vFile_readlink): New enum value.
	(remote_hostio_readlink): New function.
	(init_remote_ops): Install it.
	(_initialize_remote): Handle vFile:readlink packet type.

doc/ChangeLog:

	* gdb.texinfo (Remote Configuration): Document
	"set remote hostio-readlink-packet" command.
	(General Query Packets): Document vFile:readlink packet.

gdbserver/ChangeLog:

	* hostio.c (handle_readlink): New function.
	(handle_vFile): Call it to handle "vFile:readlink" packets.
This commit is contained in:
Ulrich Weigand
2012-01-20 09:47:32 +00:00
parent 7313baad7c
commit b9e7b9c3de
12 changed files with 195 additions and 2 deletions

View File

@@ -709,6 +709,11 @@ struct target_ops
occurs (and set *TARGET_ERRNO). */
int (*to_fileio_unlink) (const char *filename, int *target_errno);
/* Read value of symbolic link FILENAME on the target. Return a
null-terminated string allocated via xmalloc, or NULL if an error
occurs (and set *TARGET_ERRNO). */
char *(*to_fileio_readlink) (const char *filename, int *target_errno);
/* Tracepoint-related operations. */
@@ -1546,6 +1551,11 @@ extern int target_fileio_close (int fd, int *target_errno);
occurs (and set *TARGET_ERRNO). */
extern int target_fileio_unlink (const char *filename, int *target_errno);
/* Read value of symbolic link FILENAME on the target. Return a
null-terminated string allocated via xmalloc, or NULL if an error
occurs (and set *TARGET_ERRNO). */
extern char *target_fileio_readlink (const char *filename, int *target_errno);
/* Read target file FILENAME. The return value will be -1 if the transfer
fails or is not supported; 0 if the object is empty; or the length
of the object otherwise. If a positive value is returned, a