This is the mail archive of the
mailing list for the GDB project.
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb at sources dot redhat dot com
- Date: Sat, 12 Jan 2002 19:24:26 -0500
- Subject: longest_local_hex_string_custom()
The sprintf("%llx",...) drew my attention to something else about that
file. All the local_hex_string stuff.
Looking at the code I'm getting the feeling that it is going out of its
way to worry about long/long-long l/ll when it shouldn't at all.
Traditionally, printf() includes l/ll qualifiers so that it knows the
size of arguments. For insance:
printf("%d\n", (long long) 1);
can be something of a disaster. In the case of this code, however, I
think GDB knows its size (it is LONGEST right?) and hence that info is
completly redundant. Instead GDB should just allow things like:
(gdb) printf "%x", (long long) 1
Provided GDB interprets those formats directly and doesn't try to slip
them through to sprintf() all should be ok.
Does anyone more familar with the code think this is a reasonable
interpretation? I hacked on it a few years back but at the time never
thought to look at the big picture so the mess is probably part mine :-(