This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/3] linux-record: Fix bad fall-through for pipe/pipe2
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Cc: Yao Qi <qiyaoltc at gmail dot com>, "Metzger, Markus T" <markus dot t dot metzger at intel dot com>, Marcin KoÅcielnicki <koriakin at 0x04 dot net>
- Date: Wed, 16 Mar 2016 19:54:35 +0100
- Subject: [PATCH 1/3] linux-record: Fix bad fall-through for pipe/pipe2
- Authentication-results: sourceware.org; auth=none
- References: <1458154517-25441-1-git-send-email-arnez at linux dot vnet dot ibm dot com>
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.
---
gdb/linux-record.c | 2 ++
1 file changed, 2 insertions(+)
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:
--
2.5.0