From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58316 invoked by alias); 1 Nov 2015 22:15:11 -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 58305 invoked by uid 89); 1 Nov 2015 22:15:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-ig0-f174.google.com Received: from mail-ig0-f174.google.com (HELO mail-ig0-f174.google.com) (209.85.213.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 01 Nov 2015 22:15:08 +0000 Received: by igbdj2 with SMTP id dj2so42882147igb.1 for ; Sun, 01 Nov 2015 14:15:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=gBhCMUgIRjSDP7lhPPs2jps5h0ggSbBjbkUUgll344A=; b=m/HqxEmnqvAnnJ/R4eaT9Y88IUXrPhrXeNf6HSqeXKpiWIjiB0uUTVsdObTcZvtdEL gltcc+xmX3LkfdsNYzCsitZXtliPe3+5wpXSdEbesQLCTgQYdP7MnmY80RQSl5j6SqRU 43Gg2jUGMf5T7HgLGe8c5w3MZCRGOq5CnfjFfd+ipug4bQ10PUfCsPzvqIjswMmX5SbK aenm994ZaHYeDpd1ZstMyNTAA27F+6URiIRMGDO+zk691w0YVWFeKVlAoKcRbDjfzsvw awVHQ81oQ+C0c4AjP8zL0svz1jGZaT9Fp/ZJeqo516nBw9HbpOYhBlRervpqqhyLnkol eNCg== X-Gm-Message-State: ALoCoQn7L6OWTFklWWovts4s/E8qs1Q4iqhkx652ghl4wuVT6CaFD3/TAPLDwQ37nvFoeucKrp3O X-Received: by 10.50.65.101 with SMTP id w5mr8692851igs.3.1446416106485; Sun, 01 Nov 2015 14:15:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.159.195 with HTTP; Sun, 1 Nov 2015 14:14:26 -0800 (PST) In-Reply-To: <1446169946-28117-1-git-send-email-jistone@redhat.com> References: <1446169946-28117-1-git-send-email-jistone@redhat.com> From: Doug Evans Date: Sun, 01 Nov 2015 22:15:00 -0000 Message-ID: Subject: Re: [PATCH] Implement 'catch syscall' for gdbserver To: Josh Stone Cc: gdb-patches , Sergio Durigan Junior , Pedro Alves , Philippe Waroquiers Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00008.txt.bz2 On Thu, Oct 29, 2015 at 6:52 PM, Josh Stone wrote: > This adds a new QCatchSyscalls packet to enable 'catch syscall', and new > stop reasons "syscall_entry" and "syscall_return" for those events. It > is currently only supported on Linux x86 and x86_64. > > Based on work from Philippe Waroquiers . > > Beyond simple rebasing, I've also updated it to store the syscall catch > lists uniquely to each target process, and updated entry/return logic > from checking ENOSYS to now matching gdb's current Linux logic. > > 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. Hi. I haven't reviewed the patch completely yet, but one comment. We generally have a convention for recording all significant authors of a patch in the ChangeLog entry. If Philippe doesn't want his name in the c/l entry that's cool, but if there is a significant amount of his work here we should note it in the c/l entry.