From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 002803834409; Wed, 3 Feb 2021 20:07:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 002803834409 From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/27339] New: Stepping an instruction that makes the thread exit acts as continue Date: Wed, 03 Feb 2021 20:07:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: NEW 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Wed, 03 Feb 2021 20:07:16 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27339 Bug ID: 27339 Summary: Stepping an instruction that makes the thread exit acts as continue Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: simark at simark dot ca Target Milestone: --- When using a stepping command and hitting an instruction that makes the thr= ead exit, it looks as a "continue" from the point of view of the user. Using the binary from the test case attached to https://sourceware.org/bugzilla/show_bug.cgi?id=3D27338 $ ./gdb -q -nx --data-directory=3Ddata-directory testsuite/outputs/gdb.threads/step-over-thread-exit/step-over-thread-exit -= ex "tb my_exit_syscall" -ex r=20=20=20=20=20=20=20=20 Reading symbols from testsuite/outputs/gdb.threads/step-over-thread-exit/step-over-thread-exit... Temporary breakpoint 1 at 0x123c: file /home/simark/src/binutils-gdb/gdb/testsuite/lib/my-syscalls.S, line 68. Starting program: /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.threads/step-over= -thread-exit/step-over-thread-exit=20 [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1". [New Thread 0x7ffff7c5e640 (LWP 1318054)] [Switching to Thread 0x7ffff7c5e640 (LWP 1318054)] Thread 2 "step-over-threa" hit Temporary breakpoint 1, my_exit_syscall () at /home/simark/src/binutils-gdb/gdb/testsuite/lib/my-syscalls.S:68 68 syscall (gdb) Doing a "stepi" at this point continues the program until the end. When a thread is focused, a step-like command is used, and the thread exit,= I think it would instead be more user friendly to get a stop saying that the thread we were stepping has exited. Probably also applies to step, next, finish, etc. If the targets passed thread exit events to infrun when the exiting thread = was stepping (as also suggested in bug 27338), I think infrun could notice that= the thread had an fsm (tp->thread_fsm), and cause a stop. --=20 You are receiving this mail because: You are on the CC list for the bug.=