[PATCH][PR gdb/24351] Fix wrong format specification in display_selector()

Tom Tromey tom@tromey.com
Fri Mar 29 15:19:00 GMT 2019


>>>>> "Jon" == Jon Turney <jon.turney@dronecode.org.uk> writes:

Jon> I believe this is because, unfortunately, DWORD is not long on 64-bit
Jon> Cygwin, because that is LP64 (See [1]).

Jon> I think the only portable way to write this (short of introducing
Jon> inttypes.h PRI_-style macros) is to explicitly cast DWORD type values
Jon> to unsigned long or unsigned int, and use the appropriate format
Jon> (e.g. see [2] for a similar patch I wrote for xserver)

Just FYI, a more typical way in gdb is to use "%s" along with something
like pulongest.  What you did is fine, though, and I don't think
anything needs to be changed.

Tom



More information about the Gdb-patches mailing list