gdb/testsuite/lib/my-syscalls.S: Refactor new SYSCALL macro
authorPedro Alves <pedro@palves.net>
Fri, 2 Jul 2021 10:46:40 +0000 (11:46 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 13 Nov 2023 14:16:11 +0000 (14:16 +0000)
commit9d124749d2a6fce91647b2b00475b6293c1c59df
tree33f2d836543facaf4fe23ef073d7a050cad09826
parente8a625d126e4be34d23b5df535bed134b2bb3156
gdb/testsuite/lib/my-syscalls.S: Refactor new SYSCALL macro

Refactor the syscall assembly code in gdb/testsuite/lib/my-syscalls.S
behind a SYSCALL macro so that it's easy to add new syscalls without
duplicating code.

Note that the way the macro is implemented, it only works correctly
for syscalls with up to 3 arguments, and, if the syscall doesn't
return (the macro doesn't bother to save/restore callee-saved
registers).

The following patch will want to use the macro to define a wrapper for
the "exit" syscall, so the limitations continue to be sufficient.

Change-Id: I8acf1463b11a084d6b4579aaffb49b5d0dea3bba
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
gdb/testsuite/lib/my-syscalls.S