Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [RFA/x86_64] Add handling for TYPE_CODE_CHAR in inferior fun calls
Date: Wed, 26 Dec 2007 14:23:00 -0000	[thread overview]
Message-ID: <20071226131934.GN31301@adacore.com> (raw)

[-- 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;

             reply	other threads:[~2007-12-26 13:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-26 14:23 Joel Brobecker [this message]
2008-01-29 17:16 ` Daniel Jacobowitz
2008-01-29 21:44   ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071226131934.GN31301@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox