From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4791 invoked by alias); 15 Dec 2013 03:58:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 4226 invoked by uid 89); 15 Dec 2013 03:58:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 X-HELO: joker.krisman.be Received: from joker.krisman.be (HELO joker.krisman.be) (192.95.37.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 15 Dec 2013 03:58:00 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (envelope-from ) id 1Vs2nU-0007wv-9P for gdb-patches@sourceware.org; Sat, 14 Dec 2013 22:55:16 -0500 From: Gabriel Krisman Bertazi To: gdb-patches@sourceware.org Subject: [PATCH] Fix for PR breakpoints/16297: Fix catch syscall to work with syscall 0 Date: Sun, 15 Dec 2013 03:58:00 -0000 Message-ID: <87fvpu4vgh.fsf@lestat.krisman.be> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00557.txt.bz2 --=-=-= Content-Type: text/plain Content-length: 525 Hello, This is a fix for bug 16297. The problem occurs when the user attempts to catch any syscall 0 (such as syscall read on Linux/x86_64). GDB was not able to catch the syscall and was missing the breakpoint. Now, breakpoint_hit_catch_syscall returns immediately when it finds the correct syscall number, avoiding a following check for the end of the search vector, that returns a no hit if the syscall number was zero. I already sent the form to FSF so I can sign the copyright assigment. -- Gabriel Krisman Bertazi --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=changelog.txt Content-length: 180 2013-12-15 Gabriel Krisman Bertazi PR breakpoints/16297 * breakpoint.c (breakpoint_hit_catch_syscall): Return immediately when expected syscall is hit. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=return_immediately_catch_syscall_hit.patch Content-length: 443 diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 589aa19..e798d1a 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -8325,10 +8325,9 @@ breakpoint_hit_catch_syscall (const struct bp_location *bl, VEC_iterate (int, c->syscalls_to_be_caught, i, iter); i++) if (syscall_number == iter) - break; + return 1; /* Not the same. */ - if (!iter) - return 0; + return 0; } return 1; --=-=-=--