From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71682 invoked by alias); 2 Nov 2019 17:39:59 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 71624 invoked by uid 89); 2 Nov 2019 17:39:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=sends, connection, H*i:sk:L9JkjNN, H*i:sk:SA@mail X-HELO: pb-smtp21.pobox.com Received: from pb-smtp21.pobox.com (HELO pb-smtp21.pobox.com) (173.228.157.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 02 Nov 2019 17:39:57 +0000 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id A30728F750 for ; Sat, 2 Nov 2019 13:39:55 -0400 (EDT) (envelope-from jonah@kichwacoders.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=sasl; bh=rrl6IoG5JGcNxiw2k491+EP1/mQ=; b=J86O0Q fMpFzG7LtdIV9s+np6c6J1a4Xf1oNc1/OsuP3TWlY80NTUPbzD9F75VnMOo6qsJi u54IQyNCYMLfdrRzYMObkbSh6cXjYZCduVcvk6K6pq90q5kGlAPWXk6Dde7NLM7a tqpfZ2n1TqmzegHvTPnndVmW4XRpofF5t2cis= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 9ABA08F74F for ; Sat, 2 Nov 2019 13:39:55 -0400 (EDT) (envelope-from jonah@kichwacoders.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kichwacoders.com; h=mime-version:references:in-reply-to:from:date:message-id:subject:to:cc:content-type; s=mesmtp; bh=b1TR8LDU6KoJTdX/H8c3K/P/LQtfBkudNdITT6i+hBA=; b=GZGCQygoV6AUsty8kYgv8p5//IJ51WuO2VWy5MoPMU5ZcInU4IzPxC3hJ0ke/Q/pYOFA2OffX31g5bjCdIDzA+mSiM5c+w16xzTLonj3fYvcc8IbzTfADhMQ35DLXxhNZ8mJDrs5IYoNUjSjGFabW6ST6lzV1UksmAAxDYQXH7k= Received: from mail-qk1-f171.google.com (unknown [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 4AD0E8F74B for ; Sat, 2 Nov 2019 13:39:52 -0400 (EDT) (envelope-from jonah@kichwacoders.com) Received: by mail-qk1-f171.google.com with SMTP id m125so13680922qkd.8 for ; Sat, 02 Nov 2019 10:39:52 -0700 (PDT) MIME-Version: 1.0 References: <12814f17-0c65-e214-7e68-3214d3ed6ab6@redhat.com> In-Reply-To: From: Jonah Graham Date: Sat, 02 Nov 2019 17:39:00 -0000 Message-ID: Subject: Re: gdb/mi, new-ui. the console and determining when GDB is ready for the next command To: Robert Rossi Cc: Pedro Alves , GDB Development X-Pobox-Relay-ID: C6782DA4-FD97-11E9-8151-8D86F504CC47-18936988!pb-smtp21.pobox.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00007.txt.bz2 Hi Bob, Robert Rossi wrote: > > The question I have is, how are people determining when GDB is ready for > the next > command when using the new-ui feature of GDB? > Are people parsing the CLI window for (gdb)? > Am I missing something obvious? > Eclipse CDT uses gdb for the backend debugger, and it does not actually use the (gdb) prompt except to establish initial connection with gdb. After that Eclipse tracks state of gdb to know when it can send commands. So in your example, CDT looks for messages such as *stopped to know when gdb is stopped and can accept commands. In non-stop mode you further track the running threads to know which you can communicate with. For MI commands CDT sends, it knows when they are done by tracking their ^done messages, it also sends multiple commands at a time before waiting for answers. > In this case also there is no gdb prompt. This happens in the reverse case too, when MI issues a step or similar the CLI terminal does not get a new (gdb) prompt. > Is this expected behavior or an oversight? I am used to this behaviour, but I can't comment on whether it is expected or not, e.g I can type cont even though no fresh (gdb) prompt: (gdb) Breakpoint 5, main () at ../src/helloworld.c:26 26 printf("&x=%p\n", &x); cont Continuing. [Inferior 1 (process 15248) exited normally] (gdb) HTH Jonah