This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] linux-record: Fix bad fall-through for pipe/pipe2
- From: Andreas Arnez <arnez at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 17 Mar 2016 09:00:39 -0000
- Subject: [binutils-gdb] linux-record: Fix bad fall-through for pipe/pipe2
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=afdab9165435e17169b4984eeb29ea751319aa74
commit afdab9165435e17169b4984eeb29ea751319aa74
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date: Thu Mar 17 09:58:56 2016 +0100
linux-record: Fix bad fall-through for pipe/pipe2
This patch added handling for some syscalls to linux-record.c:
https://sourceware.org/ml/gdb-patches/2015-10/msg00452.html
But for both `pipe' and `pipe2' the patch lacks a statement after an
`if', such that the following `break' is interpreted as the `if'-body
instead.
This adds the missing (return-) statements for the conditionals.
gdb/ChangeLog:
* linux-record.c (record_linux_system_call): Add missing return
statements to handling of pipe and pipe2 syscalls.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/linux-record.c | 2 ++
2 files changed, 7 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a9952cb..bc1b2f5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-17 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * linux-record.c (record_linux_system_call): Add missing return
+ statements to handling of pipe and pipe2 syscalls.
+
2016-03-16 Doug Evans <dje@google.com>
* xml-tdesc.c (tdesc_start_enum): Fix c++ build.
diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index a40845a..2e86936 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -354,6 +354,7 @@ record_linux_system_call (enum gdb_syscall syscall,
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
tdep->size_int * 2))
+ return -1;
break;
case gdb_sys_times:
@@ -2312,6 +2313,7 @@ Do you want to stop the program?"),
regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
tdep->size_int * 2))
+ return -1;
break;
case gdb_sys_inotify_init1: