From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.129.74]) by sourceware.org (Postfix) with ESMTPS id 22CC43856240 for ; Thu, 5 May 2022 08:58:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 22CC43856240 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-ljeVadvZPQm07E-kgkDXJQ-1; Thu, 05 May 2022 04:58:44 -0400 X-MC-Unique: ljeVadvZPQm07E-kgkDXJQ-1 Received: by mail-wm1-f69.google.com with SMTP id r186-20020a1c44c3000000b00393f52ed5ceso4205587wma.7 for ; Thu, 05 May 2022 01:58:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=leE6HDAC/6M8FknnUVhCln8eRoVI732bxFfd6fpP+2s=; b=ZkgCt3nWsiCXWER6LuK54J7ZaEBHwQbqp8scUI8do8YrHXzPRWgBRKS1aH19Tg3aRl U77jwcHjLnhfWY0+t2HDnz7PW1bH6Md0hQhvOyga9ljEol6eN9aPkys458+bdn+SBXGE pCKg9P1OHfm81unBLIivSGglYeqwcEc2e1ld5wEG9PwRgoc2m3BzG+ymdrFUl6oIPEYc k6L8ljrAK1a0M7a4ahd6bgUKZbPYryfZ+TxScMhkaohspX6CpHCKkpugq9o4ERuVDX8k 4SuZePE+5P65bXtYyboWCxyirsoMu3HUaE/hNE+UvcipUgkVaXc1SmFnch9OqV4/O7kV 4N3w== X-Gm-Message-State: AOAM531CNphjuh7ZeK3UjdDCsFSqFY47mV8SIVaM7tF6CA7iETnp+Mps PI+BYUNJsd5PQg6dCyTCGoMs7API3YpMU5s8HumRSHvohUV2zw1ajbG+57famTWBwyr7E8Nzdzx 6uYpNU4aok/s= X-Received: by 2002:a05:600c:2844:b0:393:f6fb:5897 with SMTP id r4-20020a05600c284400b00393f6fb5897mr3680707wmb.66.1651741122918; Thu, 05 May 2022 01:58:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ59jSQq16P5GG3hMw6NfpQ1DmrJUWQ8dOb8Ny1L9cwLhRiYtAbpz/bi+Pg7u3nZg2NcpV8Q== X-Received: by 2002:a05:600c:2844:b0:393:f6fb:5897 with SMTP id r4-20020a05600c284400b00393f6fb5897mr3680697wmb.66.1651741122654; Thu, 05 May 2022 01:58:42 -0700 (PDT) Received: from localhost (host81-136-113-48.range81-136.btcentralplus.com. [81.136.113.48]) by smtp.gmail.com with ESMTPSA id o1-20020a5d6701000000b0020c9520a940sm861367wru.54.2022.05.05.01.58.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 01:58:41 -0700 (PDT) From: Andrew Burgess To: Tim Newsome , gdb Subject: Re: gdb doesn't notice when a target resumes In-Reply-To: References: Date: Thu, 05 May 2022 09:58:40 +0100 Message-ID: <87h764mk3j.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2022 08:58:47 -0000 Tim Newsome writes: > In a setup like this: > gdb --- OpenOCD --- hardware target > > I can download a program, debug, everything is fine. Let's say we're halted > somewhere. > Now something happens that causes the hardware target to be running again > and no longer halted. OpenOCD notices quickly because it polls the target. > But gdb doesn't ever notice that the target was resumed. There doesn't > appear to be a notification packet > > for > OpenOCD to even communicate to gdb that the target has resumed. > > Am I missing something? Have people attempted to tackle this problem? The following is my understanding, others might have a better understanding that contradicts what I say here. GDB expects to be the one driving the state of the target. It's not expected that the target will just resume execution without GDB being the one to set the target resumed. And that makes sense I think. GDB is primarily a debugger. If, as a user, I stop the target in order to examine the state, and the hardware suddenly resumes execution, that's a pretty poor user experience I think. Depending on what the "something" is that sets the target running, you might have more luck if that "something" could instead tell GDB to resume the target. Otherwise you'd need to change GDB I think. Maybe non-stop mode could support the concept of the targtet asynchronously resuming... but I suspect it would not be a trivial addition. Thanks, Andrew