-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
754c334
commit ed76746
Showing
5 changed files
with
721 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* @file gdbhio.h | ||
* @brief Luma3DS GDB HIO (called File I/O in GDB documentation) functions. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <fcntl.h> | ||
#include <sys/time.h> | ||
#include <sys/stat.h> | ||
|
||
#define GDBHIO_STDIN_FILENO 0 | ||
#define GDBHIO_STDOUT_FILENO 1 | ||
#define GDBHIO_STDERR_FILENO 2 | ||
|
||
int gdbHioOpen(const char *pathname, int flags, mode_t mode); | ||
int gdbHioClose(int fd); | ||
int gdbHioRead(int fd, void *buf, unsigned int count); | ||
int gdbHioWrite(int fd, const void *buf, unsigned int count); | ||
off_t gdbHioLseek(int fd, off_t offset, int flag); | ||
int gdbHioRename(const char *oldpath, const char *newpath); | ||
int gdbHioUnlink(const char *pathname); | ||
int gdbHioStat(const char *pathname, struct stat *st); | ||
int gdbHioFstat(int fd, struct stat *st); | ||
int gdbHioGettimeofday(struct timeval *tv, void *tz); | ||
int gdbHioIsatty(int fd); | ||
|
||
///< Host I/O 'system' function, requires 'set remote system-call-allowed 1'. | ||
int gdbHioSystem(const char *command); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* @file gdbhio_dev.h | ||
* @brief Luma3DS GDB HIO (called File I/O in GDB documentation) devoptab wrapper. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdbool.h> | ||
|
||
struct timeval; | ||
|
||
///< Initializes the GDB HIO devoptab wrapper, returns 0 on success, -1 on failure. | ||
int gdbHioDevInit(void); | ||
|
||
///< Deinitializes the GDB HIO devoptab wrapper. | ||
void gdbHioDevExit(void); | ||
|
||
///< Returns a file descriptor mapping to the GDB client console's standard input stream. | ||
int gdbHioDevGetStdin(void); | ||
|
||
///< Returns a file descriptor mapping to the GDB client console's standard output stream. | ||
int gdbHioDevGetStdout(void); | ||
|
||
///< Returns a file descriptor mapping to the GDB client console's standard error stream. | ||
int gdbHioDevGetStderr(void); | ||
|
||
///< Redirects 0 to 3 of the application's standard streams to GDB client console's. Returns -1, -2, or -3, resp., on failure; 0 on success. | ||
int gdbHioDevRedirectStdStreams(bool in, bool out, bool err); | ||
|
||
///< GDB HIO POSIX function gettimeofday. | ||
int gdbHioDevGettimeofday(struct timeval *tv, void *tz); | ||
|
||
///< GDB HIO POSIX function isatty. | ||
int gdbHioDevIsatty(int fd); | ||
|
||
///< GDB HIO POSIX function system. Requires 'set remote system-call-allowed 1'. | ||
int gdbHioDevSystem(const char *command); |
Oops, something went wrong.