From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24504 invoked by alias); 14 Mar 2003 17:08:36 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24484 invoked from network); 14 Mar 2003 17:08:35 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 14 Mar 2003 17:08:35 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h2EH8ZQ10805 for ; Fri, 14 Mar 2003 12:08:35 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h2EH8ZV28582 for ; Fri, 14 Mar 2003 12:08:35 -0500 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h2EH8Yn14906 for ; Fri, 14 Mar 2003 12:08:35 -0500 Received: by localhost.redhat.com (Postfix, from userid 469) id 6C7A12C441; Fri, 14 Mar 2003 12:12:46 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15986.3469.893786.554687@localhost.redhat.com> Date: Fri, 14 Mar 2003 17:08:00 -0000 To: gdb-patches@sources.redhat.com Cc: mludvig@suse.cz Subject: [PATCH] x86-64 fixes X-SW-Source: 2003-03/txt/msg00326.txt.bz2 This patch fixes two internal errors I was getting with inferior function calls. Gdb didn't know how to deal with enum parameters and reference parameters. It also fixes some calls to malloc() failures. These were evident in tests that do stuff like p "foo" or p str_func ("foo") or even simple calls like p malloc(2). Michal, can you verify on your platform? If it works for you I'll commit it. thanks elena 2003-03-14 Elena Zannoni * x86-64-tdep.c (x86_64_push_arguments): Handle correctly the signed integer case. (classify_argument): Handle enumerations and references. Index: x86-64-tdep.c =================================================================== RCS file: /cvs/uberbaum/gdb/x86-64-tdep.c,v retrieving revision 1.56 diff -u -p -r1.56 x86-64-tdep.c --- x86-64-tdep.c 14 Mar 2003 16:05:36 -0000 1.56 +++ x86-64-tdep.c 14 Mar 2003 17:07:08 -0000 @@ -471,6 +471,8 @@ classify_argument (struct type *type, return 2; } break; + case TYPE_CODE_ENUM: + case TYPE_CODE_REF: case TYPE_CODE_INT: case TYPE_CODE_PTR: switch (bytes) @@ -700,11 +702,17 @@ x86_64_push_arguments (int nargs, struct intreg += 2; break; case X86_64_INTEGERSI_CLASS: - deprecated_write_register_gen (int_parameter_registers[intreg / 2], - VALUE_CONTENTS_ALL (args[i]) + offset); - offset += 8; - intreg++; - break; + { + LONGEST num + = extract_signed_integer (VALUE_CONTENTS_ALL (args[i]) + + offset, 4); + regcache_raw_write_signed (current_regcache, + int_parameter_registers[intreg / 2], num); + + offset += 8; + intreg++; + break; + } case X86_64_SSEDF_CLASS: case X86_64_SSESF_CLASS: case X86_64_SSE_CLASS: