[RFA/x86_64] Add handling for TYPE_CODE_CHAR in inferior fun calls
Joel Brobecker
brobecker@adacore.com
Wed Dec 26 14:23:00 GMT 2007
Hello,
There was on ommision inside amd64-tdep.c:amd64_classify regarding
the handling of TYPE_CODE_CHAR types. This shows up when printing
the return value after making a function call inside the inferior.
This shows up inside gdb.ada/char_param.exp:
FAIL: gdb.ada/char_param.exp: call next
Here is what the logs show:
(gdb) call next (first)
$3 = 0 '["00"]'
The expected output is:
(gdb) call next (first)
$3 = 98 'b'
The following patch fixes that ommission:
2007-12-26 Joel Brobecker <brobecker@adacore.com>
* amd64-tdep.c (amd64_classify): Add handling of TYPE_CODE_CHAR.
Tested on x86_64-linux, fixes the FAIL above. No regression.
OK to commit?
Thanks,
--
Joel
-------------- next part --------------
Index: amd64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-tdep.c,v
retrieving revision 1.43
diff -u -p -r1.43 amd64-tdep.c
--- amd64-tdep.c 6 Dec 2007 16:32:58 -0000 1.43
+++ amd64-tdep.c 26 Dec 2007 12:59:49 -0000
@@ -359,6 +359,7 @@ amd64_classify (struct type *type, enum
class. */
if ((code == TYPE_CODE_INT || code == TYPE_CODE_ENUM
|| code == TYPE_CODE_BOOL || code == TYPE_CODE_RANGE
+ || code == TYPE_CODE_CHAR
|| code == TYPE_CODE_PTR || code == TYPE_CODE_REF)
&& (len == 1 || len == 2 || len == 4 || len == 8))
class[0] = AMD64_INTEGER;
More information about the Gdb-patches
mailing list