From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20647 invoked by alias); 3 Mar 2015 12:14:47 -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 19618 invoked by uid 89); 3 Mar 2015 12:14:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 03 Mar 2015 12:14:43 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t23CEd1M026722 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 3 Mar 2015 07:14:39 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t23CEaFn006831; Tue, 3 Mar 2015 07:14:37 -0500 Message-ID: <54F5A5AC.4030503@redhat.com> Date: Tue, 03 Mar 2015 12:14:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Yao Qi , Doug Evans CC: gdb-patches Subject: Re: [RFC] Support command "catch syscall" properly on different targets References: <1425047015-1906-1-git-send-email-qiyaoltc@gmail.com> <86twy2i9br.fsf@gmail.com> In-Reply-To: <86twy2i9br.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00071.txt.bz2 On 03/03/2015 11:55 AM, Yao Qi wrote: > 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. Pasting from: https://sourceware.org/bugzilla/show_bug.cgi?id=10737#c5 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A related question is how to handle syscalls by name ("catch syscall open"): #1 - when the user kills the program, and then starts another one, of a different architecture, in the same inferior. E.g., - file prog64 - start - catch syscall open - kill - file prog32 - run #2 - similarly, when a 64-bit inferior execs a 32-bit inferior. - file prog64 - start - catch syscall open (2 on 64-bit) - continue - inferior execs prog32 - inferior now calls syscall 2, which is something else on i386. These two cases may end up handled by the breakpoint_re_set machinery. #3 - in the presence of multiple inferiors, each with its own arch. - file prog64 - start - add-inferior -exec prog32 - inferior 2 - start - catch syscall open - set schedule-multiple on - c - both inferiors call "open" Here, I don't think we'll catch inferior 1's. syscall catchpoints is presently inferior-specific; while I think it should end up with a location per inferior instead, and "open" should be parsed in each inferior's/location's arch. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > >> 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. Agreed. >> "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 Yeah. > 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'". > *nod* FYI, I'm getting very close to posting the all-stop-on-top-of-non-stop patch. The remaining dependency (that I had identified) was the moribund locations rework posted recently. Itsets will follow. Thanks, Pedro Alves