Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Elena Zannoni <ezannoni@redhat.com>
To: gdb-patches@sources.redhat.com
Cc: mludvig@suse.cz
Subject: [PATCH] x86-64 fixes
Date: Fri, 14 Mar 2003 17:08:00 -0000	[thread overview]
Message-ID: <15986.3469.893786.554687@localhost.redhat.com> (raw)


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  <ezannoni@redhat.com>

	* 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:


             reply	other threads:[~2003-03-14 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-14 17:08 Elena Zannoni [this message]
2003-03-14 20:19 ` Andrew Cagney
2003-03-21 12:19 ` Michal Ludvig
2003-04-04 19:31   ` Elena Zannoni

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=15986.3469.893786.554687@localhost.redhat.com \
    --to=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mludvig@suse.cz \
    /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