From d357db25f2ab3fd6996702a59a6840af045015d6 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sun, 28 Apr 2019 02:06:31 +0200 Subject: [PATCH] gdb TIO: fix mode and flags being swapped --- sysmodules/rosalina/source/gdb/tio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sysmodules/rosalina/source/gdb/tio.c b/sysmodules/rosalina/source/gdb/tio.c index 808b2fa..09a22e1 100644 --- a/sysmodules/rosalina/source/gdb/tio.c +++ b/sysmodules/rosalina/source/gdb/tio.c @@ -237,7 +237,8 @@ GDB_DECLARE_TIO_HANDLER(Open) u32 args[2] = {0}; if (GDB_ParseHexIntegerList(args, comma + 1, 2, 0) == NULL) return GDB_ReplyErrno(ctx, EILSEQ); - int flags = (int)args[1]; + int flags = (int)args[0]; + // mode unused IFile f = {0}; u32 fsFlags = 0; @@ -288,7 +289,7 @@ GDB_DECLARE_TIO_HANDLER(Open) err = GDB_TioConvertResult(IFile_OpenFromArchive(&f, ar, fsPath, fsFlags)); if (err != 0) - __builtin_trap();//return GDB_TioReplyErrno(ctx, err); + return GDB_TioReplyErrno(ctx, err); FSUSER_CloseArchive(ar); if((flags & GDBHIO_O_ACCMODE) != GDBHIO_O_RDONLY && (flags & GDBHIO_O_TRUNC))