From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92649 invoked by alias); 3 Mar 2015 11:56:00 -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 92634 invoked by uid 89); 3 Mar 2015 11:55:59 -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-pa0-f52.google.com Received: from mail-pa0-f52.google.com (HELO mail-pa0-f52.google.com) (209.85.220.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 03 Mar 2015 11:55:59 +0000 Received: by padfa1 with SMTP id fa1so23398582pad.9 for ; Tue, 03 Mar 2015 03:55:57 -0800 (PST) X-Received: by 10.66.221.135 with SMTP id qe7mr54367785pac.97.1425383757262; Tue, 03 Mar 2015 03:55:57 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id r5sm741399pdc.81.2015.03.03.03.55.54 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 03 Mar 2015 03:55:56 -0800 (PST) From: Yao Qi To: Doug Evans Cc: Yao Qi , gdb-patches Subject: Re: [RFC] Support command "catch syscall" properly on different targets References: <1425047015-1906-1-git-send-email-qiyaoltc@gmail.com> Date: Tue, 03 Mar 2015 11:56:00 -0000 In-Reply-To: (Doug Evans's message of "Fri, 27 Feb 2015 10:49:43 -0800") Message-ID: <86twy2i9br.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/msg00065.txt.bz2 Doug Evans writes: > 1) Do we have a story yet for how to handle differences across > multiple targets/inferiors? I don't have such story in my mind. Taking a look at https://sourceware.org/gdb/wiki/MultiTarget and I don't see anything on handling differences across multiple targets. > E.g., while not completely supported today, what if I'm > debugging two targets and one supports "catch syscall" > and one doesn't? "break" applies across all inferiors > (though I really don't like this as a default behaviour), > and it would be odd if "catch" didn't work similarly > by default. When GDB goes to multi-target, syscall catchpoint should be skipped for targets don't support it, IMO. > > We have "thread apply all ...". > We could also have "inferior apply all ...". > E.g., inferior apply all break foo > [I gather itsets can help with this, but I like the consistency.] > > "catch syscall" is target(arch)-specific. > Multi-arch doesn't work today (except for special cases), > but we should understand how we want it to work tomorrow. > And similarly for all such target-specific commands. Oh, multi-arch is supported, isn't? done by these two patch sets in both GDB and GDBserver side respectively, https://sourceware.org/ml/gdb-patches/2012-11/msg00228.html https://sourceware.org/ml/gdb-patches/2013-05/msg01057.html However, I'd say that multi-arch isn't widely used because it is hard to find a case that more than one arch can exist in one single target. Probably once multi-target is supported, multi-arch will be more used. In the future, IMHO, each command has a scope, a term from itset patches, and the command is applied to the given scope. The scope is a set of targets, inferiors and threads. If "catch syscall" command is applied to a scope in which one target doesn't support it, GDB can report an error like "Target foo in scope bar doesn't support 'catch syscall'". > > 2) Another issue that comes to mind is "catch syscall" > calls get_current_arch which is based on the current frame > if the inferior is live. If I'm debugging a multi-arch inferior (e.g., ce= ll), > then when I do "catch syscall" I have to be cognizant of which frame > I'm in when I do that. [Right?] Yeah, I think so. "catch syscall" support varies on different arches, and the frames in the same call chain may have different arches. so "catch syscall" is supported on some frames, and not supported on other frames. > > 3) Does this mean that I now won't be able to do: > > bash$ gdb foo > (gdb) catch syscall open # <-- target =3D=3D "exec" at this point > (gdb) run Yes. --=20 Yao (=E9=BD=90=E5=B0=A7)