From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2954 invoked by alias); 30 Oct 2015 08:12:21 -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 2923 invoked by uid 89); 30 Oct 2015 08:12:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout22.012.net.il Received: from mtaout22.012.net.il (HELO mtaout22.012.net.il) (80.179.55.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Oct 2015 08:12:19 +0000 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NX000H00XFJ2L00@a-mtaout22.012.net.il> for gdb-patches@sourceware.org; Fri, 30 Oct 2015 10:12:16 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NX000H1DXGF2N00@a-mtaout22.012.net.il>; Fri, 30 Oct 2015 10:12:16 +0200 (IST) Date: Fri, 30 Oct 2015 13:26:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH] Implement 'catch syscall' for gdbserver In-reply-to: <1446169946-28117-1-git-send-email-jistone@redhat.com> To: Josh Stone Cc: gdb-patches@sourceware.org, sergiodj@redhat.com, palves@redhat.com, philippe.waroquiers@skynet.be, jistone@redhat.com Reply-to: Eli Zaretskii Message-id: <83d1vw22sb.fsf@gnu.org> References: <1446169946-28117-1-git-send-email-jistone@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00750.txt.bz2 > From: Josh Stone > Cc: sergiodj@redhat.com, palves@redhat.com, philippe.waroquiers@skynet.be, Josh Stone > Date: Thu, 29 Oct 2015 18:52:26 -0700 > > gdb/ChangeLog: > > 2015-10-29 Josh Stone > > * NEWS (Changes since GDB 7.10): Mention QCatchSyscalls and new > GDBserver support for catch syscall. > * remote.c (PACKET_QCatchSyscalls): New enum. > (remote_set_syscall_catchpoint): New function. > (remote_protocol_features): New element for QCatchSyscalls. > (remote_parse_stop_reply): Parse syscall_entry/return stops. > (init_remote_ops): Install remote_set_syscall_catchpoint. > (_initialize_remote): Config QCatchSyscalls. > > gdb/doc/ChangeLog: > > 2015-10-29 Josh Stone > > * gdb.texinfo (Remote Configuration): List the QCatchSyscalls packet. > (Stop Reply Packets): List the syscall entry and return stop reasons. > (General Query Packets): Describe QCatchSyscalls, and add it to the > table and detailed list of stub features. > > gdb/gdbserver/ChangeLog: > > 2015-10-29 Josh Stone > > * inferiors.h: Include "gdb_vecs.h". > (struct process_info): Add syscalls_to_catch. > * inferiors.c (remove_process): Free syscalls_to_catch. > * remote-utils.c (prepare_resume_reply): Report syscall_entry and > syscall_resume stops. > * server.h (UNKNOWN_SYSCALL, ANY_SYSCALL): Define. > * server.c (handle_general_set): Handle QCatchSyscalls. > (handle_query): Report support for QCatchSyscalls. > * target.h (struct target_ops): Add supports_catch_syscall. > (target_supports_catch_syscall): New macro. > * linux-low.h (struct linux_target_ops): Add get_syscall_trapinfo. > (struct lwp_info): Add syscall_state. > * linux-low.c (SYSCALL_SIGTRAP): Define. > (handle_extended_wait): Mark syscall_state like an entry. > (get_syscall_trapinfo): New function, proxy to the_low_target. > (linux_low_ptrace_options): Enable PTRACE_O_TRACESYSGOOD. > (linux_low_filter_event): Set ptrace options even before arch-specific > setup. Either toggle syscall_state entry/return or set ignored. > (gdb_catching_syscalls_p): New function. > (gdb_catch_this_syscall_p): New function. > (linux_wait_1): Handle SYSCALL_SIGTRAP. > (linux_resume_one_lwp_throw): Add PTRACE_SYSCALL possibility. > (linux_supports_catch_syscall): New function. > (linux_target_ops): Install it. > * linux-x86-low.c (x86_get_syscall_trapinfo): New function. > (the_low_target): Install it. > * nto-low.c (nto_target_ops): Install NULL supports_catch_syscall. > * spu-low.c (spu_target_ops): Likewise. > * win32-low.c (win32_target_ops): Likewise. > > gdb/testsuite/ChangeLog: > > 2015-10-29 Josh Stone > > * gdb.base/catch-syscall.exp: Enable testing for x86 and x86_64 linux > remote targets. > (do_syscall_tests): Only test mid-vfork on local or extended-remote. The documentation parts are OK, with this minor comment and one question. Here's the comment: > +Note that if a syscall not member of the list is reported, @value{GDBN} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "a syscall not in the list" sounds simpler and more clear, and doesn't change the meaning. > +will filter it if this syscall is not caught. It is however more efficient > +to only report the needed syscalls. The question is about the same sentence: maybe because I don't really use this stuff, I'm not sure I understand the distinction between "reported" and "caught" here: what does it mean for a syscall to be reported, but not caught? Perhaps this text should be clarified to not cause such confusion. Thanks.