From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106061 invoked by alias); 9 Mar 2015 14:29: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 106048 invoked by uid 89); 9 Mar 2015 14:29:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f174.google.com Received: from mail-pd0-f174.google.com (HELO mail-pd0-f174.google.com) (209.85.192.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 09 Mar 2015 14:29:19 +0000 Received: by pdbft15 with SMTP id ft15so34901929pdb.6 for ; Mon, 09 Mar 2015 07:29:17 -0700 (PDT) X-Received: by 10.70.126.225 with SMTP id nb1mr54925165pdb.40.1425911357308; Mon, 09 Mar 2015 07:29:17 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id np6sm12466063pdb.80.2015.03.09.07.29.14 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Mar 2015 07:29:16 -0700 (PDT) From: Yao Qi To: Sergio Durigan Junior Cc: Yao Qi , Pedro Alves , gdb-patches@sourceware.org Subject: Re: [RFC] Support command "catch syscall" properly on different targets References: <1425047015-1906-1-git-send-email-qiyaoltc@gmail.com> <877fv3kqx1.fsf@redhat.com> <86lhjei8md.fsf@gmail.com> <54F5A90E.8050704@redhat.com> <87bnkaklbe.fsf@redhat.com> <868ufahylt.fsf@gmail.com> <87lhj9zsss.fsf@redhat.com> Date: Mon, 09 Mar 2015 14:29:00 -0000 In-Reply-To: <87lhj9zsss.fsf@redhat.com> (Sergio Durigan Junior's message of "Fri, 06 Mar 2015 17:04:35 -0500") Message-ID: <86vbiags7c.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00220.txt.bz2 Sergio Durigan Junior writes: > So, as I said in my previous messages, I don't think that making the > "catch syscall" command to fail on the exec target. > > What do you think of the attached patch (applies on top of your patch, > rebased to the current HEAD)? It implements what I proposed, but in a > different way. If the target is "None" (no binary loaded) or "exec" > (inferior loaded but never started), then it displays a warning but > still creates the catchpoint. The actual check for these targets > happens in the insert_catch_syscall function, which is called when we > already know if the target actually supports the syscall catchpoint. > > Maybe I forgot to cover some corner case, but I still think we should > support "catch syscall" when no inferior has been started. I don't have a strong opinion against your approach. Since "catch point" is only supported on some arches on linux native target, I think it is OK to leave gdbarch_get_syscall_number_p checking in catch_syscall_command_1, so I withdraw my patch. However, when I play with your patch, I find GDB can disable catch point if= it isn't inserted successfully, in breakpoint.c:insert_bp_location, else if (bl->owner->type =3D=3D bp_catchpoint) { int val; gdb_assert (bl->owner->ops !=3D NULL && bl->owner->ops->insert_location !=3D NULL); val =3D bl->owner->ops->insert_location (bl); if (val) { bl->owner->enable_state =3D bp_disabled; if (val =3D=3D 1) warning (_("\ Error inserting catchpoint %d: Your system does not support this type\n\ of catchpoint."), bl->owner->number); else warning (_("Error inserting catchpoint %d."), bl->owner->number); } as shown below, (gdb) target remote :1234 Remote debugging using :1234 Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols fo= und)...done. 0x00007ffff7ddb2d0 in ?? () from /lib64/ld-linux-x86-64.so.2 (gdb) c Continuing. warning: Error inserting catchpoint 1: Your system does not support this ty= pe of catchpoint. .... (gdb) info breakpoints=20 Num Type Disp Enb Address What 1 catchpoint keep n syscall "open" According this observation, I don't see the need check gdbarch_get_syscall_number_p in catch_syscall_command_1. Probably we can remove it. --=20 Yao (=E9=BD=90=E5=B0=A7)