gdb hio: lseek returns 64-bit

This commit is contained in:
TuxSH 2019-05-04 17:08:32 +02:00
parent 23c40aeb8e
commit 2c8a1eb5c6
2 changed files with 5 additions and 4 deletions

View File

@ -56,7 +56,7 @@ typedef struct PackedGdbHioRequest
size_t stringLengths[8];
// Return
int retval;
s64 retval;
int gdbErrno;
bool ctrlC;
} PackedGdbHioRequest;

View File

@ -77,14 +77,14 @@ GDB_DECLARE_HANDLER(HioReply)
// "Call specific attachement" is always empty, though.
const char *pos = ctx->commandData;
u32 retval;
u64 retval;
if (*pos == 0 || *pos == ',')
return GDB_ReplyErrno(ctx, EILSEQ);
else if (*pos == '-')
{
pos++;
ctx->currentHioRequest.retval = -1;
ctx->currentHioRequest.retval = -1ll;
}
else if (*pos == '+')
{
@ -94,7 +94,7 @@ GDB_DECLARE_HANDLER(HioReply)
else
ctx->currentHioRequest.retval = 1;
pos = GDB_ParseHexIntegerList(&retval, pos, 1, ',');
pos = GDB_ParseHexIntegerList64(&retval, pos, 1, ',');
if (pos == NULL)
return GDB_ReplyErrno(ctx, EILSEQ);
@ -106,6 +106,7 @@ GDB_DECLARE_HANDLER(HioReply)
if (*pos != 0)
{
u32 errno_;
// GDB protocol technically allows errno to have a +/- prefix but this will never happen.
pos = GDB_ParseHexIntegerList(&errno_, ++pos, 1, ',');
ctx->currentHioRequest.gdbErrno = (int)errno_;
if (pos == NULL)