Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/x86_64] Add handling for TYPE_CODE_CHAR in inferior fun calls
@ 2007-12-26 14:23 Joel Brobecker
  2008-01-29 17:16 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2007-12-26 14:23 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

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

[-- Attachment #2: amd64-tdep.c.diff --]
[-- Type: text/plain, Size: 655 bytes --]

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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-29 21:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-26 14:23 [RFA/x86_64] Add handling for TYPE_CODE_CHAR in inferior fun calls Joel Brobecker
2008-01-29 17:16 ` Daniel Jacobowitz
2008-01-29 21:44   ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox