mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-07 17:20:14 +01:00
More flockfile
This commit is contained in:
parent
66bc415dc3
commit
653eff3d16
|
|
@ -77,11 +77,12 @@ void rx::printStackTrace(ucontext_t *context, orbis::Thread *thread,
|
|||
unw_cursor_t cursor;
|
||||
|
||||
char buffer[1024];
|
||||
|
||||
flockfile(stderr);
|
||||
if (int r = unw_init_local2(&cursor, context, UNW_INIT_SIGNAL_FRAME)) {
|
||||
int len = snprintf(buffer, sizeof(buffer), "unw_init_local: %s\n",
|
||||
unw_strerror(r));
|
||||
write(fileno, buffer, len);
|
||||
funlockfile(stderr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -123,4 +124,5 @@ void rx::printStackTrace(ucontext_t *context, orbis::Thread *thread,
|
|||
write(fileno, buffer, offset);
|
||||
count++;
|
||||
} while (unw_step(&cursor) > 0 && count < 32);
|
||||
funlockfile(stderr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ static void onSysEnter(orbis::Thread *thread, int id, uint64_t *args,
|
|||
if (true || !g_traceSyscalls) {
|
||||
return;
|
||||
}
|
||||
flockfile(stdout);
|
||||
std::printf(" [%u] ", thread->tid);
|
||||
|
||||
if (auto name = getSyscallName(thread, id)) {
|
||||
|
|
@ -195,6 +196,7 @@ static void onSysEnter(orbis::Thread *thread, int id, uint64_t *args,
|
|||
}
|
||||
|
||||
std::printf(")\n");
|
||||
funlockfile(stdout);
|
||||
}
|
||||
|
||||
static void onSysExit(orbis::Thread *thread, int id, uint64_t *args,
|
||||
|
|
@ -203,6 +205,7 @@ static void onSysExit(orbis::Thread *thread, int id, uint64_t *args,
|
|||
return;
|
||||
}
|
||||
|
||||
flockfile(stdout);
|
||||
std::printf("%c: [%u] ", result.isError() ? 'E' : 'S', thread->tid);
|
||||
|
||||
if (auto name = getSyscallName(thread, id)) {
|
||||
|
|
@ -221,6 +224,7 @@ static void onSysExit(orbis::Thread *thread, int id, uint64_t *args,
|
|||
|
||||
std::printf(") -> Status %d, Value %lx:%lx\n", result.value(),
|
||||
thread->retval[0], thread->retval[1]);
|
||||
funlockfile(stdout);
|
||||
}
|
||||
|
||||
static int ps4Exec(orbis::Process *mainProcess,
|
||||
|
|
|
|||
Loading…
Reference in a new issue