From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92630 invoked by alias); 31 Jan 2018 17:01:17 -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 92620 invoked by uid 89); 31 Jan 2018 17:01:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=2.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=of, of=c2, pasteubuntucom, sk:pasteu?= X-HELO: mail-qk0-f174.google.com Received: from mail-qk0-f174.google.com (HELO mail-qk0-f174.google.com) (209.85.220.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 31 Jan 2018 17:01:10 +0000 Received: by mail-qk0-f174.google.com with SMTP id t134so15618507qke.5 for ; Wed, 31 Jan 2018 09:01:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SYvf5ZHyNdnZ3VQFSC9Sx9SzyPih5VWjCxdtgSRDN5U=; b=cReYatu0qoLjsTH+Vk2ASf9eKgGBJKGPmGcGiGJRG+VHPIdJJEVf6wJc00H2e9uygJ sicKNqQKeVDMhmqFfyBl7VMBSC39B3V9JNhF8QkIxcrUQd/NxCpHvvvusdNyE+9jV6XU z7BPs1dVPhHdfy2Uwcs42jJqaKx3O1JBR3wZCEdZPRGttm1zruxcBxPOMogzvRK0h3kI 7HlLeR80WPWtBzZ2epArKgpkagrprnnHd5cuyVuG57PXC72K7CPFyYd0yVQi1xyaC6q3 kqWBPfuMj81cZOkEXqvCLkBrpF0FruuG0Wykk/HQnB/tkV8qYZVmKWG3ABxLt4xAQRXL 43Zg== X-Gm-Message-State: AKwxytcp+aVZV1CNVd046ZRWpwVu7msYD5yMXKbJBsU0FUoNOXlIdLXV 2Plt5SBoWxoZPn//Ka8g2HDH5aoTO0fmTH+xLZv51g== X-Google-Smtp-Source: AH8x226zlv2XRr5v69+TsYVkQTZajvLwHDuFzh6l1Xrga/DwXW9JzKsr+XE2WTKR9AZdlPgAggJkUcYhHlWennKttFo= X-Received: by 10.55.203.92 with SMTP id d89mr46239314qkj.218.1517418066784; Wed, 31 Jan 2018 09:01:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.55.4 with HTTP; Wed, 31 Jan 2018 09:00:36 -0800 (PST) In-Reply-To: <86607ic75j.fsf@gmail.com> References: <1517222676-467-1-git-send-email-omair.javaid@linaro.org> <86607ic75j.fsf@gmail.com> From: Omair Javaid Date: Wed, 31 Jan 2018 17:01:00 -0000 Message-ID: Subject: Re: [PATCH] Fix for GDB failing to interrupt after run when no PID issued by stub To: Yao Qi Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00667.txt.bz2 On 31 January 2018 at 21:41, Yao Qi wrote: > Omair Javaid writes: > > > Here are the steps to reproduce: > > 1) arm-none-eabi-gdb file-to-debug.elf > > 2) target remote :3333 > > "target extended-remote :3333". > > > At this stage gdb would have connected and halted successfully. > > 3) run > > Issue ctrl + C to interrupt running program and GDB wont be able to sto= p. > > Could you show the log of "set debug remote 1", especially after > "ctrl-c" is typed. I want to understand what is going on over these > packets between GDB and stub, and reproduce it on GDBserver by disabling > some packets. This is what I get, > Heres the gdb log with run (no other command b/w connection and run): https://paste.ubuntu.com/26496015/ Heres the gdb log with continue + run (after we issue a continue/interrupt cycle where inferior PID is set and inferior->control.stop_soon =3D NO_STOP_QUIETLY;) https://paste.ubuntu.com/26496048/ > > (gdb) c > Continuing. > Sending packet: $Z0,7ffff7dea940,1#e0...Packet received: OK > Sending packet: $QPassSignals:#f3...Packet received: OK > Sending packet: $Hc0#db...Packet received: OK > Sending packet: $s#73...Packet received: T0506:c0dcffffff7f0000;07: > c0dcffffff7f0000;10:7f05400000000000; > Sending packet: $Z0,40057a,1#74...Packet received: OK > Sending packet: $QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;2c;4c;97;#0a..= .Packet > received: OK > Sending packet: $Hcpa410.0#6f...Packet received: E01 > Sending packet: $c#63...^Cremote_pass_ctrlc called > remote_interrupt called > Packet received: T0206:ffffffff00000000;07:d8daffffff7f0000;10: > e05dadf7ff7f0000; > Sending packet: $qL1200000000000000000#50...Packet received: > > Program received signal SIGINT, Interrupt. > Sending packet: $z0,40057a,1#94...Packet received: OK > > In the stop reply from my gdbserver, there is no "thread id" either. My > stop reply has expedite registers while OpenOCD doesn't. I don't think > this matters here. > The situation with OpenOCD happens because we ran and set inferior pid to null hoping to update it. Later in extended_remote_create_inferior called buy run command thread pid gets assigned but we are checking inferior->control.stop_soon just before we update the pid and thus it remains to STOP_QUIETLY for lifetime of the inferior as this flag is only altered by attach command handlers or during call of clear_proceed_status > > -- > Yao (=E9=BD=90=E5=B0=A7) >