[1/2] Support more syscalls in linux-record: pipe2 epoll_create1 eventfd2 fallocate dup3 and inotify_init1

Message ID 1456302263-18203-1-git-send-email-yao.qi@linaro.org
State New, archived
Headers

Commit Message

Yao Qi Feb. 24, 2016, 8:24 a.m. UTC
  This patch adds more syscalls in linux-record.  Regression tested on
x86_64-linux.

gdb:

2016-02-24  Yao Qi  <yao.qi@linaro.org>

	* linux-record.h (enum gdb_syscall) <gdb_sys_fallocate>: New.
	<gdb_sys_eventfd2, gdb_sys_epoll_create1, gdb_sys_dup3>: New.
	<gdb_sys_pipe2, gdb_sys_inotify_init1>: New.
	* linux-record.c (record_linux_system_call): Handle them.
---
 gdb/linux-record.c | 15 +++++++++++++++
 gdb/linux-record.h |  6 ++++++
 2 files changed, 21 insertions(+)
  

Comments

Yao Qi Feb. 29, 2016, 4:45 p.m. UTC | #1
Yao Qi <qiyaoltc@gmail.com> writes:

> This patch adds more syscalls in linux-record.  Regression tested on
> x86_64-linux.
>
> gdb:
>
> 2016-02-24  Yao Qi  <yao.qi@linaro.org>
>
> 	* linux-record.h (enum gdb_syscall) <gdb_sys_fallocate>: New.
> 	<gdb_sys_eventfd2, gdb_sys_epoll_create1, gdb_sys_dup3>: New.
> 	<gdb_sys_pipe2, gdb_sys_inotify_init1>: New.
> 	* linux-record.c (record_linux_system_call): Handle them.

I pushed them in.
  

Patch

diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index 29e299d..a40845a 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -2302,6 +2302,21 @@  Do you want to stop the program?"),
         }
       break;
 
+    case gdb_sys_fallocate:
+    case gdb_sys_eventfd2:
+    case gdb_sys_epoll_create1:
+    case gdb_sys_dup3:
+      break;
+
+    case gdb_sys_pipe2:
+      regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
+      if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
+					 tdep->size_int * 2))
+      break;
+
+    case gdb_sys_inotify_init1:
+      break;
+
     default:
       printf_unfiltered (_("Process record and replay target doesn't "
                            "support syscall number %d\n"), syscall);
diff --git a/gdb/linux-record.h b/gdb/linux-record.h
index ca6a117..b317ab1 100644
--- a/gdb/linux-record.h
+++ b/gdb/linux-record.h
@@ -504,6 +504,12 @@  enum gdb_syscall {
   gdb_sys_move_pages = 317,
   gdb_sys_getcpu = 318,
   gdb_sys_epoll_pwait = 319,
+  gdb_sys_fallocate = 324,
+  gdb_sys_eventfd2 = 328,
+  gdb_sys_epoll_create1 = 329,
+  gdb_sys_dup3 = 330,
+  gdb_sys_pipe2 = 331,
+  gdb_sys_inotify_init1 = 332,
   gdb_sys_socket = 500,
   gdb_sys_connect = 501,
   gdb_sys_accept = 502,