Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix for PR breakpoints/16297: Fix catch syscall to work with syscall 0
@ 2013-12-15  3:58 Gabriel Krisman Bertazi
  2013-12-15  4:04 ` Sergio Durigan Junior
  0 siblings, 1 reply; 9+ messages in thread
From: Gabriel Krisman Bertazi @ 2013-12-15  3:58 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

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


[-- Attachment #2: changelog.txt --]
[-- Type: text/plain, Size: 180 bytes --]

2013-12-15  Gabriel Krisman Bertazi  <gabriel@krisman.be>

	PR breakpoints/16297
	* breakpoint.c (breakpoint_hit_catch_syscall): Return immediately
	when expected syscall is hit.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: return_immediately_catch_syscall_hit.patch --]
[-- Type: text/x-diff, Size: 443 bytes --]

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;

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-12-19 19:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-15  3:58 [PATCH] Fix for PR breakpoints/16297: Fix catch syscall to work with syscall 0 Gabriel Krisman Bertazi
2013-12-15  4:04 ` Sergio Durigan Junior
2013-12-16 17:51   ` Pedro Alves
2013-12-16 17:57     ` Pedro Alves
2013-12-16 18:03       ` Sergio Durigan Junior
2013-12-16 18:35         ` Pedro Alves
2013-12-19  3:50           ` Sergio Durigan Junior
2013-12-19 16:21             ` Pedro Alves
2013-12-19 19:09               ` Sergio Durigan Junior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox