diff options
author | Pedro Alves <palves@redhat.com> | 2016-01-13 10:56:06 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-01-13 10:59:14 +0000 |
commit | 43792cf0de3a49fb871d432343672bdf16270e99 (patch) | |
tree | a0c0937a8ca20d3bbfd466ebf2e1f65f5aabcb24 /gdb/record-btrace.c | |
parent | 8465445732dc04c3fb6cf954274e12d06b274f08 (diff) | |
download | gdb-43792cf0de3a49fb871d432343672bdf16270e99.zip gdb-43792cf0de3a49fb871d432343672bdf16270e99.tar.gz gdb-43792cf0de3a49fb871d432343672bdf16270e99.tar.bz2 |
Centralize thread ID printing
Add a new function to print a thread ID, in the style of paddress,
plongest, etc. and adjust all CLI-reachable paths to use it.
This gives us a single place to tweak to print inferior-qualified
thread IDs later:
- [Switching to thread 1 (Thread 0x7ffff7fc2740 (LWP 8155))]
+ [Switching to thread 1.1 (Thread 0x7ffff7fc2740 (LWP 8155))]
etc., though for now, this has no user-visible change.
No regressions on x86_64 Fedora 20.
gdb/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* breakpoint.c (remove_threaded_breakpoints)
(print_one_breakpoint_location): Use print_thread_id.
* btrace.c (btrace_enable, btrace_disable, btrace_teardown)
(btrace_fetch, btrace_clear): Use print_thread_id.
* common/print-utils.c (CELLSIZE): Delete.
(get_cell): Rename to ...
(get_print_cell): ... this and made extern. Adjust call callers.
Adjust to use PRINT_CELL_SIZE.
* common/print-utils.h (get_print_cell): Declare.
(PRINT_CELL_SIZE): New.
* gdbthread.h (print_thread_id): Declare.
* infcmd.c (signal_command): Use print_thread_id.
* inferior.c (print_inferior): Use print_thread_id.
* infrun.c (handle_signal_stop)
(insert_exception_resume_breakpoint)
(insert_exception_resume_from_probe)
(print_signal_received_reason): Use print_thread_id.
* record-btrace.c (record_btrace_info)
(record_btrace_resume_thread, record_btrace_cancel_resume)
(record_btrace_step_thread, record_btrace_wait): Use
print_thread_id.
* thread.c (thread_apply_all_command): Use print_thread_id.
(print_thread_id): New function.
(thread_apply_command): Use print_thread_id.
(thread_command, thread_find_command, do_captured_thread_select):
Use print_thread_id.
Diffstat (limited to 'gdb/record-btrace.c')
-rw-r--r-- | gdb/record-btrace.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index 6ec981d..9fee3df 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -438,8 +438,8 @@ record_btrace_info (struct target_ops *self) } printf_unfiltered (_("Recorded %u instructions in %u functions (%u gaps) " - "for thread %d (%s).\n"), insns, calls, gaps, - tp->num, target_pid_to_str (tp->ptid)); + "for thread %s (%s).\n"), insns, calls, gaps, + print_thread_id (tp), target_pid_to_str (tp->ptid)); if (btrace_is_replaying (tp)) printf_unfiltered (_("Replay in progress. At instruction %u.\n"), @@ -1864,7 +1864,7 @@ record_btrace_resume_thread (struct thread_info *tp, { struct btrace_thread_info *btinfo; - DEBUG ("resuming thread %d (%s): %x (%s)", tp->num, + DEBUG ("resuming thread %s (%s): %x (%s)", print_thread_id (tp), target_pid_to_str (tp->ptid), flag, btrace_thread_flag_to_str (flag)); btinfo = &tp->btrace; @@ -2131,7 +2131,8 @@ record_btrace_cancel_resume (struct thread_info *tp) if (flags == 0) return; - DEBUG ("cancel resume thread %d (%s): %x (%s)", tp->num, + DEBUG ("cancel resume thread %s (%s): %x (%s)", + print_thread_id (tp), target_pid_to_str (tp->ptid), flags, btrace_thread_flag_to_str (flags)); @@ -2354,7 +2355,7 @@ record_btrace_step_thread (struct thread_info *tp) flags = btinfo->flags & (BTHR_MOVE | BTHR_STOP); btinfo->flags &= ~(BTHR_MOVE | BTHR_STOP); - DEBUG ("stepping thread %d (%s): %x (%s)", tp->num, + DEBUG ("stepping thread %s (%s): %x (%s)", print_thread_id (tp), target_pid_to_str (tp->ptid), flags, btrace_thread_flag_to_str (flags)); @@ -2563,7 +2564,8 @@ record_btrace_wait (struct target_ops *ops, ptid_t ptid, /* We moved the replay position but did not update registers. */ registers_changed_ptid (eventing->ptid); - DEBUG ("wait ended by thread %d (%s): %s", eventing->num, + DEBUG ("wait ended by thread %s (%s): %s", + print_thread_id (eventing), target_pid_to_str (eventing->ptid), target_waitstatus_to_string (status)); |