This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Process record: Log %rax after syscall under amd64-linux


Log the return value after executing a system call instruction, as
we do for other archs (i386-linux, arm-linux, etc.)

gdb/ChangeLog:
2018-05-10  Andrew D'Addesio  <modchipv12@gmail.com>

	* amd64-linux-tdep.c (amd64_linux_syscall_record_common): Record
	%rax.
---
 gdb/amd64-linux-tdep.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 2bd3d31..917ecf5 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1510,6 +1510,9 @@ amd64_linux_syscall_record_common (struct regcache *regcache,
 
  record_regs:
   /* Record the return value of the system call.  */
+  if (record_full_arch_list_add_reg (regcache, AMD64_RAX_REGNUM))
+    return -1;
+  /* Record registers clobbered by the 'syscall' instruction.  */
   if (record_full_arch_list_add_reg (regcache, AMD64_RCX_REGNUM))
     return -1;
   if (record_full_arch_list_add_reg (regcache, AMD64_R11_REGNUM))
-- 
2.7.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]