[2/2] Use %x when printing the TID

Message ID 20191014145744.5535-3-tromey@adacore.com
State New, archived
Headers

Commit Message

Tom Tromey Oct. 14, 2019, 2:57 p.m. UTC
  One spot in windows-nat.c uses %ld to print the TID, but all other
spots use %x, as does the infrun logging.  This makes it unnecessarily
hard to tell which other log messages correspond to this one.  This
patch changes the one outlier to use %x.

gdb/ChangeLog
2019-10-14  Tom Tromey  <tromey@adacore.com>

	* windows-nat.c (windows_nat_target::resume): Use %x when logging
	TID.
---
 gdb/ChangeLog     | 5 +++++
 gdb/windows-nat.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
  

Comments

Joel Brobecker Oct. 15, 2019, 3:55 p.m. UTC | #1
On Mon, Oct 14, 2019 at 08:57:44AM -0600, Tom Tromey wrote:
> One spot in windows-nat.c uses %ld to print the TID, but all other
> spots use %x, as does the infrun logging.  This makes it unnecessarily
> hard to tell which other log messages correspond to this one.  This
> patch changes the one outlier to use %x.
> 
> gdb/ChangeLog
> 2019-10-14  Tom Tromey  <tromey@adacore.com>
> 
> 	* windows-nat.c (windows_nat_target::resume): Use %x when logging
> 	TID.

This is OK as well, Tom. Thank you.

> ---
>  gdb/ChangeLog     | 5 +++++
>  gdb/windows-nat.c | 4 ++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
> index df44994c95a..a756913cabf 100644
> --- a/gdb/windows-nat.c
> +++ b/gdb/windows-nat.c
> @@ -1447,8 +1447,8 @@ windows_nat_target::resume (ptid_t ptid, int step, enum gdb_signal sig)
>  
>    last_sig = GDB_SIGNAL_0;
>  
> -  DEBUG_EXEC (("gdb: windows_resume (pid=%d, tid=%ld, step=%d, sig=%d);\n",
> -	       ptid.pid (), ptid.tid (), step, sig));
> +  DEBUG_EXEC (("gdb: windows_resume (pid=%d, tid=0x%x, step=%d, sig=%d);\n",
> +	       ptid.pid (), (unsigned) ptid.tid (), step, sig));
>  
>    /* Get context for currently selected thread.  */
>    th = thread_rec (inferior_ptid.tid (), FALSE);
> -- 
> 2.20.1
  

Patch

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index df44994c95a..a756913cabf 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1447,8 +1447,8 @@  windows_nat_target::resume (ptid_t ptid, int step, enum gdb_signal sig)
 
   last_sig = GDB_SIGNAL_0;
 
-  DEBUG_EXEC (("gdb: windows_resume (pid=%d, tid=%ld, step=%d, sig=%d);\n",
-	       ptid.pid (), ptid.tid (), step, sig));
+  DEBUG_EXEC (("gdb: windows_resume (pid=%d, tid=0x%x, step=%d, sig=%d);\n",
+	       ptid.pid (), (unsigned) ptid.tid (), step, sig));
 
   /* Get context for currently selected thread.  */
   th = thread_rec (inferior_ptid.tid (), FALSE);