aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Arnez <arnez@linux.vnet.ibm.com>2016-04-19 16:53:40 +0200
committerAndreas Arnez <arnez@linux.vnet.ibm.com>2016-04-19 16:53:40 +0200
commit73e6209faecc21516a981ed86a27b259f506098c (patch)
treeb1bc95d2e1a91797617148fa29c89e861fb57dbf
parentf42bf748e417cf9120fc57d144b6eaaf3adda247 (diff)
downloadgdb-73e6209faecc21516a981ed86a27b259f506098c.zip
gdb-73e6209faecc21516a981ed86a27b259f506098c.tar.gz
gdb-73e6209faecc21516a981ed86a27b259f506098c.tar.bz2
linux-record: Squash cases with identical handling
In record_linux_system_call there are some cases with identical handling. These are merged together to reduce code duplication. gdb/ChangeLog: * linux-record.c (record_linux_system_call): Merge handling for readlink/recv/read and pipe/pipe2.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/linux-record.c20
2 files changed, 8 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1b12330..4dee490 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-19 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * linux-record.c (record_linux_system_call): Merge handling for
+ readlink/recv/read and pipe/pipe2.
+
2016-04-14 Walfred Tedeschi <walfred.tedeschi@intel.com>
* features/i386/amd64-mpx-linux.xml: Remove AVX feature.
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index fda7ada..51253cc 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -264,6 +264,8 @@ record_linux_system_call (enum gdb_syscall syscall,
break;
case gdb_sys_read:
+ case gdb_sys_readlink:
+ case gdb_sys_recv:
regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
if (record_mem_at_reg (regcache, tdep->arg2, (int) tmpulongest))
return -1;
@@ -348,6 +350,7 @@ record_linux_system_call (enum gdb_syscall syscall,
break;
case gdb_sys_pipe:
+ case gdb_sys_pipe2:
if (record_mem_at_reg (regcache, tdep->arg1, tdep->size_int * 2))
return -1;
break;
@@ -645,12 +648,6 @@ record_linux_system_call (enum gdb_syscall syscall,
case gdb_sys_symlink:
break;
- case gdb_sys_readlink:
- regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
- if (record_mem_at_reg (regcache, tdep->arg2, (int) tmpulongest))
- return -1;
- break;
-
case gdb_sys_uselib:
case gdb_sys_swapon:
break;
@@ -742,12 +739,6 @@ Do you want to stop the program?"),
}
break;
- case gdb_sys_recv:
- regcache_raw_read_unsigned (regcache, tdep->arg3, &tmpulongest);
- if (record_mem_at_reg (regcache, tdep->arg2, (int) tmpulongest))
- return -1;
- break;
-
case gdb_sys_recvmsg:
regcache_raw_read_unsigned (regcache, tdep->arg2, &tmpulongest);
if (record_linux_msghdr (regcache, tdep, tmpulongest))
@@ -2035,11 +2026,6 @@ Do you want to stop the program?"),
case gdb_sys_dup3:
break;
- case gdb_sys_pipe2:
- if (record_mem_at_reg (regcache, tdep->arg1, tdep->size_int * 2))
- return -1;
- break;
-
case gdb_sys_inotify_init1:
break;