From e432ccf1cb4685b990f9cf10cb84626f52239806 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 28 Mar 2019 14:02:25 +0000 Subject: [PATCH] Fix format specification in display_selector() (again) DWORD type is not a long on 64-bit Cygwin, because that it is LP64. Explicitly cast DWORD values to unsigned long and use an appropriate format. gdb/ChangeLog: 2019-03-28 Jon Turney * windows-nat.c (display_selector): Fixed format specifications for 64-bit Cygwin. --- gdb/ChangeLog | 5 +++++ gdb/windows-nat.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7cb9d8dee03..0d1cb449578 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-03-28 Jon Turney + + * windows-nat.c (display_selector): Fixed format specifications + for 64-bit Cygwin. + 2019-03-28 Philippe Waroquiers * infrun.c (follow_exec): Call target_terminal::ours_for_output. diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index d38ade5855b..47f6cbb5412 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1096,14 +1096,16 @@ display_selector (HANDLE thread, DWORD sel) puts_filtered ("Code (Exec/Read, Conf"); break; default: - printf_filtered ("Unknown type 0x%lx",info.HighWord.Bits.Type); + printf_filtered ("Unknown type 0x%lx", + (unsigned long) info.HighWord.Bits.Type); } if ((info.HighWord.Bits.Type & 0x1) == 0) puts_filtered(", N.Acc"); puts_filtered (")\n"); if ((info.HighWord.Bits.Type & 0x10) == 0) puts_filtered("System selector "); - printf_filtered ("Priviledge level = %ld. ", info.HighWord.Bits.Dpl); + printf_filtered ("Priviledge level = %ld. ", + (unsigned long) info.HighWord.Bits.Dpl); if (info.HighWord.Bits.Granularity) puts_filtered ("Page granular.\n"); else -- 2.30.2