]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
gdb: print thread names in thread apply command output
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 18 Feb 2020 00:08:03 +0000 (19:08 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 26 Feb 2020 21:23:11 +0000 (16:23 -0500)
commitb65ce565416b950d8730b34106c54779c48efd29
tree3d6b332ab4c995ebd6311af193dc00e4101b2504
parentd4c9a4f87ddbbb79d852f59ee1723e03294540c2
gdb: print thread names in thread apply command output

This makes the thread apply command print the thread's name.  The use
of target_pid_to_str is replaced by thread_target_id_str, which
provides the same output as "info threads".

Before:
(gdb) thread apply 2 bt

Thread 2 (Thread 0x7fd245602700 (LWP 3837)):
[...]

After:
(gdb) thread apply 2 bt

Thread 2 (Thread 0x7fd245602700 (LWP 3837) "HT cleanup"):
[...]

The thread's description header is pre-computed before running the
command since the command may change the selected inferior. This is
not permitted by thread_target_id_str as target_thread_name asserts
that `info->inf == current_inferior ()`.

This situation arises in the `gdb.threads/threadapply.exp` test which
kills and removes the inferior as part of a "thread apply" command.

gdb/ChangeLog:

        * thread.c (thr_try_catch_cmd): Print thread name.
gdb/ChangeLog
gdb/thread.c