aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads/killed-outside.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker1-1/+1
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-04-21[gdb] Fix hang after ext sigkillTom de Vries1-0/+64
Consider the test-case from this patch, compiled with pthread support: ... $ gcc gdb/testsuite/gdb.threads/killed-outside.c -lpthread -g ... After running to all_started, we can print pid: ... $ gdb a.out -ex "b all_started" -ex run -ex "delete 1" -ex "p pid" ... Reading symbols from a.out... Breakpoint 1 at 0x40072b: file killed-outside.c, line 29. Starting program: /data/gdb_versions/devel/a.out [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". [New Thread 0x7ffff77fc700 (LWP 3155)] Thread 1 "a.out" hit Breakpoint 1, all_started () at killed-outside.c:29 29 } $1 = 3151 (gdb) ... If we then kill the inferior using an external SIGKILL: ... (gdb) shell kill -9 3151 ... and subsequently continue: ... (gdb) c Continuing. Couldn't get registers: No such process. Couldn't get registers: No such process. (gdb) Couldn't get registers: No such process. (gdb) Couldn't get registers: No such process. (gdb) Couldn't get registers: No such process. <repeat> ... gdb hangs repeating the same warning. Typing control-C no longer helps, and we have to kill gdb. This is a regression since commit 873657b9e8 "Preserve selected thread in all-stop w/ background execution". The commit adds a scoped_restore_current_thread typed variable restore_thread to fetch_inferior_event, and the hang is caused by the constructor throwing an exception. Fix this by catching the exception in the constructor. Build and reg-tested on x86_64-linux. gdb/ChangeLog: 2020-04-21 Tom de Vries <tdevries@suse.de> PR gdb/25471 * thread.c (scoped_restore_current_thread::scoped_restore_current_thread): Catch exception in get_frame_id. gdb/testsuite/ChangeLog: 2020-04-21 Tom de Vries <tdevries@suse.de> PR gdb/25471 * gdb.threads/killed-outside.c: New test. * gdb.threads/killed-outside.exp: New file.