This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] x86-64 fixes
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: mludvig at suse dot cz
- Date: Fri, 14 Mar 2003 12:12:45 -0500
- Subject: [PATCH] x86-64 fixes
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 at redhat dot 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: