From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C789B388A41E; Tue, 29 Dec 2020 18:38:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C789B388A41E From: "kelly at 219design dot com" To: gdb-prs@sourceware.org Subject: [Bug cli/27125] unwanted interaction of [-ex "bt"] with [-batch -return-child-result]. used to work in gdb 8.1 Date: Tue, 29 Dec 2020 18:38:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli X-Bugzilla-Version: 9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kelly at 219design dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2020 18:38:41 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27125 --- Comment #4 from kelly at 219design dot com --- I have found a workaround. If I add a second copy of [-ex "run"] then I can achieve essentially the results that I enjoyed previously. So with: gdb -n -batch -return-child-result -ex "set args /tmp/hork" -ex "run" -ex "= bt" -ex "run" /bin/touch [Inferior 1 (process 19143) exited normally] No stack. [Inferior 1 (process 19147) exited normally] Note the repetition: ex "run" -ex "bt" -ex "run" Then I can enjoy my prior continuous integration benefits: Benefit 1: If the inferior crashes, then my outer bash script (using bash -= e) terminates, but I also will see the backtrace printed by gdb. Benefit 2: If the inferior does not crash, then the gdb instance exits 0 an= d my continuous integration bash script (using bash -e) can continue onward. The downsides (which I consider minimal) are: - extra time spent in CI to run my target (the inferior) twice, and - the possibility that if an intermittent crash happens on the SECOND run inside gdb, then I will not be able to capture that backtrace Now my fear is that upon seeing: ex "run" -ex "bt" -ex "run" Someone will decide that gdb should exit 1 immediately upon hitting that [-= ex "bt"], which will deprive me of my new-found workaround.=20 So again I will return to the following idea: "-return-child-result" should probably override the batch-failure behavi= or introduced in commit b0f492b90f3d13d --=20 You are receiving this mail because: You are on the CC list for the bug.=