1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

strace: Stop using Core::IODevice::printf()

There are no other clients of this weird API, so let's get rid of it.
Now that we call IODevice::write() instead, we can also handle errors.
This commit is contained in:
Andreas Kling 2021-05-07 22:06:58 +02:00
parent 05dbf3891a
commit c7e5ef3057

View file

@ -148,13 +148,17 @@ int main(int argc, char** argv)
u32 res = regs.eax;
trace_file->printf("%s(0x%x, 0x%x, 0x%x)\t=%d\n",
Syscall::to_string(
(Syscall::Function)syscall_index),
auto string = String::formatted("{}({:#08x}, {:#08x}, {:#08x})\t={}\n",
Syscall::to_string((Syscall::Function)syscall_index),
arg1,
arg2,
arg3,
res);
if (!trace_file->write(string)) {
warnln("write: {}", trace_file->error_string());
return 1;
}
}
return 0;