From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8959 invoked by alias); 14 Nov 2013 21:56:20 -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 8948 invoked by uid 89); 14 Nov 2013 21:56:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_05,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Nov 2013 21:56:18 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAELuARs012897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Nov 2013 16:56:10 -0500 Received: from barimba (ovpn-113-124.phx2.redhat.com [10.3.113.124]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rAELu9vb019830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 14 Nov 2013 16:56:09 -0500 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v4 9/9] enable target-async References: <1382464769-2465-1-git-send-email-tromey@redhat.com> <1382464769-2465-10-git-send-email-tromey@redhat.com> <52828856.9070904@redhat.com> Date: Fri, 15 Nov 2013 00:45:00 -0000 In-Reply-To: <52828856.9070904@redhat.com> (Pedro Alves's message of "Tue, 12 Nov 2013 19:58:14 +0000") Message-ID: <87li0qve9y.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-11/txt/msg00397.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: >> static int >> mi_interpreter_prompt_p (void *data) >> { Pedro> Looks quite odd for a predicate function to actually have Pedro> side effects. I guess this is the hack you mentioned? Pedro> I think this is missing a comment explaining what is Pedro> going on. It's not obvious at all to me. Yeah, this is the biggest hack. I will try to comment it some more. The fundamental issue here I ran into is that MI is very odd about when it prints a prompt. So, the hacks are needed to keep the behavior consistent -- even though, IMNSHO, the behavior doesn't actually make any sense. I don't even see why MI needs a prompt, but of course that can't be addressed until someone wants to roll out MI3. >> cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features"); >> - if (target_can_async_p ()) >> + if (mi_target_can_async_p ()) >> ui_out_field_string (uiout, NULL, "async"); >> if (target_can_execute_reverse) >> ui_out_field_string (uiout, NULL, "reverse"); Pedro> Hmm, not sure this is right. This supposedly returns the set of Pedro> supported features. But mi_target_can_async_p returns false Pedro> until the frontend enables target-async. So this change creates Pedro> a sort of chicken and egg situation. That is what I thought, too, but IIRC if one changes this, then a test will fail. Also it is consistent with what gdb does today: (gdb) -list-target-features ^done,features=[] (gdb) set target-async on &"set target-async on\n" ^done (gdb) -list-target-features ^done,features=["async"] (gdb) Strange but true. Actually I think this is symptomatic of the general issue where MI paid attention to "set target-async", whereas I think in a clean design it would not. >> -# so the stop reason is printed into MI uiout an. >> -if {$async} { >> - set reason "end-stepping-range" >> -} else { >> - set reason "" >> -} >> +set reason "end-stepping-range" Pedro> I'm a little confused by this one. Isn't it still necessary Pedro> for targets that don't do async? Not sure if you remember the story. When I started this project I was working under the belief that "set target-async" was a "please enable a feature" sort of option -- that is, it ought to have no user visible effect other than making the "&" feature available; and as such I could simply enable it always, fix the test suite failures, and deprecate the option. However, it turns out that this model did not fit the reality. MI used the target-async setting not just to put the target into async mode and to enable the "&" feature, but also to change its output style in various spots. There's a thread you can dig up where Marc Khouzam says they changed Eclipse to disable target-async explicitly, just to work around the oddities that ensued. For this test case the check may in fact be irrelevant, since we aren't enabling target-async. However if that is so, we might as well drop it anyway on account of clarity. Or maybe this is intended to support running the test suite with some pre-canned MI sequence to enable target async. I would guess nobody ever does this, since I think when I tried something like this (naively setting target_async_permitted = 1), stuff broke all over. Which is apparently intentional. Tom